September 2017
Beginner to intermediate
396 pages
9h 46m
English
import Control.Monad
nexts :: Num a => a -> [a]
nexts x = do
x : nexts (x+1)
pairs :: [a] -> [b] -> [(a,b)]
pairs xs ys = do
x <- xs
y <- ys
return (x,y)
partition :: (a -> b -> Bool) -> [a] -> [b] -> [(a,b)] partition f xs ys = [ (x, y) | x <- xs, y <- ys, f x y] partition1 ...
Read now
Unlock full access