diff options
author | Adam Bard <github@adambard.com> | 2015-03-01 22:19:51 +0000 |
---|---|---|
committer | Adam Bard <github@adambard.com> | 2015-03-01 22:19:51 +0000 |
commit | cf4bb209d6ce1d28993f3d91d5973aedd0e2f26b (patch) | |
tree | a6ebc7f8082c79af9c855ebca82f55ec59e802ee /haskell.html.markdown | |
parent | 733eced1bae0c341ff8819436f544d1f2b7a8b72 (diff) | |
parent | 36a296de5d8d82212755ba33388517486f7f804c (diff) |
Merge pull request #981 from munrocape/patch-1
Moved explanation of indexing into a list earlier
Diffstat (limited to 'haskell.html.markdown')
-rw-r--r-- | haskell.html.markdown | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/haskell.html.markdown b/haskell.html.markdown index 52433aaa..79fbf09f 100644 --- a/haskell.html.markdown +++ b/haskell.html.markdown @@ -80,6 +80,9 @@ not False -- True [5..1] -- This doesn't work because Haskell defaults to incrementing. [5,4..1] -- [5, 4, 3, 2, 1] +-- indexing into a list +[0..] !! 5 -- 5 + -- You can also have infinite lists in Haskell! [1..] -- a list of all the natural numbers @@ -99,9 +102,6 @@ not False -- True -- adding to the head of a list 0:[1..5] -- [0, 1, 2, 3, 4, 5] --- indexing into a list -[0..] !! 5 -- 5 - -- more list operations head [1..5] -- 1 tail [1..5] -- [2, 3, 4, 5] |