Thanks for all the responses. I'll start with LYAH.
Thanks for all the responses. I'll start with LYAH.
1. Has taught a lot of Haskell
2. Thinks LYAH is better as a reference than a step-by-step method for learning Haskell
Then see my Learning Haskell gist here (it includes Haskell Fast & Hard, and other things too).
https://gist.github.com/bitemyapp/8739525
If anybody is learning Haskell and needs help, please email me.
Edit: I agree with nnq, I think LYAH moves too slowly and fails to show you what about Haskell is truly different and worthwhile in a compact enough format. That said, it is great as a reference as the explanations of concepts are stand-alone. (unlike RWH which is more project-oriented)
Edit2: You are going to feel a bit lost after Haskell Fast & Hard. This is natural. That's why I have you do the NICTA course. It firms things up.
Edit3: I think RWH is a great reference as well, but the mid-to-late chapters have a bit of an "in media res" thing going on because there are projects being walked through cross-chapter. That said, it has a very nice and simple example of, "pre-monads, ugly code; post-monads, pretty code". RWH also covers topics that you'll care about if you're doing Haskell in production.
I do it every year but hit io monads and my mind continually just has a core dump. Some year I hope to climb everest.
Stop doing that. I explicitly say in my gist:
"Most of all, don't sweat the stuff you don't understand immediately. Just keep moving."
IO is not important. It behaves no differently at a basic level than any other monad. Monads themselves are just an interface.
Don't put the knowledge on a pedestal, just keep hacking Haskell. It'll all come with time.
This blog post of mine might lend some intuition for monads (including IO): http://bitemyapp.com/posts/2014-03-24-monads-bind-join-actio...
But don't get stuck. It doesn't matter. Just write Haskell code. The compiler won't let you do anything too crazy anyway.
I suggest HFH ("Haskell Fast & Hard") as the introductory tutorial to start with instead. You can pick from 2 formats:
- http://yannesposito.com/Scratch/en/blog/Haskell-the-Hard-Way... - static all-in-one-page format with pretty pictures
- https://www.fpcomplete.com/school/to-infinity-and-beyond/pic... - split version, but with the ability to open snippets in their web based IDE
...after this, Real World Haskell is probably the next step: http://book.realworldhaskell.org/read/ (I'm still at this step).
Running through some chapters of Real World Haskell online, however, is proving to be a bit of an eye opener ;-)
Might just be that I could care less about hand drawn illustrations and the occassional somewhat humerous aside.
YMMV, many seem to love LYAH.
Sounds kind of miserable, right?
That's why you should also prepare for it with some of that early curiosity and wonder that drove us all to learn programming to begin with.
Haskell is probably unlike anything you've used before.
Here is the list of materials I used to learn Haskell:
1. LYAH, http://learnyouahaskell.com/
2. Real world Haskell: http://book.realworldhaskell.org/read/
3. Programming in Haskell: http://www.amazon.com/Programming-Haskell-Graham-Hutton/dp/0... (No one suggests this book, but I do think this book is well-written and concise.)
4. Video tutorial by Erik Meijer based on Programming in Haskell: http://channel9.msdn.com/Series/C9-Lectures-Erik-Meijer-Func...
5. Advanced topics: http://www.haskellforall.com/2014/03/introductions-to-advanc...
Edit: Format
To learn something that hard, you need to be exposed to it multiple times. You'll probably get overwhelmed even with LYAH, but give it some time and come back to it.
There is also Real World Haskell [0]. It's a lot less long winded than LYaH, which is good or bad depending on how you like to digest information.
Also, check out FP Complete's FP Haskell Center [1]. It contains community written tutorials with inline runnable code examples, so you can really get a feel for Haskell by manipulating and playing with the examples right on the site.
All questions have solutions you can learn from; most have multiple solutions. I have learned a lot from doing these problems and doing additional research where needed.
(This is in addition to the other good learning resources like the oft mentioned LYAH.)
(I'm a Haskell beginner, currently experimenting with using Scotty, Persistent and Esqueleto to make a web API - and these articles have been so useful to me - I'm finally getting my head around monad transformers, using them to extend the standard Scotty one. Proud moment for me.)
http://www.haskell.org/haskellwiki/H-99:_Ninety-Nine_Haskell...
Also, there's no substitute for talking to people. Hop on the Haskell Beginners mailing list (http://www.haskell.org/mailman/listinfo/beginners) or drop by the IRC channel (#haskell on freenode), where people couldn't be friendlier.
Both are helping my limited experience of Haskell greatly.
You might like this:
http://www.haskell.org/haskellwiki/Haskell_Tutorial_for_C_Pr...
And the Gentle Introduction is not very gentle but is a good reference:
Then again, that might be because when I looked into Haskell, I realised it was the language I wished to create.
This forces you to put all your code into method signatures. This, in turn, means Haskell (or C, if you follow the 1 semicolon rule in C) can understand almost everything about your program.
If you actually follow the 1 semicolon rule in C, you'll get very verbose syntax. All of Haskell's syntax is in service of making programming in this style palatable.