It's old. RWH was written at a time version 6.8 of GHC was being used. 6.8 used base version 3.0.x.x. 6.10.1 already used 22.214.171.124, which introduced many changes. And that's just the jump from 6.8 to 6.10. The current version of GHC is 7.8, and the upcoming 7.10 will change monads significantly (see below).
That being said, it's still a useful resource for general guidelines. But keep in mind that some libraries changed since its release.
Read the comments. They usually contain information whether the given paragraph/section is still relevant and/or working.
Read the documentation of the libraries/functions you want to use. Even if you're lazy, know at least the types.
Remarks to chapters
This is just a quick overview of some of the things that I noticed while reading RWH. It's probably incomplete.
Chapter 14. Monads & Chapter 15. Programming with monads
Code breaking: Applicative m => Monad m
Soon, Applicative will become a superclass of Monad, something that wasn't planned in 2007.
In GHC 7.10, Applicative will become a superclass of Monad, potentially breaking a lot of user code. To ease this transition, GHC now generates warnings when definitions conflict with the Applicative-Monad Proposal (AMP).
See 7.8.1 release notes.
The State/Writer/Reader monads
In the Will the real state monad please stand up? section, the authors claim
In order to define a Monad instance, we have to provide a proper type constructor as well as definitions for (>>=) and return. This leads us to the real definition of State.
-- file: ch14/State.hs
newtype State s a = State
runState :: s -> (a, s)
That's not true any longer, since State and its friends are now implemented via
type State s = StateT s Identity
type Writer w = WriterT w Identity
type Reader r = ReaderT r Identity
So they're defined by their monad transformer.
Chapter 19. Error handling
Error handling changed completely from 6.8 to 6.10, but you noticed that already. Better read the documentation.
Chapter 22. Extended Example: Web Client Programming
Some of the example seem to be broken. Also, there are other HTTP libraries available.
Chapter 25. Profiling and optimization
General profiling techniques are still the same, and the example (see below) is a great case study for problems that can occur in your program. But RWH is missing multi-threaded profiling, e.g. via ThreadScope. Also, lazy IO isn't concerned throughout the whole book, as far as I know.
mean :: [Double] -> Double
mean xs = sum xs / fromIntegral (length xs)
Chapter 24 & Chapter 28 (Concurrent and parallel programming & STM)
While Chapter 24. Concurrent and multicore programming and Chapter 28. Software transactional memory are still relevant, Simon Marlow's book Parallel and Concurrent Programming in Haskell focuses solely on concurrent and parallel programming and is pretty recent (2013). GPU programming and repa are completely missing in RWH.
Chapter 26. Advanced library design: building a Bloom filter
As with the other chapters, the general guidelines of the design library is still well written and relevant. However, due to some changes (?) concerning ST, the result cannot be compiled anymore.
Chapter 27. Network programming
It's still mostly up to date. After all, network programming doesn't change so easily. However, the code uses deprecated functions bindSocket and sClose, which should be replaced by bind and close (preferably via qualified import). Keep in mind that it's very low-level, you might want to use a more specialized high-level library.
Some topics are not discussed in RWH at all. This includes streaming libraries such as pipes and conduit, and also lenses.
There are several resources out there for those topics, but here are some links to introductions to give you an idea what they're about. Also, if you want to use vectors, use the vectors package.
Video by Edward Kmett (author of lens)
Introduction and tutorial by Jakub Arnold
Conduit Overview by Michael Snoyman (author of conduit)
Pipes tutorial by Gabriel Gonzales (author of pipes, included in the pipes package)
Thanks for your interest in Real World Haskell. Currently I don't have any information if a new edition of this title will be released. To receive information on upcoming titles please sign up for our newsletter here:
Usually ebook upgrades are the result of errata submissions or formatting that needs updating. Errata can be submitted to the right on a catalog page for a book under "Essential Links".
Your request for an update for this book has been seen by those who can effect this. We greatly appreciate your interest in O'Reilly books and have a great day!