Synopses & Reviews
It's all in the name: Learn You a Haskell for Great Good! is a hilarious, illustrated guide to this complex functional language. Packed with the author's original artwork, pop culture references, and most importantly, useful example code, this book teaches functional fundamentals in a way you never thought possible.
You'll start with the kid stuff: basic syntax, recursion, types and type classes. Then once you've got the basics down, the real black belt master-class begins: you'll learn to use applicative functors, monads, zippers, and all the other mythical Haskell constructs you've only read about in storybooks.
As you work your way through the author's imaginative (and occasionally insane) examples, you'll learn to:
- Laugh in the face of side effects as you wield purely functional programming techniques
- Use the magic of Haskell's "laziness" to play with infinite sets of data
- Organize your programs by creating your own types, type classes, and modules
- Use Haskell's elegant input/output system to share the genius of your programs with the outside world
Short of eating the author's brain, you will not find a better way to learn this powerful language than reading Learn You a Haskell for Great Good!
Learn You a Haskell for Great Good! is a fun, illustrated guide to learning Haskell, a functional programming language that's growing in popularity. Learn You a Haskell for Great Good! introduces programmers familiar with imperative languages (such as C++, Java, or Python) to the unique aspects of functional programming. Packed with jokes, pop culture references, and the author's own hilarious artwork, Learn You a Haskell for Great Good! eases the learning curve of this complex language, and is a perfect starting point for any programmer looking to expand his or her horizons. The well-known web tutorial on which this book is based is widely regarded as the best way for beginners to learn Haskell, and receives over 30,000 unique visitors monthly.
About the Author
Miran Lipovaca is a computer science student in Ljubljana, Slovenia. In addition to his passion for Haskell, he enjoys boxing, playing bass guitar, and, of course, drawing. He has a fascination with dancing skeletons and the number 71, and when he walks through automatic doors he pretends that he's actually opening them with his mind.
Table of Contents
Introduction; So, What's Haskell?; What You Need to Dive In; Acknowledgments; Chapter 1: Starting Out; 1.1 Calling Functions; 1.2 Baby's First Functions; 1.3 An Intro to Lists; 1.4 Texas Ranges; 1.5 I'm a List Comprehension; 1.6 Tuples; Chapter 2: Believe the Type; 2.1 Explicit Type Declaration; 2.2 Common Haskell Types; 2.3 Type Variables; 2.4 Type Classes 101; Chapter 3: Syntax in Functions; 3.1 Pattern Matching; 3.2 Guards, Guards!; 3.3 where?!; 3.4 let It Be; 3.5 case Expressions; Chapter 4: Hello Recursion!; 4.1 Maximum Awesome; 4.2 A Few More Recursive Functions; 4.3 Quick, Sort!; 4.4 Thinking Recursively; Chapter 5: Higher-Order Functions; 5.1 Curried Functions; 5.2 Some Higher-Orderism Is in Order; 5.3 The Functional Programmer's Toolbox; 5.4 Lambdas; 5.5 I Fold You So; 5.6 Function Application with $; 5.7 Function Composition; Chapter 6: Modules; 6.1 Importing Modules; 6.2 Solving Problems with Module Functions; 6.3 Mapping Keys to Values; 6.4 Making Our Own Modules; Chapter 7: Making Our Own Types and Type Classes; 7.1 Defining a New Data Type; 7.2 Shaping Up; 7.3 Record Syntax; 7.4 Type Parameters; 7.5 Derived Instances; 7.6 Type Synonyms; 7.7 Recursive Data Structures; 7.8 Type Classes 102; 7.9 A Yes-No Type Class; 7.10 The Functor Type Class; 7.11 Kinds and Some Type-Foo; Chapter 8: Input and Output; 8.1 Separating the Pure from the Impure; 8.2 Hello, World!; 8.3 Gluing I/O Actions Together; 8.4 Some Useful I/O Functions; 8.5 I/O Action Review; Chapter 9: More Input and More Output; 9.1 Files and Streams; 9.2 Reading and Writing Files; 9.3 To-Do Lists; 9.4 Command-Line Arguments; 9.5 More Fun with To-Do Lists; 9.6 Randomness; 9.7 Bytestrings; Chapter 10: Functionally Solving Problems; 10.1 Reverse Polish Notation Calculator; 10.2 Heathrow to London; Chapter 11: Applicative Functors; 11.1 Functors Redux; 11.2 Functor Laws; 11.3 Using Applicative Functors; 11.4 Useful Functions for Applicatives; Chapter 12: Monoids; 12.1 Wrapping an Existing Type into a New Type; 12.2 About Those Monoids; 12.3 Meet Some Monoids; 12.4 Folding with Monoids; Chapter 13: A Fistful of Monads; 13.1 Upgrading Our Applicative Functors; 13.2 Getting Your Feet Wet with Maybe; 13.3 The Monad Type Class; 13.4 Walk the Line; 13.5 do Notation; 13.6 The List Monad; 13.7 Monad Laws; Chapter 14: For a Few Monads More; 14.1 Writer? I Hardly Knew Her!; 14.2 Reader? Ugh, Not This Joke Again; 14.3 Tasteful Stateful Computations; 14.4 Error Error on the Wall; 14.5 Some Useful Monadic Functions; 14.6 Making a Safe RPN Calculator; 14.7 Composing Monadic Functions; 14.8 Making Monads; Chapter 15: Zippers; 15.1 Taking a Walk; 15.2 Focusing on Lists; 15.3 A Very Simple Filesystem; 15.4 Watch Your Step; 15.5 Thanks for Reading!; Updates;