20.06.2016 Views

HaskellBook

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

20 CHAPTER 2. STARTING OUT<br />

function we supply. A list produced by a comprehension that draws from two<br />

lists of length 4 will have a length of 16, provided we don’t filter them. If we<br />

have two lists, [2,5,10] and [8,10,11] and we want to get the products of all<br />

the possible combinations between numbers in those lists, here’s what we’d<br />

do.<br />

ghci > [ x*y | x let adjectives = [" lazy "," grouchy "," scheming "]<br />

ghci > [ adjective ++ " " ++ noun | adjective [ [ x | x

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!