- Amazon Student members save an additional 10% on Textbooks with promo code TEXTBOOK10. Enter code TEXTBOOK10 at checkout. Here's how (restrictions apply)
Real World Haskell: Code You Can Believe In Paperback – Dec 5 2008
|New from||Used from|
Special Offers and Product Promotions
Frequently Bought Together
Customers Who Bought This Item Also Bought
To get the free app, enter your e-mail address or mobile phone number.
Code You Can Believe In
About the Author
Bryan O'Sullivan is an Irish hacker and writer who likes distributed systems, open source software, and programming languages. He was a member of the initial design team for the Jini network service architecture (subsequently open sourced as Apache River). He has made significant contributions to, and written a book about, the popular Mercurial revision control system. He lives in San Francisco with his wife and sons. Whenever he can, he runs off to climb rocks.
John Goerzen is an American hacker and author. He has written a number of real-world Haskell libraries and applications, including the HDBC database interface, the ConfigFile configuration file interface, a podcast downloader, and various other libraries relating to networks, parsing, logging, and POSIX code. John has been a developer for the Debian GNU/Linux operating system project for over 10 years and maintains numerous Haskell libraries and code for Debian. He also served as President of Software in the Public Interest, Inc., the legal parent organization of Debian. John lives in rural Kansas with his wife and son, where he enjoys photography and geocaching.
Don Stewart is an Australian hacker based in Portland, Oregon. Don has been involved in a diverse range of Haskell projects, including practical libraries, such as Data.ByteString and Data.Binary, as well as applying the Haskell philosophy to real-world applications including compilers, linkers, text editors, network servers, and systems software. His recent work has focused on optimizing Haskell for high-performance scenarios, using techniques from term rewriting.
Inside This Book(Learn More)
What Other Items Do Customers Buy After Viewing This Item?
Most Helpful Customer Reviews on Amazon.com (beta)
Unfortunately, the problems start in chapter 5, and rarely let up. It starts by introducing a datatype for JSON data for the purpose of pretty-printing it. The way the pretty-printer is rolled out is confusing -- it constantly jumps between code snippets that won't even compile, because a type they depend on is not defined til nearly the end of the chapter. And while it stays away from excessive cleverness, function names are confusingly named. In fact the entire nature of the pretty-printer revolves around a "Doc" abstraction that is never clearly explained or rationalized.
Later chapters are also rich with useful information, such as explanations of various GHC language extensions to the type system (which are really de facto standard Haskell nowadays). Unfortunately (there are many "unfortunatelys" to use in this review) I would never have been able to follow these explanations had I not already known a little about them -- unlike the rest of the examples in the book, the examples stop being "real-world" and instead devolve into meaningless metasyntax like "Foo" and "Bar".
By the time monads are finally introduced (late, but rightly so -- I consider this delay in introducing them to be a plus), the reader has had to suffer through some very tedious projects, such as parsing an obscure binary format. The book really begins to redeem itself again here, and makes monads clear as a datatype that captures common concepts of encapsulating and sequencing, and completely avoids cutesy visual analogies (no spacesuits or toxic waste here!).
I've not finished the book (I'm still in Chapter 14) but I am eagerly looking forward to its later chapters introducing monad transformers, parallel programming, and software transactional memory. You get a lot of book for the price, but you'll need the support of the always-friendly haskell community on IRC or email to make the most of this tome, or even make any sense of several parts of it.
That said, there were some things I didn't like about it.
The biggest annoyance is that the example in Chapter 12 doesn't actually work. The point is to teach Haskell, not how to read barcodes, but example code that doesn't work just seems sloppy.
I'm also not a big fan of how the code samples are spread out over several pages, with a comment stating which file they belong to. Mostly just a pet peeve, but it does cause some problems because there are a few places where the code references variables or types that haven't been declared yet, so the code won't actually compile until you get further along. Not the end of the world, but the book suggests compiling often to avoid errors and the end of each code snippet would be a natural place to do that.
There are also a few language features that are used but not really explained or used before they're explained. The $ operator, for example, is used on page 165 (among other places), but is only briefly explained on page 248. In that case, even when $ is explained it's incidental to explaining something else (fmap and <$>).
I should add I read through this book twice, and didn't learn much the second time around either.
A ton of the book is devoted to a JSON parser, which is rather tiresome. The other "real world examples" are equally poor like a bit-shifting checksum algorithm.
Go read Learn You a Haskell if you're looking to learn the language. If not, you can try this book -- but I'm going to predict your attempt will be fruitless.
Haskell has its roots in academia, and functional programming requires lots of up-front thinking about your total approach. It is not a language where you can usually just sit down and start coding. This book shows you how to use functional programming and Haskell to solve real-world problems. Each chapter contains many code samples, and many contain complete applications. The book contains an application that downloads podcast episodes from the web and stores the history in an SQL database. There is also an application that takes a grainy phone camera photo of the barcode on a book and transforms it into an identifier that you can then ue to query a library website. This is the "fun stuff" that seems to work out so well and so elegantly in the Haskell language.
It is not necessary that you have any prior knowledge of Haskell or functional programming concepts, however general programming concepts are a requirement. This is certainly the first Haskell book to come along in a few years that I would recommend for the novice. As usual with the best of O'Reilly's programming books, this one is well illustrated with lots of well-commented code. The following is the table of contents:
Chapter 1. Getting Started
Chapter 2. Types and Functions
Chapter 3. Defining Types, Streamlining Functions
Chapter 4. Functional Programming
Chapter 5. Writing a Library: Working with JSON Data
Chapter 6. Using Typeclasses
Chapter 7. I/O
Chapter 8. Efficient File Processing, Regular Expressions, and Filename Matching
Chapter 9. I/O Case Study: A Library for Searching the Filesystem
Chapter 10. Code Case Study: Parsing a Binary Data Format
Chapter 11. Testing and Quality Assurance
Chapter 12. Barcode Recognition
Chapter 13. Data Structures
Chapter 14. Monads
Chapter 15. Programming with Monads
Chapter 16. Using Parsec
Chapter 17. Interfacing with C: The FFI
Chapter 18. Monad Transformers
Chapter 19. Error Handling
Chapter 20. Systems Programming in Haskell
Chapter 21. Using Databases
Chapter 22. Extended Example: Web Client Programming
Chapter 23. GUI Programming with gtk2hs
Chapter 24. Concurrent and Multicore Programming
Chapter 25. Profiling and Optimization
Chapter 26. Advanced Library Design: Building a Bloom Filter
Chapter 27. Sockets and Syslog
Chapter 28. Software Transactional Memory
Appendix A. Installing GHC and Haskell Libraries
Section A.1. Installing GHC
Section A.2. Installing Haskell Software
Appendix B. Characters, Strings, and Escaping Rules
Section B.1. Writing Character and String Literals
Section B.2. International Language Support
Section B.3. Escaping Text
Look for similar items by category
- Books > Computers & Technology > Computer Science > Software Engineering
- Books > Computers & Technology > Programming > Languages & Tools
- Books > Computers & Technology > Programming > Software Design, Testing & Engineering > Software Development
- Books > Textbooks > Computer Science & Information Systems > Programming Languages
- Books > Textbooks > Computer Science & Information Systems > Software Design & Engineering