Haskell - Tutorial 3 - Data Types

Поделиться
HTML-код
  • Опубликовано: 24 янв 2025

Комментарии • 4

  • @peterpistole2855
    @peterpistole2855 3 года назад

    if I‘m not mistaken „map :: (a -> b) -> [a] -> [b]“ could be read „takes a function of a to b and a list of a and returns a list of b“, of course, as far as I understand haskell as a beginner, your take „takes a function from a to b and maps it to a function from list of a to list of b“ is correct, in particular, I think it’s even closer to what signatures are supposed to mean in haskell, because as far as I understand, every function we‘re talking about in haskell is actually of arity 1, returns something and gets curried in order to abstract functions of arity >1, but somehow I find it more intuitive to think of „f :: a0 -> ... -> an“ as „takes a0 to an-1 and returns an“. Might this way of thinking cause problems at some point? btw thx for the content

    • @jameshobson6965
      @jameshobson6965  3 года назад

      It really helps to be flexible in how you think about functions, especially with the point free style. You might not hit any problems but it could slow you down. My thoughts go to contramap :: (Contrafunctor f) => (a -> b) -> f b -> f a. If you can't think flexibily then you will struggle to use this function!

  • @EcommerceGrowthHacker
    @EcommerceGrowthHacker 3 года назад +3

    Such good tutorials. Such a shame that's impossible to see what you're writing in your screen though

    • @jameshobson6965
      @jameshobson6965  3 года назад +4

      Is a shame! But these early tutorials are still useful. I have been told if you just listen to them and shut your eyes you fall asleep very very quickly! My monotonous voice is double purposed!