0-based versus 1-based

2001-09-27 Thread Tom Pledger
Just as a matter of idle curiosity, is there a particular reason for tuples starting at element 1 (fst) whereas lists start at element 0? fst ('x', 'y') -- 'x' xy !! 1 -- 'y' ___ Haskell mailing list [EMAIL PROTECTED]

Re: 0-based versus 1-based

2001-09-27 Thread Jorge Adriano
On Thursday 27 September 2001 23:16, Tom Pledger wrote: Just as a matter of idle curiosity, is there a particular reason for tuples starting at element 1 (fst) whereas lists start at element 0? fst ('x', 'y') -- 'x' xy !! 1 -- 'y' xs = [1,2,3,4] If I were to ask you which one

Re: 0-based versus 1-based

2001-09-27 Thread Ashley Yakeley
At 2001-09-27 15:16, Tom Pledger wrote: Just as a matter of idle curiosity, is there a particular reason for tuples starting at element 1 (fst) whereas lists start at element 0? 'fst' (first) is an ordinal. It actually corresponds to the cardinal 'zero'. The element at zero is the first

Re: 0-based versus 1-based

2001-09-27 Thread Tom Pledger
Thanks for the replies. I keep forgetting to read (!!1) as the element at 1 and not as the 1st element. ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell