Content deleted Content added
add code tag on list items |
m Change text formula to math formula |
||
Line 25:
map _ [] = []
map f (x : xs) = f x : map f xs
</syntaxhighlight>Now, suppose we have a list of integers <code>[0, 5, 8, 3, 2, 1]</code> and we want to map it with the function <math>f(x) = x + 1</math>, you can see below a view of each
[[File:Mapping-steps-loillibe-new.gif|alt=applying map function processing steps|none|thumb|480x480px|View of processing steps when applying map function on a list]]
|