
Learn You a Haskell for Great Good (2008) - kmooney
http://learnyouahaskell.com/
======
felixgallo
I think the current 'definitive' resource for learning Haskell is
[https://github.com/bitemyapp/learnhaskell](https://github.com/bitemyapp/learnhaskell),
which has well-curated, comprehensive links.

~~~
saosebastiao
I won't read that one on principle alone. The author (coolsunglasses on HN)
runs around all the various forums (, threads, and subreddits) for other
languages, trolling other users and making fun of their languages. He's a
complete asshole. Besides, Real World Haskell and Learn You a Haskell are both
extremely competent books/tutorials.

------
QuantumRoar
Haskell is such a great language. I've been recommending this book for a while
now. If you are in doubt whether you should start learning it, read this post
by Jeff Bone:

[http://www.xent.com/pipermail/fork/Week-of-
Mon-20070219/0441...](http://www.xent.com/pipermail/fork/Week-of-
Mon-20070219/044101.html)

After I read it, I immediately began learning Haskell. Since then, Haskell
made my brain melt multiple times. But it has also enabled me to build an
expression parser and analytic differentiator that I use every day (among
other things, but that's what I'm most proud of). Such a program would be a
lot harder to create, if it weren't for Haskell's ridiculously powerful type
system and pattern matching.

Also, after learning the Haskell way of things, I recognized the reasons for
many issues I had with code written in another programming language. Don't
just go out there and do object-oriented programming because everybody else
seems to do it, often it is imperative (pun intended) to use the declarative
(functional) programming paradigm to keep you out of debugging hell.

edit: clarification

~~~
amelius
I'm not sure if that link is NSFW or not :)

~~~
smcl
Certainly doesn't help with the perception of the tech industry as a boys
club. I mean I know it may have been written in jest but I was personally
cringing while reading it and figured it'd be at the very least a little
alienating (at worst outright offensive) for any women who'd happen to read
it. Maybe I'm being oversensitive, I just know I wouldn't write anything like
that.

~~~
Zuider
Are you serious? From your description, I was expecting some kind of gross
pornography. I think that these 'rolling in the aisles' displays of public
piety in the service of political correctness are getting a little out of hand
these days.

~~~
smcl
I think you are exaggerating somewhat, I was just saying I didn't like it and
even caveated that this could be just me being oversensitive.

However if you can't see why someone may feel a bit weird reading "You'd be
there, banging away at your regular girl" then I'm not sure what I can say.
It's not rolling-in-the-aisles piety, it's just that our community already has
a bad image and stuff like this isn't helping.

------
RMarcus
We'd be remiss not to mention the Erlang counterpart...

[http://learnyousomeerlang.com/](http://learnyousomeerlang.com/)

------
clark-kent
What is a good online reference to learn about "Monads" for beginners? Someone
posted a reference here on HN sometime ago but I lost it.

Edit: The book was enjoyable and a delight to read, but I started struggling
to keep up from Chapter 8. as it went into Monoids and Monads, I feel like I
need to read other tutorials before coming back to it.

~~~
mietek
The original monad papers, by Philip Wadler. Accept no substitutes.

[http://homepages.inf.ed.ac.uk/wadler/topics/monads.html](http://homepages.inf.ed.ac.uk/wadler/topics/monads.html)

[http://homepages.inf.ed.ac.uk/wadler/](http://homepages.inf.ed.ac.uk/wadler/)

Alternatively, if you really are allergic to LaTeX, or beards, the recently
Oscared sigfpe’s “You Could Have Invented Monads! (And Maybe You Already
Have.)”

[http://blog.sigfpe.com/2006/08/you-could-have-invented-
monad...](http://blog.sigfpe.com/2006/08/you-could-have-invented-monads-
and.html)

There are no other monad tutorials. Just forget about them.

~~~
codygman
I highly recommend "You could have invented Monads", it helped me a lot. I
also recommend the Haskell Wikibook:

[http://en.wikibooks.org/wiki/Haskell/Understanding_monads](http://en.wikibooks.org/wiki/Haskell/Understanding_monads)

------
Confusion
I want to note that LYAH may not work for you if you have my kind of learning
style. I need to solve concrete, realistic problems to creatively use the
knowledge imparted on me. I can't just read stuff and understand. Real World
Haskell [1], the course by Erik Meijer [2] and the courses referenced here [3]
worked much better for me.

[1] [http://book.realworldhaskell.org/](http://book.realworldhaskell.org/)

[2] [https://www.edx.org/course/introduction-functional-
programmi...](https://www.edx.org/course/introduction-functional-programming-
delftx-fp101x)

[3]
[https://github.com/bitemyapp/learnhaskell](https://github.com/bitemyapp/learnhaskell)

------
XYEaQMZJvS
That sun cracks me up almost every time.

~~~
loosescrews
My favorite is:

"If we think of a list as a monster, here's what's what."

[http://s3.amazonaws.com/lyah/listmonster.png](http://s3.amazonaws.com/lyah/listmonster.png)

------
cranium
I like Haskell for the same reasons I like VIM:

\- It needs some brain melting to learn but it ultimately makes you a better
coder. Time is not wasted on learning it. \- A new exciting mindset !

\- When you feel you're doing something repetitive, it's nearly sure there is
a way to do it effortless.

\- Advanced stuff

------
mod3rn0
For newcomers I'd suggest this introductory course by Erik Meijer:
[https://www.edx.org/course/introduction-functional-
programmi...](https://www.edx.org/course/introduction-functional-programming-
delftx-fp101x) . It's about FP, not strictly Haskell, but it really helped me
starting with it and really stimulated my curiosity (and he really can explain
hard concepts in a simple way imo). I started reading the book after I
completed the course and helped giving an answer to a lot of questions I had
during the course.

------
mgraczyk
I'm currently working through this book. Overall it seems like a good
introduction but I wish it had exercises at the end of each section. I learn
best by working through specific problems.

~~~
nescoiquid
Word.

There's Real World Haskell by Don Stewart
([http://book.realworldhaskell.org/read/index.html](http://book.realworldhaskell.org/read/index.html)),
though the order of exposition is different and your mileage may vary with the
exercises.

I did find that "Programming in Haskell" by Graham Hutton was a very clear
read and had good programming exercises.

------
quadrangle
I suggest the Haskell Wikibook as the best overall intro to Haskell actually:
[http://en.wikibooks.org/wiki/Haskell](http://en.wikibooks.org/wiki/Haskell)

(and you can make it better if you find anything to complain about! but
seriously, it's superb)

------
gambogi
Supremely useful reference:
[http://dev.stephendiehl.com/hask/](http://dev.stephendiehl.com/hask/)

------
laex
Should I learn oCaml instead ? Looks appealing because companies like Facebook
are using it create tools like Flow (
[https://github.com/facebook/flow](https://github.com/facebook/flow) ).

~~~
davexunit
Why do people choose programming languages based upon which big companies are
using them? Learn a programming language because it is interesting, not
because Facebook uses it.

~~~
laex
Facebook is huge influencer in the open-source world. I don't see anything
wrong with learning the tools/languages that it adopts. There are far smarter
people working there.

In context of this question, It seems that learning both Haskell and oCaml is
what people recommend.

------
wyager
This is what I used to learn Haskell a while back. It's a pretty darn good
intro. I'm very glad I did it.

------
leereeves
I really like this book, but I think it may be teaching some bad habits by
ignoring performance concerns.

~~~
AnimalMuppet
It's not a problem until it's a problem.

That is: At least 90% of code is not CPU-limited. It's fast enough. So, _as an
initial approach,_ ignoring performance is fine.

The problem is that, if and when you run into real performance issues, you
need to know some tools for dealing with them. If this book doesn't teach you
those, well... it's a language introduction. It's not an advanced text. Maybe
it would be the better for a warning or two, a paragraph here or there, but
performance is (quite properly) not the point for the book.

~~~
leereeves
Fair enough.

I guess I mean to say that I really like this book, and would enjoy more from
the author teaching fast Haskell, to supplement this book about simple
Haskell.

------
greatabel
Haskell can be very handy at solving some puzzles.

~~~
codygman
Haskell can be very handy for solving real world problems as well.

------
yomslice
This book was excellent for helping me learn Haskell, but the gendered
language and fat-shaming jokes made me feel _very_ uncomfortable, eg:

"You're fat! Lose some weight, fatty!","You're supposedly normal. Pffft, I bet
you're ugly!" and "You're a whale, congratulations!", "Sure, we could just
type them all out but obviously that's not a solution for gentlemen who demand
excellence from their programming languages."

~~~
wyager
Clearly the author is going for a casual, conversational, jocular attitude.
That's part of what makes LYAH so approachable. If you want dry, sanitized,
bowdlerized instruction, LYAH is not the place to look.

~~~
yomslice
It's possible to communicate in a casual, conversational, and humorous manner
without alienating minorities and delivering insults, and the author chose not
to.

I think it's unlikely that he was trying to be malicious and is probably just
not sensitive to what it's like to be on the receiving end of some of his
examples.

~~~
LBarret
Aren't you imputing motives without proof ?

While I respect your sensibility, I would have made the same kind of remarks
without thinking it would hurt someone. I understand it could, but it wouldn't
have been my _intent_. Also remember that your position is very very US-
centric. But I am all for communication : explain your point to the author and
propose something else that is as funny as the current text.

But saying the author chose not to is simply dishonest.

~~~
ulisesrmzroche
If we're talking about motives and proof, then The fact that you understand
what you said is harmful and you choose to do it anyway is the legal
definition of intent.

------
nudpiedo
I always have been interested on haskell.... but it doesn't look to be enough
practical. For example there is almost no information about how to write a
smartphone videogame in haskell, even if it possible to trasnpile it to C or
to Javascript. It is possible to interoperate with the host language? Does it
perform well for high performance activities? Is it possible to isolate some
kind of events in a thread?

Edit: This lack of practical approach is what makes me hesitate in contrast to
clojure (just to mention a language), especially if the only goal is to become
again a "better developer" rediscovering functional terms and abstractions
also documented in other languages.

~~~
lmm
> For example there is almost no information about how to write a smartphone
> videogame in haskell, even if it possible to trasnpile it to C or to
> Javascript.

These guys are doing it pretty seriously: [http://keera.co.uk/blog/all-
posts/](http://keera.co.uk/blog/all-posts/)

And frankly a smartphone videogame is a pretty specialized use case; a lot of
pretty mainstream languages (perl?) don't have a good story for how to do
that. In fact I've never heard of anyone writing a smartphone game in Clojure
- I guess you could do one for Android since it's just java bytecode, but does
anyone?

"Practical" for most programmers is server-side business apps, and Haskell is
very very good at those.

> Does it perform well for high performance activities?

Yes, very much so.

~~~
Jach
Regarding Clojure, yes it's done. I haven't kept up with the latest clojure on
android news, but
[https://play.google.com/store/apps/details?id=com.friendlyvi...](https://play.google.com/store/apps/details?id=com.friendlyvillagers.ballz)
has been around for a while and I think the author just built off of libGDX.
There's also exciting work on Unity integration: [http://arcadia-
unity.tumblr.com](http://arcadia-unity.tumblr.com)

