© 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_9

9. List Comprehension

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

Chapter 6 introduced lists, and now you will learn another way to represent a list. Do you remember how sets are represented using mathematical symbols? Well, you will do that with lists. Further, you will learn more complex functions that you can apply on lists.

Introduction

Let’s say you have the set A = {x ∈ | 5 ≤ x ≤ 10}. If you pay a little attention, you will observe that in natural terms A is a list. Haskell provides you with a way to represent such lists, as shown here:
Prelude> let ...

Get Haskell Quick Syntax Reference: A Pocket Guide to the Language, APIs, and Library now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.