Subscribe to
Posts
Comments

Bryan O’Sullivan, Don Stewart and John Goerzen are pleased, and frankly, very excited to announce that we’re developing a new book for O’Reilly, on practical Haskell programming. The working title is “Real-World Haskell”.

The plan is to cover the major techniques used to write serious, real-world Haskell code, so that programmers can just get to work in the language. By the end of the book readers should be able to write real libraries and applications in Haskell, and be able to:

  • design data structures
  • know how to write, and when to use, monads and monad transformers
  • use Haskell’s concurrency and parallelism abstractions
  • be able to write parsers for custom formats in Parsec.
  • be able to do IO and binary IO of all forms
  • be able to bind Haskell to foreign functions in C
  • be able to do database, network and gui programming
  • know how to do exception and error handling in Haskell
  • have a good knowledge of the core libraries
  • be able to use the type system to track and prevent errors
  • take advantage of tools like QuickCheck, Cabal and Haddock
  • understand advanced parts of the language, such as GADTs and MPTCs.

That is, you should be able to just write Haskell!

The existing handful of books about Haskell are all aimed at teaching programming to early undergraduate audiences, so they are ill-suited to people who already know how to code. And while there’s a huge body of introductory material available on the web, you have to be both tremendously motivated and skilled to find the “good stuff” and apply it to your own learning needs.

The time has come for the advanced, practical Haskell book.

Here’s the proposed chapter outline:

  1. Why functional programming? Why Haskell?
  2. Getting started: compiler, interpreter, values, simple functions, and types
  3. Syntax, type system basics, type class basics
  4. Write a real library: the rope data structure, cabal, building projects
  5. Typeclasses and their use
  6. Bringing it all together: file name matching and regular expressions
  7. All about I/O
  8. I/O case study: a DSL for searching the filesystem
  9. Code case study: barcode recognition
  10. Testing the Haskell way: QuickCheck
  11. Handling binary files and formats
  12. Designing and using data structures
  13. Monads
  14. Monad case study: refactoring the filesystem seacher
  15. Monad transformers
  16. Using parsec: parsing a bioinformatics format
  17. Interfacing with C: the FFI
  18. Error handling
  19. Haskell for systems programming
  20. Talking to databases: Data.Typeable
  21. Web client programming: client/server networking
  22. GUI programming: gtk2hs
  23. Data mining and web applications
  24. Basics of concurrent and parallel Haskell
  25. Advanced concurrent and parallel programming
  26. Concurrency case study: a lockless database with STM
  27. Performance and efficiency: profiling
  28. Advanced Haskell: MPTCs, TH, strong typing, GADTs
  29. Appendices

We’re seeking technical reviewers from both inside and outside the Haskell community, to help review and improve the content, with the intent that this text will become the standard reference for those seeking to learn serious Haskell. If you’d like to be a reviewer, please drop us a line at book-review-interest@realworldhaskell.org, and let us know a little about your background and areas of interest.

Finally, a very exciting aspect of this project is that O’Reilly has agreed to publish chapters online, under a Creative Commons License! We’ll be publishing chapters incrementally, and seeking feedback from our reviewers and readers as we go.

You can find more details and updates at the following locations:

36 Responses to “Real-world Haskell: it’s time!”

  1. on 23 May 2007 at 08:54 America/Los_AngelesIjon Tichy

    This is fantastic news. Between chapters 22 and 23 I’d like to see another chapter: graphics/game programming with Haskell’s mature OpenGL library. Implement a simple game like the Tower of Hanoi puzzle, first in a naive sort of way, and then with a more solid underlying engine that readers will be able to base slightly more advanced games on, or at least build on. As a bonus you could show the 2 or 3 line Haskell code that solves the puzzle in a minimum number of moves.

  2. on 23 May 2007 at 08:59 America/Los_Angelesmanu3000

    Excellent news !
    New to Haskell, I welcome such a book.
    Ready to help reviewing too…

  3. on 23 May 2007 at 10:24 America/Los_AngelesPaul

    Great news — the world needs this book! I hope you’working on some sort of virtual-dons plugin for lambdabot to compensate for the likely drop in activity during the busy writing times.

  4. on 23 May 2007 at 11:03 America/Los_AngelesNeil Mitchell

    It looks very good, and I definately want to read it!

    The one chapter that I’d have added, which you haven’t, is one on boilerplate removal and the SYB approach.

  5. on 23 May 2007 at 12:06 America/Los_Angelesjsrn

    Congrats! Can I preorder the book? I’m particularly interested in the chapter about data mining and web applications - will you cover different web app libraries / frameworks there (WASH, HAppS, etc)?

  6. on 23 May 2007 at 14:02 America/Los_Angelesjoseph knecht

    This is great news! I’ll definitely be buying a copy when it comes out.

    I hope this will be a really successful book that encourages publishers to devote more attention to Haskell.

  7. on 23 May 2007 at 14:37 America/Los_AngelesSam

    I’m pretty excited about this, and I hope the book is popular so it will be followed by a comprehensive reference book. That’s what I really need.

  8. on 23 May 2007 at 14:54 America/Los_AngelesStefan Ciobaca

    The book looks great. I have on suggestion: include a chapter on debugging techniques.

    Good luck!

  9. on 23 May 2007 at 15:44 America/Los_AngelesTom Moertel

    I’m glad to hear about the book. Congrats!

    I’d like to second Neil’s request for some treatment of boilerplate removal. Other potentially interesting topics:

    * reasoning about resource use and lazy vs. strict strategies
    * HList, restricted monads, and other type-riffic things

    Cheers,
    Tom

  10. on 23 May 2007 at 16:32 America/Los_Angelesbrad clawsie

    this is great news! a very distinguished group of authors who have a long history in helping the rest of us understand haskell.

    i am also enthusiastic about the web community developed in parallel to the book.

    one request for the book: many authors will leave out parts of code samples they believe are not of absolute importance to the concept being illustrated. sometimes readers don’t know what this other code is. please make code samples available online that are complete, as in cut, paste, run!

    this book is going to be a pivotal event for haskell!

  11. on 23 May 2007 at 16:52 America/Los_AngelesFons

    Great news!

    I would like to see Existentials covered as well and I second the proposal of HList and debugging techniques.

    Are you going to realease any kind of publication schedule soon?

    Congrats

  12. on 23 May 2007 at 18:00 America/Los_Angelespetekaz

    Fantastic news!! As a newcomer to Haskell, it is very hard to find material on how to use Haskell effectively for practical/real-world projects. Most of the advanced material available on the Internet is very academic and not very practical. I hope this book does to Haskell what Practical Common Lisp did for Lisp, and what I suspect the new Erlang book will do for Erlang.

    Great news!!

  13. on 23 May 2007 at 20:07 America/Los_AngelesThorsten Seitz

    Great news!

    I’m looking forward to this book very much and I second the proposals of Existentials, HList, SYB and web apps/frameworks.

  14. on 23 May 2007 at 20:44 America/Los_AngelesIan Sefferman

    Wonderful! Just what I’ve been looking for, especially as I’m deep into a real-world Haskell project and moaning and groaning daily about how I can’t figure out a solid way to do error handling (Chapter 18, please!)!

    Can’t wait to see the book.

  15. on 23 May 2007 at 23:08 America/Los_AngelesTim G

    I’m not really qualified to comment on this — I came here by accident, but…

    It seems to me that any new language uptake needs to have support for integrating with more widely used languages. These days, a lot of what you are doing involves integrating libraries that have already been written: application servers, application frameworks, database drivers, UI tookits, multimedia libraries, etc

    In this case, you have C in your table of contents. But it seems to me that C is not used very much for new projects these days outside of the embedded world. At least not compared to the “next generation” languages like Java an C# (and relatives).

    A quick google search revealed some old interest in compiling Haskell to the Java VM, but nothing recent. I may be wrong (and often am ;) but it seems like that would be the kind of place the Haskell interest should be looking to move into. I think .Net has a more functional-friendly runtime, so that might be an easier place to start.

    In either case, I’ll almost certainly buy the book. I’m a but of a language nerd, so I always like to learn new stuff.

    Thanks,
    tim

  16. on 24 May 2007 at 00:44 America/Los_AngelesBinil Thomas

    I am glad to hear about this book. Congrats!

    I am very new to Haskell; I just finished Hutton’s recent book and I am trying to get around writing Haskell programs with lots of help from #haskell.

    One thing I missed in Hutton’s book is that although it does a very good job of explaining the basic concepts it leaves one too early and unprepared. For instance, after reading the whole book, I still don’t know a thing about how modules or packaging works in the Haskell world; and this, I assume, is very important to write any non-trivial program.

    I am excited to see such topics as testing, FFI, database programming, error handling etc in the TOC.

    Looking forward to read this book!

    Thanks,
    Binil

  17. on 24 May 2007 at 00:58 America/Los_AngelesSamuel Bronson

    Whatever you put on the cover had better be riding a unicycle! Otherwise, I will be forced to hunt you down and kill you.

  18. on 24 May 2007 at 01:17 America/Los_AngelesPeter McArthur

    This is fantastic news! I’m putting my name forward as a reviewer, but on one condition: please try to get a dugong on the cover. (See http://lambda-the-ultimate.org/node/1507 for details.)

    P.S. Don’t let Samuel intimidate you. It is well established that, in mortal combat, the contestant not on a unicycle usually wins. In any case, a dugong would look pretty stupid on a unicycle.

  19. on 24 May 2007 at 04:13 America/Los_AngelesStephen Waits

    ISBN assigned yet? Pre-orderable? If not, can you please email me when I can?

    Thanks,
    Steve

  20. on 24 May 2007 at 04:20 America/Los_AngelesAvinash Meetoo

    This is great!

    Haskell is a beautiful programming language and deserves to have a “real-world” book.

    Giving the pervasiveness of multicore processors today, I think that the concurrency part is very important. What about integrating the latest development in Data-Parallel Haskell (http://haskell.org/haskellwiki/GHC/Data_Parallel_Haskell)?

  21. on 24 May 2007 at 05:40 America/Los_AngelesFriedrich

    Funny that this happens now. I asked for it some weeks ago, and nobody could understand why such a book would be that much welcomed. I don’t know if O’Reilly can handle it like other did for the Erlang book.

    They do offer PDF “downloads” and the printed book as combo. I have to admit I’m a fan of this. For really “understanding” nothing can beat a well written book (well even a not so well written books) is more usable than just have excellent stuff just online.

    But searching in a book is not as convenient as typing in some Reader…..

    I’m very curious about that book, and I surely will get it.

    Best wishes for that undertaking
    Friedrich

  22. on 24 May 2007 at 09:55 America/Los_AngelesAmran Gaye

    Nice. Newcomer to Haskell and really looking forward to this.

  23. on 24 May 2007 at 12:11 America/Los_AngelesBas de Bakker

    @Tim G, who was looking for Haskell to JVM compilation: you may want to take a look at LambdaVM. See

    http://wiki.brianweb.net/LambdaVM/LambdaVM

    Bas

  24. on 24 May 2007 at 13:22 America/Los_AngelesEmre Sevinç

    Exciting news!

    I’d like to be one of the reviewers and I have sent an e-mail to the address you have provided. Looking forward to your answer.

    Happy hacking and authoring.

    Regards.

    Emre Sevinc
    Istanbul Bilgi University

  25. on 24 May 2007 at 15:39 America/Los_Angelespaul

    Great! I’ll look it over before paying, given the extreme disappointment I’ve had from every (printed) and most (web) Haskell books I’ve looked at. If it’s any use at all I’ll buy one just to encourage these guys.

    Haskell shouldn’t be as hard to learn as it is: it’s the most syntactically beautiful and fun-to-write language I know (I tried to like O’Caml but couldn’t get past the extreme ugliness and obfuscation of its code.) Haskell starts easy: I remember banging out one and two line solutions to projecteuler.net problems and having a blast; every attempt to get much past that has bogged down in undocumented minutiae and undecipherable tutorials.

    Sooner or later someone has to write a good book! I certainly hope it’s now.

  26. [...] world’ problems May 24th, 2007 Bryan O’Sullivan, Don Stewart and John Goerzen have announced a new book titled Real-World Haskell. I am very excited to hear about this new [...]

  27. on 25 May 2007 at 12:31 America/Los_AngelesVaidas

    I use Haskell quite intensivelly and I like it very much. I think the biggest problem for efficient use of Haskell is the lack of IDE support. Therefore, I was glad to find EclipseFP plugin, even if it provides only rudimentary IDE functionality. The biggest help for efficient work with Haskell would be a debugger support integrated in an IDE.

  28. [...] all that may be about to change. This week saw the announcement of the book “Real World Haskell”, to be published by O’Reilly. If the authors [...]

  29. on 29 May 2007 at 15:26 America/Los_Angelesdesp

    Great news! I’m looking forward to reading your book.

  30. on 06 Jun 2007 at 12:53 America/Los_AngelesBob W

    Sounds like this will be a book that is really needed. I’ll look forward to each chapter.

    The 3 tutorials below are the best I’ve found so far, and I hope you’ll incorporate the good techniques of each. To whit, clear explanations not steeped in math or pure CS (which the average programmer left behind after school), and possibly adding to a single/few large application(s) over the length of the book (maybe as in-between chapters?). This approach of getting used to the functionality of the app, backing up/correcting to add new features or fix old ones to handle errors/database interaction/etc, as the book progresses is the best way to learn how to build a “real world application”. You remember techniques better when you’ve struggled a bit to get them right (the mistakes stick in your head and are a place to hang new facts on later - like, Oh yeah, this is the easy way but remember how that didn’t work out so well?). I am finding this fixing mistakes (and seeing the correct way after being shown the poor way) to be particularly important in learning Haskell, after my 25 years programming in imperative languages I am tending to try things that match those techniques first, even though that’s not the way Haskell works best.

    I’m just learning Haskell and have found “Yet Another Haskell Tutorial” by Hal Daume III to be a good starting point (with what I find are clear explanations). The new “Programming in Haskell” book by Graham Hutton is a nice intro, but no example programs (just little functions to illustrate a point), and very basic, not even doing more than mention Monads in a couple of paragraphs. “Write Yourself a Scheme in 24 Hours” by Jonathan Tang takes an entirely different approach, using the Parsec parsing library to start from scratch and build a nice Scheme interpreter application, including error handling (which no one else mentions that I’ve seen). It assumes no previous knowledge of Haskell and makes a good companion to the other intro books that cover syntax in more detail.

  31. on 25 Aug 2007 at 07:35 America/Los_AngelesAndy

    Hi -

    I’m really looking forward to this book! Great to see an O’Reilly book on Haskell at last!

    Great to see the chapter on testing with QuickCheck. I’m just getting into Haskell and have seen descriptions on the net of QuickCheck being used. However, I haven’t yet seen an easy-to-understand example of how it is used, os maybe this book may fill that gap…

    It’ll be interesting to see the chapter on monads too. They really are a challenge to describe to newcomers like myself. In fact, the *very best* monad intro I have seen is one which describes their use not in Haskell, but in the Unix shell! Here it is -
    http://freeshells.ch/~revence/monads.html

    An *excellent* intro - I have *never* seen monads described any clearer than at that site!
    If your description of them is as clear as that, it will truly be worth seeing… :-)

    I read that site and thought “Sheesh..is that all??? Why do people insist on making monads
    as hard to learn as some obscure long-dead language?”

    Anyway, I digress… Very best of luck with the book - I’ll be buying a copy! Bye for now -
    - Andy

  32. [...] http://www.realworldhaskell.org/blog/2007/05/23/real-world-haskell-its-time/ [...]

  33. on 13 Nov 2007 at 23:09 America/Los_AngelesDenis

    I just tried sending an email to ask to be a reviewer, but the server rejected me:

    —– The following addresses had permanent fatal errors —–

    (reason: 550 5.1.1 : Recipient address rejected: User unknown in local recipient table)

    Is this an error, or are there no more reviewer slots?

  34. on 13 Nov 2007 at 23:43 America/Los_AngelesDenis

    I realise now that you were looking for reviewers in May. If you would still consider another reviewer, I’ll be glad to send my email somewhere else.

  35. on 13 Nov 2007 at 23:44 America/Los_AngelesBryan O'Sullivan

    Denis, it should be working again now. Please contact me via email if you have continued problems.

  36. on 14 Nov 2007 at 00:13 America/Los_AngelesDenis

    I would be happy to contact you via email, but I don’t know what it is! I must have missed something obvious, but I’ve looked at this page, the author’s page, and three of your blogs and haven’t found an email address.

    What did I miss?

Leave a Reply