Home - Software Design, Testing & Engineering

Product Details

Binding:

Kindle Edition

EAN:
Label:

No Starch Press

Feature:
Publisher:

No Starch Press

Studio:

No Starch Press

Editorial Reviews

It's all in the name: Learn You a Haskell for Great Good! is a hilarious, illustrated guide to this complex functional language. Packed with the author's original artwork, pop culture references, and most importantly, useful example code, this book teaches functional fundamentals in a way you never thought possible.

You'll start with the kid stuff: basic syntax, recursion, types and type classes. Then once you've got the basics down, the real black belt master-class begins: you'll learn to use applicative functors, monads, zippers, and all the other mythical Haskell constructs you've only read about in storybooks.

As you work your way through the author's imaginative (and occasionally insane) examples, you'll learn to:

  • Laugh in the face of side effects as you wield purely functional programming techniques
  • Use the magic of Haskell's "laziness" to play with infinite sets of data
  • Organize your programs by creating your own types, type classes, and modules
  • Use Haskell's elegant input/output system to share the genius of your programs with the outside world

Short of eating the author's brain, you will not find a better way to learn this powerful language than reading Learn You a Haskell for Great Good!

Customer Reviews

I'm not sure what kind of trick the author is pulling here, but this guide managed to walk me through all important Haskell concepts without ever making any of the material sound complicated. I had, through sheer force of will, managed to understand monads a few years back, so I didn't start from zero -- but somehow none of the mind-bending I remembered from last time was necessary this time around. Even terms like Applicative Functor and Monoid, which I assumed to be things only category theory wizards could possibly be interested in, are exposed by Lipovaca to be relatively simple, banal concepts with everyday uses.

The book doesn't go into any of the really hairy stuff, such as monad transformers, the subtleties of laziness, or unsafe IO, which are probably required for serious Haskell programming. But I guess it's excused, since it does call itself a beginner's guide. It *does* do a very fine job of showing how purity, type classes, and category theory concepts provide mind-blowingly elegant solutions to real, practical programming tasks. As such, I've started recommending it to anyone who asks for a good introduction to functional programming.
Haskell is a wonderful language - it's functional, strongly typed, elegant, and lovely to code in. However, to many programmers (even seasoned ones), it's daunting to learn. As a Haskell programmer trying to spread the joy of Haskell to friends and coworkers, this is a real pain. However, I have used Learn You a Haskell For Great Good!, by Miran Lipovaca, for some time now to help get others into Haskell, and I'm thrilled that it's finally been published as a physical book by No Starch Press.

First a caution: Learn You a Haskell is not designed for non-programmers - it is not a guide to learn how to program. Rather, it's a guide for programmers who are used to imperative languages (like C, Java, or even Fortran) to learn about functional languages (and, obviously, Haskell in particular). What's nice about this book compared to other typical programming guides is that it's engaging to read; it's funny and cute, and the content is consistently clear. Also, the order in which the material is presented makes sense.

The book starts out with a few chapters on the basics. Lipovaca shows how to call functions, use lists and tuples, and understand the basic type system. He goes on to explain pattern matching, recursion, and higher order functions - the bread and butter of functional programming. The descriptions and examples (and even the doodles) are great. He goes through the toolkit of many commonly used functions (reverse, zip, map, fold, ...) and shows how to implement them from scratch.

Chapters 6 though 10 focus on actually using Haskell to write real programs. Modules are covered briefly before a great section on type classes. These can often be confusing to new Haskell programmers as they are very different from classes in a language like Java, but Lipovaca provides plenty of examples and clear explanations to make the learning process smooth. Next, input and output is introduced. Nothing very complicated is addressed - it's limited to basic console and file I/O - but it's more than sufficient to give a pre-monad overview of I/O. Chapter 10 is almost like a halfway point in the book. We use what we've learned so far to make a nice, useful, functional program before delving into the deeper type classes that are so critical to advanced Haskell programming.

The next few sections are where LYAH really shines. Where many Haskell resources introduce monads all at once with little reason for why they exist or how they were designed, Lipovaca builds into them beautifully. We start with a clear explanation of functors, then applicative functors, then monoids, and finally monads. It makes the following chapter on some common monads (Reader, Writer, and State) seem downright easy. (I'll admit: I had trouble with the State monad for a while when I was first learning Haskell - I wish I'd read this earlier!)

The book ends with a chapter on zippers that seems oddly out of place. Where most of the other chapters build from their predecessors, this one had nothing to do with anything from the previous few chapters. I think it would have been much better suited just before or after chapter 10 than as the climax of the book.

Overall, LYAH is a solid beginner's guide to Haskell. It covers most of the basics, does a great job with the beginning advanced material, and is fun to read to boot. I would have liked to see a section on Arrows, as I find myself using them more and more, but I recognize they're still pretty fringe right now, so I see this as only a minor fault. If you already feel comfortable with applicative functors and monads, this book won't provide much new material for you, but if you're anywhere from having no idea about Haskell to still afraid of the state monad, I highly recommend Learn You a Haskell For Great Good!.
A young man from Slovenia, just 23 years of age, writes his first book documenting a difficult computer-programming language, in English, which is not his native language. Given these facts, you'd think the odds would be stacked deeply against any measure of success for him. Yet it appears that, with his book Learn You a Haskell for Great Good!: A Beginner's Guide, Miran Lipovaca has almost smashed the ball right out of the ballpark. It is easily the best text available for an absolute newcomer to Haskell, and would also benefit many who've already perused other Haskell books. Moreover, of the seven volumes on Haskell that I own, it's the only one that I've so far managed to read cover-to-cover (including, BTW, typing, testing, and hacking all the code in it. I have, however, come close to finishing Graham Hutton's book, Programming in Haskell, which in most respects could not be further removed from this one.) Another big "plus": Mr. Lipovaca's code actually COMPILES. All of it. (Professor Hutton, are you reading this?)

I say "almost smashed it out," though, because there is room for improvement. Even at that, I think Lipovaca has, at the very least, hit a long triple, just bouncing off the top of the center-field wall, with this book.

To begin with, I must disagree with the reviewers who've claimed, in one way or another, that the author has left out information important even to a beginners' text. On the contrary, the scope and breadth of this text are truly astonishing. Nowhere else have I seen monads, monoids, functors, applicative functors, and the like, treated with such thoroughness and patience. As one or two other reviewers have pointed out, Lipovaca has even managed to impart insight into how these constructs actually obey the same laws that are expected of their theoretical counterparts in higher mathematics, specifically category theory--without getting bogged down in technical details. This would be a stunning achievement for any author, let alone one who's just writing his first book! As a programmer/hacker of more than thirty years, one who's deeply immersed in the imperative programming paradigm, I've truly come to appreciate how Lipovaca divides topics into small, bite-sized, easily-digestible chunks, with (mostly) easy-to-follow code snippets, before moving on to the next chunk. Indeed, he appears to approach his pedagogy from the sympathetic viewpoint of one who has quite recently had to grapple with a welter of high-flying, highly abstracted, and theoretical texts, and who consciously wants to spare his own readers this sort of iniquity.

If Mr. Lipovaca's book leaves anything at all to be desired, they would be the following: (1) More systematic use of exercises and problem sets at the end of each chapter; (2) Greater use of extended programming examples, and maybe a few programming projects that readers and hackers can really sink their teeth into. As for (1), despite the wealth of code snippets that the author provides, I still find myself wanting to test my assimilation and understanding, by forcing myself to complete a related set of exercises at chapter's end. To my way of thinking, in a beginners' text these exercises are absolutely indispensable. (Maybe it's just me, but without such exercises I always have the lingering, vaguely nauseated feeling in my gut that I haven't quite absorbed the relevant topics fully.) To take just one example: in his otherwise excellent discussion of randomness and pseudo-randomness (pp. 190-198), the author employs a snippet of code to intimate the beginnings of a rudimentary password generator (on p. 195). Here he misses a good bet, I think; he could have easily followed this up with a series of exercises cuing the reader to develop more powerful and refined versions of the password generator; for instance: "(1) Write a brief program that extends the password generator on p. 195 by generating a number of different passwords, the number of which the user can input from the keyboard; (2) Extend this program to allow the user to specify the length of the passwords generated; (3) Now have the program output the passwords in rows of five across, with all five columns aligned; (4) Develop your generator further, by allowing the user to incorporate upper- and lower-case characters, and/or numerals, and/or other typographical symbols, in the passwords;" and so on.*

As for (2), greater use of extended programming examples and projects, Mr. Lipovaca begins to do as much with his Optimal Path program of Chapter 10, and with the examples used in the final chapter on zippers, yet it still strikes me that he could go much further in this direction. This is one of very few areas in which Graham Hutton's deeply flawed book, Programming in Haskell, truly shines. I would particularly like to see such examples deployed when readers begin swimming in really deep waters--such as when the discussion turns to creating types, use of applicative functors, monads, and suchlike.

Happily, Mr. Lipovaca is as amicable and easy-going as his funny drawings suggest; I've corresponded with him on a few occasions, and he seems willing to address the use of exercises and projects in a subsequent edition of this book. If such an edition does come to pass, I will gladly shell out the bucks for it if the text is expanded to 450-500 pages, maybe with smaller chapters in greater numbers, and comes with copious examples to practice upon and hone the craft of Haskell programming. THAT book would be an absolute world-beater--and a "tape-measure" home run that bounces into the city streets.**

__________________________

*Anyone interested in seeing this program realized should Google XGB Web and Software Design, visit the Programming page, and click the link that references code for the password generator.

**Oh, and have I pointed out how much I LOVE the "I lie flat" feature of this book, with its semi-detachable back cover binding? I wish EVERY techbook had this feature.



I saw this book in it's early stages when it was an open document online. I pre-ordered the book in August of 2010 and just received my copy a couple days ago. It was totally worth the wait.

The book says it's for beginners, but it walks from some fairly early topics all the way to Zippers, which, prior to this book confused me a good bit.

I recommend this book to anyone interested in Haskell as the different perspective on the approach of learning it can be enough to provide new insights to the language.

My only wish is that the author could have covered Enumerators, Iteratee and the like in the style of this book.
I was learning Haskell on the online version of this book while the last several chapters were being written. On the Haskell IRC channel, you could tell when a chapter went up because all of a sudden, people stopped asking questions about monads, or whatever the latest chapter was about. This book covers every logical step from installing Haskell to monads and zippers. It repeats itself often, almost psychically reminding you of previous concepts and how they fit together. This book is far and away the best way to learn Haskell.
One of my long withstanding goals as a developer has been to try and understand functional programming. I'm primarily a .NET developer and have been captivated by the growing influence of functional programming on the .NET framework since the introduction of generics and LINQ. After trudging through a couple of F# books and watching some of Erik Meijer's videos on Channel 9, I still found myself looking for something to help things click for me. So, I looked to Haskell. When searching for a good introduction to Haskell, I came across this book. Not only is this one of the best programming books I've read, it was perfect for getting me to that "a-ha" moment with functional programming. Terms that used to go in one ear and out the other, or remind me of my favorite Indian dish, finally started to make sense. It's good to work outside of the box and get those little gray cells fired up. The explanations are so concise and simple that even I could understand it. In previously futile attempts to understand Monads, I found myself reading and re-reading explanations by others to little avail. Not so with this book. And the chapter explaining types and type classes is pure gold. Kudos to the author for providing a clear, simple, and informative introduction to functional programming concepts via Haskell. For other .NET developers seeking to learn about functional programming, do yourself a favor and read this book first, before you try playing with F#.
I received this book as review copy and ended up reading it cover to cover. I have few other books on Haskell and made few attempts to read them, but I ended up getting lost along the way. Not this time though. The book builds up material in a nice gradual way, so that towards the end when I was reading Monads, it was no longer that dense. Author has done a good job in explaining things and concepts in a simple way. I still need to write few Haskell programs to absorb everything, but I feel lot more comfortable now than I was just a month back.

The examples in the book are nicely picked. Not only they explain the concept clearly, but they also lead up to material on which a next section or chapter is based. A discussion about Random numbers in Chapter 9 sets things up nicely for State Monad in Chapter 14. Build up from Functors (Chapter 7) to Applicative Functors (Chapter 11) to Monads (chapter 13 and 14) is done nicely. The book title mentions that its "A Beginners Guide", but I think by the end of this book the reader will be have a middle level Haskell understanding.

In terms of cons, I think there were couple of places where I felt discussion could have gone deeper into why things are the way they are. Probably they were omitted to keep the material interesting and not too dense. Also, I have been reading the book almost every day for a month and the back cover came out. But depending on how much I gained from the book, I would not rate this book any less.
Properly learning Haskell has been on my todo list for years. One of my first more serious attempts was in 2009, when I found a weird little book with lots of cartoons online. As you may have guessed that was Miran Lipovaca's "Learn You a Haskell for Great Good" and I was immediately intrigued by the writing style and cute cartoons. However back then the book was still a work in progress and I eventually stopped reading it before Miran got around to adding the last chapters. I always promised myself to eventually revisit this later, so I was delighted when I found out that No Starch Press is actually releasing an offline version of the book!

LYAH definitely is among the top programming books I read so far. Due to the author's easy-going and funny style -- though I'm sure there will be some readers who won't appreciate his humor -- you might not even notice at first how choke-full of good content this book is, but once you are done with it you realize that you actually learned a lot. This would be an amazing feat for any technical book, but is even more impressive considering Haskell's reputation as being a very academical and arcane language. Sure, not everything is covered here -- Arrows or CPS come to mind -- but every book is finite and the selection of topics is absolutely appropriate for beginning Haskell enthusiasts. The only chapter I wasn't so happy with was the last one on Zippers, not because it wasn't well written or interesting, but more because it felt a bit tucked on.

What can you expect from this book? Will you be a Haskell guru after reading it? Most likely not, because that takes a long time of practice and actually writing code. Maybe that's one of the few weak points of LYAH, the code examples are usually rather short and focussed on getting the point across, not "real-world" tasks you are likely to encounter in day to day programming. They still are great for introducing the reader to Haskell's way of abstracting problems, which I find immensely beautiful and well thought out. Still, a chapter or two on "programming in the large" and how to structure a big Haskell project would have been nice additions, but there are other places for learning more about the language, e.g. the Haskell wiki or the Haskell Wikibook. What the book will do for you is that once you are done with it, you should have a good basic understanding of the language's key concepts and type system and will be comfortable around terms like "monoid", "applicative functor" and "monad". There still we be a long way to go before you can consider yourself a Haskell expert, but you'll have a very solid grounding to build on.

All in all this is a remarkable book and maybe just what this beautiful language was missing, an easy to read, entertaining yet still thorough introduction to the language, that gives you an idea that Haskell is not only a research subject for computer scientists but a useful tool that can be used to build software.
I've read every Haskell book ever written (well, maybe not *every* one, but my shelf has at least a cubit's worth) and I've got to say that Miran Lipova'a's "Learn You a Haskell for Great Good" is the best for the Haskell neophyte.

To someone coming from a more "traditional" programming language, Haskell at first lance appears utterly impenetrable. However, Mr. Lipova'a does a fantastic job of explaining the fundamental concepts in an interesting and informative way. For example, Haskell's function signatures are an interesting beast. That is, from an outsider's perspective the signature pair :: a -> b -> (a, b) can be a little intimidating. However, this book does a fantastic job of illustrating how these signatures are formed in a consistent manner. The matter of signatures is just a small bump in the road toward learning Haskell, but it's emblematic of Mr. Lipova'a's attention to detail. You'll appreciate this attention to detail when the book delves into some of the more arcane topics such as type classes and monads. That is, Learn you a Haskell *will not* explain these topics in relation to current popular languages, but instead on their own terms. In my opinion, this is the correct approach and without previous context the author's careful handling of detail is critical.

This is a fantastic book and I highly recommend it as a *the* first book on Haskell -- and possibly even the second.
I must say I learned a lot and it was fun reading this book! It is very well written and presents a lot of material aimed to true beginners. Although it should be noted that it's not a text for beginners in programming, only for those who don't know Haskell. And the text really focuses on the language and skips unnecessary stuff, which is quite good because you start working with Haskell immediately. Another good thing of the book is the actual pace. The information comes at the right speed! You never feel it's going to fast or too slow, or that suddenly things become too complicated. It builds your knowledge of Haskell in the right amount, especially if you take some time to do some coding of your own. Only the last chapters of the book start to become more hard to grasp at a first reading because it deals with advanced concepts that will need more training from a beginner.

The author has a sense of humor while not filling the text with lots of jokes or provocative humor; it just feels natural. The cartoons that populate the book are not comics and just have a figurative role. I must confess that sometimes they just fill space but others they help making the reading more nice. My only complain with the book is the lack of coding exercises at the end of each chapter. This wouldn't be a complain if the book was more structured around mini-projects that would force you to code something larger than small functions. They exist, e.g., the task list, the calculator, but more would be a nice addition.

Did I learn Haskell with the book? Definitely yes! And it was fun! Naturally I'm still at a beginner's level but if I keep coding more in Haskell, I believe I can consolidate what I've learned and be ready to pass to a more intermediate level. I have not read other Haskell books but if you want to learn the language, have a good grasp of its capabilities and what you can do with it, this is a good book to achieve it and I recommend it without a doubt!

Disclaimer: I was offered by the publisher a free copy for review.
This book really blew my mind! It is superbly done.

What I especially like about it is the way it hints at the underpinnings of Haskell (and functional programming) in category theory (and other formal systems); thus making them much more accessible and comprehensible.

The discussions about monads are fantastic!

The examples are first rate: it's well worth going through each and every one of them (slowly and carefully) to fully absorb the gold mine of insights each one can impart. (Even if you think you already understand the concepts: you might just find yourself seeing things in a novel and unexpected way! ;-)

I truly hope the author will write another book. He has a real gift and talent; not only in explaining, but also in making things interesting. I actually found this book hard to put down. It really drew me in. (Not just any technical book can cast such a spell!)

This book should be of great interest to F# programmers. F# materials alone will not give a reader enough insight into the milieu of functional programming to really appreciate monads (for instance). In fact, I say: to really learn C# you need to learn F#, and to really learn F# you need to learn Haskell.

I also hope one day we'll have H# available as a fully integrated citizen of .Net (following in F#'s footsteps).

Haskell to me is well worth learning because it is so pure. The lessons learned can then be mapped back to many existing technologies that one must work with. (Legacy technologies aren't going away anytime soon; but the good news is that the Haskell way of thinking can still be leveraged to great good in many venues.)

The hand drawn artwork (done by the author himself!) added a lot to the tapestry and enchanting magic of this well crafted book.

In conclusion: my greatest praise for this book is the way it took such a lofty and important topic and made it so amazingly accessible, fun, and fascinating.

Kudos for a job well done!!!
I have very little to add that others haven't already. This is a very nice introduction to the basics of Haskell, an excursion the silliness of which belies, pleasantly, the subtlety of some of the topics covered. Although the formats differ, tonally this reminds me of The Little Schemer (replace references to 2001 with references to the Fonz) -- a book as well loved as I hope *this* one could become.

Criticisms: maybe I'm asking too much from an introduction, but it really *is* rather basic; someone who finishes this book still has a ways to go before she's developing non-trivial Haskell programs. There's a bit of unevenness, and some of the chapters are long enough that they begin to drag -- the book might profit from some reorganization. But these are minor things. Looking at it another way, this book is worth a read for the many clever and well-crafted illustrations. That it succeeds in teaching introductory Haskell is pure bonus.
I come from imperative programming like most, and nothing in this book is confusing. Just when you think you'll have to flip back a few pages to review a concept, the author adds a "N.B. Remember that [x concept] means [y meaning] in [z context]!" The writing is masterful.
I took a class on functional programing and the book assigned for the class, while useful, was entirely too difficult and abstract for a beginner to the functional world. Enter Learn You a Haskell for Great Good. This book is amazing. It covers the beginning topics to get your feet wet beautifully and intuitively and then transitions, seamlessly to more and more complex topics. You never have to stop and wonder how you got to where you are. Eventually we had to write our own Haskell interpreter and while others struggled, having read this book, I breezed through the assignment. Excellent resource and highly recommended.
This book is a great introduction to Haskell and a great introduction to functional programming. The author's casual style helps make some fairly challenging ideas simple to understand. The pace is deliberate but not overly slow. For example, I really appreciated the gradual build-up from functors, to applicative functors, to monoids, eventually moving on to monads. In this sequence, monads were not nearly as scary a topic as they sometimes can be. This is the best resource I've found for learning Haskell all in one place. Now I just need a book as good as this one for continuing my Haskell education.
This is a terrific book. It makes what might otherwise seem impenetrable mathy-code and makes it fun and approachable. This book wipes away Haskell's unwarranted image as "too academic". Haskell is fun. Get this book and learn Haskell for great good!
This book is a great way to be introduced to Haskell. Miran's writing style is conversational, and you can sense that he has a real passion about the language. His sketches that run throughout the book are whimsical and absurd, obliquely touching upon the subjects, and give something for the eyes to rest upon. There's even the occasional pop culture reference thrown in that let's you know that the book was written by a human (or at least a very hip robot). These sorts of things make programming books more engaging, and it's a welcome trend that I'm glad Miran follows - the seriousness often seen in technical and programming books makes many of them about as interesting as phone books, and almost as disposable. This book imparts programming concepts with substance and style, and as such makes it worth the sticker price. Haskell is a good language for dealing with discrete mathematics, but it doesn't have the same pizazz as something like JavaScript or Ruby, nor the simplicity of other languages. Miran is much like a wonderful peppercorn gravy poured over a dry meatloaf, making the technical aspects of Haskell fun.
Note - I was provided a copy for reviewing purposes by No Starch Press.
I bought this book after doing some programming in Python and C# as a way to start exploring the world of functional programming. Haskell is an amazing language, great for exploring things like maths, but also practical outside of academics. Miran does an amazing job explaining language concepts and making it easy to learn a language considered difficult to learn by most. I highly recommend this book to anyone looking to explore Haskell itself, or functional programming in general. I promise it won't disappoint.
This book is available free online, so why buy a hard copy? Haskell takes some getting used to. This book doesn't present the classic Hello World! program until chapter 8. This means reading a lot before writing your own apps (in my opinion). I wanted to quickly refresh my knowledge of previous chapters without completely rereading them. Instead of using the online version as a reference a hard copy is much easier to use. The book approached the subject very well and I believe rewarding the authors/publishers with purchasing this hard copy.
Best book ever.

But now I must write seventeen more words for this review to post so here they are!
This book does what its handful of competitors could not do: it made an advanced language easy to learn. Lipovaca has taken the time to break Haskell's heady ideas down into small steps, and he has had the patience to accompany each of those steps with liberal doses of friendly and engaging prose. If the prose is occasionally *too* friendly and engaging, then he has erred on the right side of caution, as other authors have not.

Fans of the book's forerunning website will recognize Lipovaca's brand of humor as well as his cute pictures, qualities that serve well his purpose of keeping a difficult subject down to earth and downright fun. I give it four stars because I am persnickety about a few points of prose style and not because, say, the book lacks exercises, which is hardly a fault in light of the abundance of its examples. All in all, this text is a salvation, and it may even become a classic.
I know nothing about the author, but the voice he has adopted in plopping this load out sounds something like a cross between that "Why?" guy and Zed Shaw, and he's channeling neither of them correctly. If the jokes that he insists on throwing in between every other sentence were actually funny then this might have been a very entertaining book, but they're just sad aspie kid humor that's likely to have you rolling your eyes too frequently to keep them focused on the page.
 
Share your thoughts with other customers
Create your own review