Skip to content

Commit

Permalink
Merge pull request adambard#76 from lubomir/patch-1
Browse files Browse the repository at this point in the history
Remove mentions of array
  • Loading branch information
adambard committed Jul 1, 2013
2 parents adaf490 + 9b6c837 commit 75d86ed
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions haskell.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ fib x = fib (x - 1) + fib (x - 2)
-- Pattern matching on tuples:
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
-- Pattern matching on lists. Here `x` is the first element
-- in the list, and `xs` is the rest of the list. We can write
-- our own map function:
myMap func [] = []
myMap func (x:xs) = func x:(myMap func xs)
Expand All @@ -164,7 +164,7 @@ myMap (\x -> x + 2) [1..5] -- [3, 4, 5, 6, 7]

-- using fold (called `inject` in some languages) with an anonymous
-- function. foldl1 means fold left, and use the first value in the
-- array as the initial value for the accumulator.
-- list as the initial value for the accumulator.
foldl1 (\acc x -> acc + x) [1..5] -- 15

----------------------------------------------------
Expand Down

0 comments on commit 75d86ed

Please sign in to comment.