
Learn You a Haskell is now in print - teaspoon
http://learnyouahaskell.com/#book
======
arespredator
It's astonishing to me that a computer science student wrote such a good book.
It's funny, witty, the drawings are great, and the author explains quite
complicated concepts of functional programming very clearly. I've already read
this book a year ago online, yet I'm still gonna buy it just to support the
author.

~~~
Stormbringer
Wasn't there some virtual pushing and shoving over whether this was just a
gross rip-off of a python book? Or am I confusing it with another? (Nitpicks
welcome for once, so long as you can provide a link to the thing I was
thinking of :D )

~~~
bonus500
it's kind of inspired by Why's ruby guide, because that's also a sort of
funny-ish programming book with pictures, but i think our style is different
enough.

~~~
Stormbringer
I'm probably thinking of some other python inspired book then. Well done for
making a contribution to the advancement of knowledge etc.

~~~
frio
You might be thinking of Zed Shaw's "Learn Python the Hard Way", which started
a spat between him and Mark Pilgrim over the best way to teach Python. It was
also ripped off to make a Ruby version later, which Zed got pretty annoyed at
(FWIW, the Ruby version basically replaced the Python examples with Ruby,
while not changing the explanations - which were very much tied to Python).

However, none of that has anything to do with Learn You a Haskell, which looks
excellent and will probably mean I don't make my savings goal next week :<.

~~~
krainboltgreene
Zed Shaw wrote "Learn Python The Hard Way", and then E. Martin started to
write "Learn Ruby The Hard Way", without asking permission to copy the text.

There's a second book, started before LPTHW and LRTHW, called Learn You The
Ruby, by me. But I haven't finished it :(

------
angrycoder
No Starch has really been knocking out of the park lately with Land of Lisp,
Eloquent Javascript, The Linux Programming Interface, and now Learn You a
Haskell. They are also one of the few publishers who's typesetting doesn't
make me want to claw my eyes out.

------
danieldk
I can now confidently recommend a book to Haskell-aspiring friends that is
easy to read and incredibly fun at the same time. It will be on my bookshelf
next to Land of Lisp.

~~~
teaspoon
I think it could even be appropriate for an analytically minded non-
programmer. I'm going to try it on my sister, who is a mathematician.

~~~
Stormbringer
With respect to the interaction between programming and maths, I remember
reading a while back about some computer science course where they found that
a relatively simple maths test administered early on strongly predicted
success at the end of the course, and it was mainly around algebra and
variable assignments.

I wonder if the 'procedural' languages are more strongly slanted towards the
algebra style of maths, whereas 'functional' languages are more strongly
slanted towards the formula style (or whatever we would call that maths where
you talk about f of n, and g(f(n)) rather than the x squared plus 4x plus c
style - not sure of nomenclature, many moons ago I took a course on 'Discrete'
mathematics but couldn't adequately define what makes it different from other
sorts of maths)

My grossly inadequate labels aside, the point I'm getting at is that maybe
depending on the type of maths they do, different mathematicians might be
drawn towards different kinds of programming languages (or find them more or
less 'natural'). What do you think?

~~~
jacques_chester
> With respect to the interaction between programming and maths, I remember
> reading a while back about some computer science course where they found
> that a relatively simple maths test administered early on strongly predicted
> success at the end of the course, and it was mainly around algebra and
> variable assignments.

The original study is _Testing Programming Aptitude_ , by Saeed Dehnadi in
2006.

"The initial study suggests that success in the first stage of an introductory
programming course is predictable, by not consistency in the use of the mental
models which students apply to a basic programming problem before they have
had any contact with programming notation ..."

In subsequent studies (Bornat, Dehnadi, Simon: _Mental Models, Consistency and
Programming Aptitude_ ) the relationship did not hold and Dehnadi and others
have refuted the original hypothesis:

"Two years ago we appeared to have discovered an exciting and enigmatic new
predictor of success in a first programming course. We now report that after
six experiments, involving more than 500 students at six institutions in three
countries, the predictive e ffect of our test has failed to live up to that
early promise."

~~~
Stormbringer
Thanks! I wonder if the failure to generalise the results in subsequent
studies is due to different teaching material and methods at the different
universities?

~~~
jacques_chester
One of their hypotheses is that the test doesn't work because students can
start a test with mental model A, get halfway through and realise it should
actually be mental model B, but don't bother to go back to previous answers
because the test is not used for assessment purposes.

Thus an otherwise excellent student could appear "inconsistent" in the
predictive test, reducing its usefulness.

The second paper is good reading and its authors are admirable models of
scientific honesty.

------
losvedir
Great guide! Since the author himself seems to be reading these comments, I
finally have a chance to say just how hysterically funny the bit about
analyzing the Avril Lavigne song line by line was. I laughed so hard when I
got to that part.

Guess I should buy the print version of the book to support the author....

~~~
bonus500
haha glad you liked that! avril is so dreamy ...

------
Cherad
Just bought this from No Starch Press for delivery to the UK. Amazon UK has it
for £35.49, so cheaper to get it shipped over - madness! (I'll take my chances
on the import taxes...)

Thank you Miran for a great haskell book, I'm really looking forward to
getting my hands on a print copy.

~~~
bonus500
thanks for buying!!

~~~
Natsu
It's a nice book. I wish I'd had the time to review it like your publisher
requested :)

------
oscilloscope
LYAH is fun and accessible. A great introduction to the advanced concepts in
Haskell and the power of functional programming.

It made me better at javascript and python. It rekindled my interest in math
and algebras. It makes me want to do battle with complexity in nuanced, clever
ways.

Thanks Miran!

~~~
bonus500
haha, thanks for reading. sometimes it's really cool to have something spark
your interest and then it just snowballs from there

------
olliesaunders
Some very light criticism of this book: sometimes the author makes things a
little _too_ easy by spelling out stuff that I’d rather have to work out
myself. It’s easy to fall into the temptation of just reading and reading
without really trying out what you’ve learnt because everything always seems
so easy to understand but you don’t really internalize it properly until
you’ve actually used it a lot.

So these days I prefer other texts but I turn to LYAH when I’m really
confused.

All that said it is a great work, as many have said, and a great boon to
Haskell and the functional programming world.

------
rwmj
Slightly OT: Can someone point to a good, comprehensive tutorial on how to
call C code from Haskell?

Background: libguestfs Haskell bindings need a lot of love, and the FFI deeply
confuses me.

~~~
joelburget
I've been writing some ffi myself code lately. The real world haskell chapter
on ffi has been helpful. They use a bit of hsc2hs on top of plain ffi. I've
also been using c2hs which does a lot of the work for you (a bit higher level)
and have found Edward Z Yang's guide helpful for that.

~~~
pjscott
Real World Haskell is also online, by the way, so you can check out the
chapter on FFI right here:

[http://book.realworldhaskell.org/read/interfacing-with-c-
the...](http://book.realworldhaskell.org/read/interfacing-with-c-the-ffi.html)

It walks you through making some basic PCRE bindings, which is a big enough
example that they manage to touch on the important issues. It's a pretty good
introduction, I would say, especially in the part that covers interfacing C
strings with ByteStrings.

~~~
rwmj
I read this when I was doing the original porting and TBH it's very
lightweight.

Also (to reply to GP) c2hs is no use because we already have a very detailed
and specific description of the interface, and a generator that does all the
other bindings[1]. We want to know precisely how to translate our description
into Haskell, we don't want to go through another layer.

[1]
[http://git.annexia.org/?p=libguestfs.git;a=tree;f=generator;...](http://git.annexia.org/?p=libguestfs.git;a=tree;f=generator;hb=HEAD)

------
happy4crazy
LYAH is fantastic. Lots of really beautiful material, and it's choke-on-your-
coffee funny.

------
Calamitous
I'm curious how the author liked working with NoStarch. I know one of
PragProg's big selling points is that they're much easier to deal with and
provide much higher royalties than traditional tech publishers; I wonder if
NoStarch has taken a similar approach.

~~~
FreakLegion
I can't speak to how easy PragProgs is to work with, but it seems their 'much
higher royalties' are just creative bookkeeping. Where other publishers base
royalties on a book's gross, PragProgs uses net. They're somewhere between
traditional and vanity publishing in that regard.

------
sigzero
Kudos to the author on this book. I think it is great that Haskell will have
such a "fun" book to teach the concepts of programming in Haskell. That should
lower the learning barrier a bit. More so since everything is layed out in
easy to understand terms.

------
jlees
Just bought it. I'm researching ways to teach computer science and this has
come up in so many threads it's not even funny. :)

(Despite it being a free ebook I vastly prefer print, another problem I'm
trying to figure out and solve...)

~~~
squidsoup
Have you tried reading technical books on a Kindle DX? It's quite a nice
experience.

~~~
jlees
I don't have a DX, just an iPad, Xoom and 1st gen Kindle. But from those
experiences, it's not the form factor that bothers me - it's the natural
continuous access of the ebook format. I can't read PDFs onscreen for much the
same reasons.

When I read technical books, I scribble; I dog-ear; I add in postits
_everywhere_ ; on textbooks, I even highlight and deface quite happily. And
this helps me fix in my mind where reference information is: it's the green
post-it in the corner. It's the page with the drawing of a dog in the top
left. (I seem to have a very visual memory for recall.)

I just cannot, no matter how hard I try, reproduce that experience on an
e-reader. Yes, the _features_ are mostly there, and search is a very nice
bonus - it also works quite nicely for continuous following of tutorials - but
the general way I consume these books just doesn't translate.

------
vessenes
I'm learning haskell from him right now; totally enjoyable introduction to a
new language, and functional programming.

It won't be my only haskell book, but I'm glad it was my first!

------
thurn
Does this also mean that the online edition has been completed and there will
be no future chapters?

~~~
bonus500
for now!! but in the future who knows. people might want chapters that focus
around making real useful stuff with the knowledge, so that's a possibility

~~~
jedi_stannis
I would love a chapter on Monan Transformers. Its one concept I can't seem to
wrap my brain around and a LYAH style chapter seems like the perfect thing to
help me understand it.

~~~
happy4crazy
Yeah, me too--I'm actually thinking about writing my first blog post as a
LYAH-level intro to monad transformers :)

Here's an article that helped me understand them:
[http://www.grabmueller.de/martin/www/pub/Transformers.en.htm...](http://www.grabmueller.de/martin/www/pub/Transformers.en.html)

------
tomazmuraus
Awesome book (+ pretty pictures).

I have read it online about a year ago, but I still ordered my copy from
Amazon.

------
revorad
The same book is available for $25.56 on Amazon (vs $44.95 on No Starch and
O'Reilly). How can Amazon afford such a huge discount on a new book? And how
does O'Reilly survive with such competition?

~~~
bonus500
it's a mystery! but i'd recommend buying it directly from No Starch because
you get the free ebook and swag, plus more money goes directly into my mouth
this way

~~~
revorad
Just wondering, why didn't you choose to self-publish the book through Amazon
or Lulu?

~~~
bonus500
i just liked writing it and i put it online for people to red. it never really
occurred to me that people might buy it until no starch approached me

~~~
jerf
No Starch seems pretty aggressive on that recruiting front. I can't speak for
them and of course I can't guarantee anything, but if anybody has an idea for
a good, publishable technical book and the chops to write it, the threshold
for pitching it to them seems to actually be negative, in that they will
actually go around and proactively contact people.

------
rubergly
huh. I was just looking through No Starch Press's catalog last week after
someone here mentioned the Manga Guide to Databases, and I saw this, but
didn't realize it was only online before.

------
davelee
after reading it online, I preordered it right away (last December). Had to
get some money in Miran's account. Glad it's done and ready to go.

------
watmough
Excellent. Will order!

------
krainboltgreene
And Learn You The Ruby is still in the dust. I feel so ashamed :(

~~~
bonus500
just keep at it man!!!

