Skip to content

Commit

Permalink
Merge pull request adambard#74 from brunal/patch-1
Browse files Browse the repository at this point in the history
Make myMap work on empty lists
  • Loading branch information
adambard committed Jul 1, 2013
2 parents cf9273a + 5d946b1 commit adaf490
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion haskell.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ foo (x, y) = (x + 1, y + 2)
-- Pattern matching on arrays. Here `x` is the first element
-- in the array, and `xs` is the rest of the array. We can write
-- our own map function:
myMap func [x] = [func x]
myMap func [] = []
myMap func (x:xs) = func x:(myMap func xs)

-- Anonymous functions are created with a backslash followed by
Expand Down

0 comments on commit adaf490

Please sign in to comment.