Hacker News new | ask | show | jobs
by quickthrower2 1671 days ago
To be fair, once you get a compiler error you’ll at least need to know:

a. do notation is converted to haskell b. what the bind and return functions do, for IO

So you can figure out;

c. Why your types are not lining up

To understand Haskell in general you need to realise do, bind and return are generic and can be used for not just IO but say for Maybe, List etc.

Basically you need to know most practical things about monads!

I had a bad time writing Haskell do notation until I understood monads. I used to write imperative code, try =, try <-, always undo typing back to known working states etc. to try and magic the code into compiling.

1 comments

That's a good point. It was long enough since I learned this stuff that I mentally translate "Monad m => m a" into "IO String" for example in type errors, to the point of not even noticing how cryptic the generic types can be!