by ssivark · 13y ago · 0 comments
1. Yann Esposito's Haskell Fast and Hard (on FPcomplete -- https://www.fpcomplete.com/user/yogsototh/haskell-fast-hard)
2. Learn you a Haskell by Miran Lipovaca http://learnyouahaskell.com/
The latter author decided to write the book based on his experience in learning Haskell. It's definitely one of the simplest and clearest programming books I've read.
If you did, you are a substantially smarter person than I.
All the resources I've seen for Haskell start the same
They are insanely easy to follow at the start, so simple that even first time programmers won't have much trouble following. Then the type algebra hits and everything goes out the window.
I've made 3 attempts to get through it. I can even see situations in my work where monads and monoids may very well be applicable. I still can't work with Haskell, nor get through any resource that discusses them.
It's possible I'm an idiot, but I suspect my co-workers would fare worse, and it damns the language in my book.
No, you're definitely not an idiot. Haskell's type system is a completely different language, semantically speaking, from its language of terms. This type language is much more like a logic programming language than a functional one. Type variables are unified by the type inference engine, a concept with which most people are unfamiliar. Type constructors are easily mistaken for data constructors (they often use the same name). A lot of Haskell tutorials gloss over these details which is unfortunate.
Please don't get discouraged. Once you start to grok the type system you'll be amazed at how powerful it is. It's pretty incredible how well it works at inferring all the types and catching countless errors. The oft-cited claim that Haskell programs "just work" once they pass the type-checker is true in the vast majority of cases. The amount of work it saves you by not having to write (and maintain) unit tests is staggering.
I don't want to start a flame war, but I view types as being sort of peripheral to the task of getting the computer to do things. If type systems are getting in the way of programming, priorities are getting mixed up.