News for hackers. Stuff that matters.
Re:GHC 7.8.1 released by Sir_Cmpwn on Wednesday April 09, 2014 @12:29PM (#7560351)
I really want to get into Haskell, but I just don't understand it. The tutorial on the official site doesn't do it for me. Can anyone suggest alternative resources for learning? I'm used to C-like languages.

Thanks for all the responses. I'll start with LYAH.

Re:GHC 7.8.1 released by coolsunglasses on Wednesday April 09, 2014 @02:03PM (#7561030)
If you want an alternative opinion from somebody who

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.

Re:GHC 7.8.1 released by mitchty on Wednesday April 09, 2014 @02:53PM (#7561470)
Cool, i'm going to look at that gist for this years "try to learn haskell... again" attempt. :)

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.

Re:GHC 7.8.1 released by coolsunglasses on Wednesday April 09, 2014 @04:58PM (#7562342)
>I do it every year but hit io monads and my mind continually just has a core dump

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.

Re:GHC 7.8.1 released by nnq on Wednesday April 09, 2014 @01:39PM (#7560840)
I sincerely recommend against LYAH! It takes sooooooooo loooooong to get to the interesting bits that actually make Haskell worth learning an has so many try-to-be-funny examples that it makes you run away screaming... I tried going through it but it was literally oscillating between putting my mind to sleep and making wish to grab a chainsaw :) And the "humor" and "pretty pictures" don't help either... they were more like poignant guide to ruby, something that you either love or they annoy the hel out of you (this was for me), but either way they don't help the learning experience at all.

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).

Re:GHC 7.8.1 released by virtualwhys on Wednesday April 09, 2014 @03:47PM (#7561856)
I concur, LYAH was, for me, not a terribly useful intro to Haskell.

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.

Re:GHC 7.8.1 released by rando289 on Wednesday April 09, 2014 @03:26PM (#7561696)
I accidentally upvoted you, but I disagree. LYAH is a great book to actually read through, and I enjoyed the humor. real world haskell introduces things without explaining and it's quite confusing and inconsistent.
Re:GHC 7.8.1 released by pestaa on Thursday April 10, 2014 @01:16AM (#7564316)
Why would downvote for disagreeing? GP is actually a well written comment, and very much deserves the upvote.
Re:GHC 7.8.1 released by tel on Wednesday April 09, 2014 @12:59PM (#7560571)
Others have linked tutorials. I'm going to leave some advice: pretend like you're learning to program from scratch. Not just mentally but in how you invest. It will likely take some amount of time, it will likely happen in stages of progressively receding complete astonishment and confusion, and you will be served to be proud of silly things like getting simple programs to even compile.

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.

Re:GHC 7.8.1 released by freyrs3 on Wednesday April 09, 2014 @02:30PM (#7561283)
This is most certainly the best advice you can give to someone coming from other languages. I constantly see people I very much respect for their skills in other programming disciplines get very angry and make otherwise irrational rants about Haskell because they can't translate their hard won skills over to this new model. Learning Haskell will make one feel like a beginner again, should just embrace that from the start.
Re:GHC 7.8.1 released by dengnan on Wednesday April 09, 2014 @01:02PM (#7560594)
When I learn something, I would like to simultaneously read several books on the same topic, so that I could learn same things from different perspective. It works great for me when I learn Haskell, Scala, and other things.

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

Re:GHC 7.8.1 released by embwbam on Wednesday April 09, 2014 @01:11PM (#7560653)
One thing to keep in mind: Haskell is different enough that it's almost as hard as learning to program the first time.

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.

Re:GHC 7.8.1 released by dmunoz on Wednesday April 09, 2014 @12:36PM (#7560401)
Learn You a Haskell for Great Good! has already been recommended, which I would have said if it had not yet been.

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.

[0] http://book.realworldhaskell.org/read/

[1] https://www.fpcomplete.com/business/fp-haskell-center/

Re:GHC 7.8.1 released by Buttons840 on Wednesday April 09, 2014 @01:29PM (#7560783)
I recommend the 99 Haskel problems: http://www.haskell.org/haskellwiki/H-99:_Ninety-Nine_Haskell...

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.)

Re:GHC 7.8.1 released by bretthoerner on Wednesday April 09, 2014 @12:31PM (#7560361)
Re:GHC 7.8.1 released by gamegoblin on Wednesday April 09, 2014 @12:35PM (#7560388)
I tried getting into haskell probably 3 times before it really stuck with me. After getting over the initial hump it's heavenly. I started with LYAH like others have recommended. Persistence!
Re:GHC 7.8.1 released by RaphiePS on Wednesday April 09, 2014 @12:36PM (#7560403)
Re:GHC 7.8.1 released by joehillen on Wednesday April 09, 2014 @07:03PM (#7563118)
Don't bother with LYAH. I learned Haskell from a lecture created by one of the creators of the language, Philip Wadler: https://www.youtube.com/playlist?list=PL4C1D41CB47EED318
Re:GHC 7.8.1 released by stusmith1977 on Thursday April 10, 2014 @06:39AM (#7565134)
I've found the "24 Days of Hackage" series incredibly useful - each day is a brief introduction to a useful Haskell library, many of which show off features of Haskell that aren't available in 'standard' languages. Even better, each one comes with working example source on GitHub, so you've got a starting point if you do want to experiment.

http://ocharles.org.uk/blog/

(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.)

Re:GHC 7.8.1 released by efnx on Wednesday April 09, 2014 @01:00PM (#7560573)
After LYAH I learned a lot from doing as many of the 99problems set for Haskell as possible.

http://www.haskell.org/haskellwiki/H-99:_Ninety-Nine_Haskell...

Re:GHC 7.8.1 released by dllthomas on Wednesday April 09, 2014 @02:06PM (#7561047)
No one's mentioned the wikibook. I've not read through it much, but a colleague found it far more readable than LYAH: http://en.wikibooks.org/wiki/Haskell (I loved LYAH myself, though, so YMWillProbablyV).

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.

Re:GHC 7.8.1 released by SkyMarshal on Wednesday April 09, 2014 @01:31PM (#7560800)
Miran Lipovaca's LYAH is one of the best intro to programming, not just intro to Haskell, books I've read. He's great at explaining complicated technical concepts clearly.
Re:GHC 7.8.1 released by rasur on Thursday April 10, 2014 @07:24AM (#7565243)
I'm lurching through the wikibook: http://en.wikibooks.org/wiki/Write_Yourself_a_Scheme_in_48_H... with a side order of the Haskell Report/Reference for when things are not clear to me.

Both are helping my limited experience of Haskell greatly.

Re:GHC 7.8.1 released by startling on Thursday April 10, 2014 @04:17AM (#7564815)
(hi!)

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:

http://www.haskell.org/tutorial/

Re:GHC 7.8.1 released by lelf on Wednesday April 09, 2014 @01:16PM (#7560686)
I can recommend reading SICP first if you know nothing about functional programming. It will likely help a lot. And forget everything you know from C-like languages (I'm not joking).
Re:GHC 7.8.1 released by TazeTSchnitzel on Wednesday April 09, 2014 @07:03PM (#7563119)
I'm enjoying Learn You a Haskell.

Then again, that might be because when I looked into Haskell, I realised it was the language I wished to create.

Re:GHC 7.8.1 released by Dewie on Wednesday April 09, 2014 @12:34PM (#7560379)
Learn You A Haskell For Great Good (free online book) is the most common recommendation for beginners.
Re:GHC 7.8.1 released by tavoe on Wednesday April 09, 2014 @01:56PM (#7560977)
To me, the core of Haskell is that: "Haskell is C with one semi-colon per function."

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.