Real World Haskell
Subtitle: Code You Can Believe In
Publisher: O'Reilly Media
Published: December 2008
Place of publication: Sebastopol, California, USA
Language: eng
Format: Paperback
Number of pages: 710
ISBN-13: 9780596514983
Table of contents: label: Chapter 1
title: Getting Started; label: Your Haskell Environment; label: Getting Started with ghci, the Interpreter; label: Basic Interaction: Using ghci as a Calculator; label: Command-Line Editing in ghci; label: Lists; label: Strings and Characters; label: First Steps with Types; label: A Simple Program; label: Chapter 2
title: Types and Functions; label: Why Care About Types?; label: Haskell’s Type System; label: What to Expect from the Type System; label: Some Common Basic Types; label: Function Application; label: Useful Composite Data Types: Lists and Tuples; label: Functions over Lists and Tuples; label: Function Types and Purity; label: Haskell Source Files, and Writing Simple Functions; label: Understanding Evaluation by Example; label: Polymorphism in Haskell; label: The Type of a Function of More Than One Argument; label: Why the Fuss over Purity?; label: Conclusion; label: Chapter 3
title: Defining Types, Streamlining Functions; label: Defining a New Data Type; label: Type Synonyms; label: Algebraic Data Types; label: Pattern Matching; label: Record Syntax; label: Parameterized Types; label: Recursive Types; label: Reporting Errors; label: Introducing Local Variables; label: The Offside Rule and Whitespace in an Expression; label: The case Expression; label: Common Beginner Mistakes with Patterns; label: Conditional Evaluation with Guards; label: Chapter 4
title: Functional Programming; label: Thinking in Haskell; label: A Simple Command-Line Framework; label: Warming Up: Portably Splitting Lines of Text; label: Infix Functions; label: Working with Lists; label: How to Think About Loops; label: Anonymous (lambda) Functions; label: Partial Function Application and Currying; label: As-patterns; label: Code Reuse Through Composition; label: Tips for Writing Readable Code; label: Space Leaks and Strict Evaluation; label: Chapter 5
title: Writing a Library: Working with JSON Data; label: A Whirlwind Tour of JSON; label: Representing JSON Data in Haskell; label: The Anatomy of a Haskell Module; label: Compiling Haskell Source; label: Generating a Haskell Program and Importing Modules; label: Printing JSON Data; label: Type Inference Is a Double-Edged Sword; label: A More General Look at Rendering; label: Developing Haskell Code Without Going Nuts; label: Pretty Printing a String; label: Arrays and Objects, and the Module Header; label: Writing a Module Header; label: Fleshing Out the Pretty-Printing Library; label: Creating a Package; label: Practical Pointers and Further Reading; label: Chapter 6
title: Using Typeclasses; label: The Need for Typeclasses; label: What Are Typeclasses?; label: Declaring Typeclass Instances; label: Important Built-in Typeclasses; label: Automatic Derivation; label: Typeclasses at Work: Making JSON Easier to Use; label: Living in an Open World; label: How to Give a Type a New Identity; label: JSON Typeclasses Without Overlapping Instances; label: The Dreaded Monomorphism Restriction; label: Chapter 7
title: I/O; label: Classic I/O in Haskell; label: Working with Files and Handles; label: Extended Example: Functional I/O and Temporary Files; label: Lazy I/O; label: The IO Monad; label: Is Haskell Really Imperative?; label: Side Effects with Lazy I/O; label: Buffering; label: Reading Command-Line Arguments; label: Environment Variables; label: Chapter 8
title: Efficient File Processing, Regular Expressions, and Filename Matching; label: Efficient File Processing; label: Filename Matching; label: Regular Expressions in Haskell; label: More About Regular Expressions; label: Translating a glob Pattern into a Regular Expression; label: An important Aside: Writing Lazy Functions; label: Making Use of Our Pattern Matcher; label: Handling Errors Through API Design; label: Putting Our Code to Work; label: Chapter 9
title: I/O Case Study: A Library for Searching the Filesystem; label: The find Command; label: Starting Simple: Recursively Listing a Directory; label: A Naive Finding Function; label: Predicates: From Poverty to Riches, While Remaining Pure; label: Sizing a File Safely; label: A Domain-Specific Language for Predicates; label: Controlling Traversal; label: Density, Readability, and the Learning Process; label: Another Way of Looking at Traversal; label: Useful Coding Guidelines; label: Chapter 10
title: Code Case Study: Parsing a Binary Data Format; label: Grayscale Files; label: Parsing a Raw PGM File; label: Getting Rid of Boilerplate Code; label: Implicit State; label: Introducing Functors; label: Writing a Functor Instance for Parse; label: Using Functors for Parsing; label: Rewriting Our PGM Parser; label: Future Directions; label: Chapter 11
title: Testing and Quality Assurance; label: QuickCheck: Type-Based Testing; label: Testing Case Study: Specifying a Pretty Printer; label: Measuring Test Coverage with HPC; label: Chapter 12
title: Barcode Recognition; label: A Little Bit About Barcodes; label: Introducing Arrays; label: Encoding an EAN-13 Barcode; label: Constraints on Our Decoder; label: Divide and Conquer; label: Turning a Color Image into Something Tractable; label: What Have We Done to Our Image?; label: Finding Matching Digits; label: Life Without Arrays or Hash Tables; label: Turning Digit Soup into an Answer; label: Working with Row Data; label: Pulling It All Together; label: A Few Comments on Development Style; label: Chapter 13
title: Data Structures; label: Association Lists; label: Maps; label: Functions Are Data, Too; label: Extended Example: /etc/passwd; label: Extended Example: Numeric Types; label: Taking Advantage of Functions as Data; label: General-Purpose Sequences; label: Chapter 14
title: Monads; label: Revisiting Earlier Code Examples; label: Looking for Shared Patterns; label: The Monad Typeclass; label: And Now, a Jargon Moment; label: Using a New Monad: Show Your Work!; label: Mixing Pure and Monadic Code; label: Putting a Few Misconceptions to Rest; label: Building the Logger Monad; label: The Maybe Monad; label: The List Monad; label: Desugaring of do Blocks; label: The State Monad; label: Monads and Functors; label: The Monad Laws and Good Coding Style; label: Chapter 15
title: Programming with Monads; label: Golfing Practice: Association Lists; label: Generalized Lifting; label: Looking for Alternatives; label: Adventures in Hiding the Plumbing; label: Separating Interface from Implementation; label: The Reader Monad; label: A Return to Automated Deriving; label: Hiding the IO Monad; label: Chapter 16
title: Using Parsec; label: First Steps with Parsec: Simple CSV Parsing; label: The sepBy and endBy Combinators; label: Choices and Errors; label: Extended Example: Full CSV Parser; label: Parsec and MonadPlus; label: Parsing a URL-Encoded Query String; label: Supplanting Regular Expressions for Casual Parsing; label: Parsing Without Variables; label: Applicative Functors for Parsing; label: Applicative Parsing by Example; label: Parsing JSON Data; label: Parsing a HTTP Request; label: Chapter 17
title: Interfacing with C: The FFI; label: Foreign Language Bindings: The Basics; label: Regular Expressions for Haskell: A Binding for PCRE; label: Passing String Data Between Haskell and C; label: Matching on Strings; label: Chapter 18
title: Monad Transformers; label: Motivation: Boilerplate Avoidance; label: A Simple Monad Transformer Example; label: Common Patterns in Monads and Monad Transformers; label: Stacking Multiple Monad Transformers; label: Moving Down the Stack; label: Understanding Monad Transformers by Building One; label: Transformer Stacking Order Is Important; label: Putting Monads and Monad Transformers into Perspective; label: Chapter 19
title: Error Handling; label: Error Handling with Data Types; label: Exceptions; label: Error Handling in Monads; label: Chapter 20
title: Systems Programming in Haskell; label: Running External Programs; label: Directory and File Information; label: Program Termination; label: Dates and Times; label: Extended Example: Piping; label: Chapter 21
title: Using Databases; label: Overview of HDBC; label: Installing HDBC and Drivers; label: Connecting to Databases; label: Transactions; label: Simple Queries; label: SqlValue; label: Query Parameters; label: Prepared Statements; label: Reading Results; label: Database Metadata; label: Error Handling; label: Chapter 22
title: Extended Example: Web Client Programming; label: Basic Types; label: The Database; label: The Parser; label: Downloading; label: Main Program; label: Chapter 23
title: GUI Programming with gtk2hs; label: Installing gtk2hs; label: Overview of the GTK+ Stack; label: User Interface Design with Glade; label: Event-Driven Programming; label: Initializing the GUI; label: The Add Podcast Window; label: Long-Running Tasks; label: Using Cabal; label: Chapter 24
title: Concurrent and Multicore Programming; label: Defining Concurrency and Parallelism; label: Concurrent Programming with Threads; label: Simple Communication Between Threads; label: The Main Thread and Waiting for Other Threads; label: Communicating over Channels; label: Useful Things to Know About; label: Shared-State Concurrency Is Still Hard; label: Using Multiple Cores with GHC; label: Parallel Programming in Haskell; label: Parallel Strategies and MapReduce; label: Chapter 25
title: Profiling and Optimization; label: Profiling Haskell Programs; label: Controlling Evaluation; label: Understanding Core; label: Advanced Techniques: Fusion; label: Chapter 26
title: Advanced Library Design: Building a Bloom Filter; label: Introducing the Bloom Filter; label: Use Cases and Package Layout; label: Basic Design; label: The ST Monad; label: Designing an API for Qualified Import; label: Creating a Mutable Bloom Filter; label: The Immutable API; label: Creating a Friendly Interface; label: Creating a Cabal Package; label: Testing with QuickCheck; label: Performance Analysis and Tuning; label: Chapter 27
title: Sockets and Syslog; label: Basic Networking; label: Communicating with UDP; label: Communicating with TCP; label: Chapter 28
title: Software Transactional Memory; label: The Basics; label: Some Simple Examples; label: STM and Safety; label: Retrying a Transaction; label: Choosing Between Alternatives; label: I/O and STM; label: Communication Between Threads; label: A Concurrent Web Link Checker; label: Practical Aspects of STM; label: Appendix
title: Installing GHC and Haskell Libraries; label: Installing GHC; label: Installing Haskell Software; label: Appendix
title: Characters, Strings, and Escaping Rules; label: Writing Character and String Literals; label: International Language Support; label: Escaping Text; label: Colophon