From b5cb14703ac99e70ecd6c1ec2abd9a2b5dbde54d Mon Sep 17 00:00:00 2001 From: Niko Weh Date: Sat, 31 Oct 2015 19:44:04 +1000 Subject: Haskell: Fix !! operator - Use a finite list, as infinite lists are not introduced yet - Use a list starting from 1 instead of 0, to make it obvious that the element returned comes from the list (and is not the second argument to !!). --- haskell.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'haskell.html.markdown') diff --git a/haskell.html.markdown b/haskell.html.markdown index 08611e63..936744a0 100644 --- a/haskell.html.markdown +++ b/haskell.html.markdown @@ -81,7 +81,7 @@ not False -- True [5,4..1] -- [5, 4, 3, 2, 1] -- indexing into a list -[0..] !! 5 -- 5 +[1..10] !! 3 -- 4 -- You can also have infinite lists in Haskell! [1..] -- a list of all the natural numbers -- cgit v1.2.3