Skip to Main Content
Haskell Quick Syntax Reference: A Pocket Guide to the Language, APIs, and Library
book

Haskell Quick Syntax Reference: A Pocket Guide to the Language, APIs, and Library

by Stefania Loredana Nita, Marius Mihailescu
June 2019
Intermediate to advanced content levelIntermediate to advanced
213 pages
3h 10m
English
Apress
Content preview from Haskell Quick Syntax Reference: A Pocket Guide to the Language, APIs, and Library
© Stefania Loredana Nita and Marius Mihailescu 2019
Stefania Loredana Nita and Marius MihailescuHaskell Quick Syntax Referencehttps://doi.org/10.1007/978-1-4842-4507-1_11

11. Pattern Matching

Stefania Loredana Nita1  and Marius Mihailescu1
(1)
Bucharest, Romania
 

In Chapter 7, you learned the basics of pattern matching, which is used with functions. In this chapter, you’ll learn more about the details of pattern matching.

Basically, pattern matching means matching values with patterns and binding variables with the matches that succeeded.

Let’s take a closer look at the map function . The type signature and the definition are as follows:
map _ []     = []
map f (x:xs) = f x : map f xs
Here, you can identify four types of patterns .
  • f: This pattern matches ...

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

Haskell Data Analysis cookbook

Haskell Data Analysis cookbook

Nishant Shukla

Publisher Resources

ISBN: 9781484245071Purchase LinkPublisher Website