Posts Tagged ‘Haskell’
Review: Learn You a Haskell for Great Good!
Some weeks ago I was contacted by No Starch Press asking if I would like to review one of their latest books: Learn You a Haskell for Great Good! by Miran Lipovača. I accepted it because I was already interested in reading the book and it would be the perfect opportunity to learn Haskell more properly since my adventures with it were limited. Basically just scratching the tip of the tip of the iceberg. And so, after getting the book I started to read it and solving some Project Euler problems as training exercises.
First, I must say I learned a lot and had some real fun while doing it! The book 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 (in this regard, implementing some problems in Project Euler is great). 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.
As I said before, the book is very well written and I enjoyed the style a lot. It’s not the same kind as Land of Lisp but has some common points. 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. Again, no cartoons or comics in the style of “Land of Lisp” (I guess that is a real unique book). My only complain with the book is the lack of coding exercises, or mini-projects suggestions, 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 a little more in Haskell, for example, re-implementing some of my current projects, 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!
Finally, a word about No Starch Press. It is great that a publisher like them is investing in books and authors of more unconventional languages. I wish more will be published in the future :-)
Starting with Haskell
Around ten years ago I learned to program in Lisp, Common Lisp to be more precise. And since then I believe I never actually learned a new language that impressed me, and excited me, so much as was the experience of learning Lisp.
Well, yesterday I started to learn more seriously Haskell. For quite some time my interest in the language has been increasing. From several blogs posts, comments and discussions on the web, it is almost impossible not to be curious. Yes, I’ve heard of Haskell for a very long time but it seems the buzz on my ears raised a lot recently. And so, I’ve decided to take a look. In the worst case scenario, it would a be just a few hours of playing around with a new language.
Up until now, I didn’t do much. Installed the Haskell platform, haskell-mode in Emacs (although I ended up using Vim too to code) and searched for some basic tutorial. My starting choice is “Learn You a Haskell for Great Good!”. It looks nice. Seems suitable for a beginner and starts in a simple way. The first real chapter is the second one, which I just did yesterday. I was very impressed with it. And perhaps more important, very happy with the experience. To be honest, I don’t remember a similar feeling with other languages… except Lisp! Although this “Starting Out” chapter introduces just some very basic Haskell stuff, it is already a lot to feel the language and the potential of it. The last example was very cool. Suppose you want to find the right triangle that has integers equal or smaller than 10 for all sides and has a perimeter of 24. With tuples, list comprehensions it’s just a matter of writing:
[(a,b,c) | c <- [1..10], b <- [1..c], a <- [1..b], a^2 + b^2 == c^2, a + b + c == 24]
Simple, concise and very neat! I still didn’t do anything proper with Haskell. I am just in the very very very beginning but it looks promising. I could be wrong about it sure, but the feeling is nice.
Also, recently, I started to take a look at Clojure, another Lisp. I had some hopes that would be a very nice experience. Unfortunately, it was not. For some reason, I am unable to appreciate the “beauty” of a JVM language. But let’s see how Haskell will fare when I start to try it with the kind of stuff I’m interested in.

