Hacker News new | ask | show | jobs
by wavemode 704 days ago
I can only speak about my personal experience.

When I was in college I read through Haskell Programming From First Principles. My prior programming experience (of probably ~10ish years, as a hobbyist) was mostly C++, Java and PHP.

I found it grueling. I really was just not used to reading definitions like

  newtype State s a = State { runState :: s -> (a, s) }
  instance Monad (State s) where
      return x = State $ \s -> (x,s)
      (State h) >>= f = State $ \s -> let (a, newState) = h s
                                          (State g) = f a
                                      in  g newState
Nowadays, such a definition (and its practical applications) seems very trivial, but at the time I remember it felt like learning a new type of math, or a new language. Most of my time reading that book was spent struggling to figure out how the types fit together and why they were useful and/or necessary to be structured the way they were.

This wasn't the book's fault - I actually think the book does go to great lengths to try to guide the reader gradually toward understanding. My brain just wasn't ready for it. It took a long time of playing around with Haskell, as well as playing around with other languages (and seeing things like async-await and thinking to myself "hey! that's a monad!") before these things became second nature. I think it just goes to the concept of "osmosis" in psychology - sometimes you subconsciously absorb information over time before it starts to make sense.

Dunno if this comment constitutes "advice" per se, lol. Just offering you something to relate to, I guess.