Skip to Content
Learn You a Haskell for Great Good!
book

Learn You a Haskell for Great Good!

by Miran Lipovaca
April 2011
Beginner
400 pages
12h 45m
English
No Starch Press
Content preview from Learn You a Haskell for Great Good!

Chapter 3. Syntax in Functions

In this chapter, we’ll take a look at the syntax that enables you to write Haskell functions in a readable and sensible manner. We’ll look at how to quickly deconstruct values, avoid big if else chains, and store the results of intermediate computations so that you can reuse them multiple times.

Pattern Matching

Pattern matching is used to specify patterns to which some data should conform and to deconstruct the data according to those patterns.

image with no caption

When defining functions in Haskell, you can create separate function bodies for different patterns. This leads to simple, readable code. You can pattern match on pretty much any ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Effective Haskell

Effective Haskell

Rebecca Skinner
Learning Go

Learning Go

Jon Bodner

Publisher Resources

ISBN: 9781457100406Errata Page