2008/6/25 Conal Elliott <[EMAIL PROTECTED]>:
> I have a foggy memory that early ML had only binary pairing, nesting for
> n-tuples.  Can anyone confirm this memory.  If so, does anyone remember the
> rationale for going to n-tuples?  Performance, perhaps?
>
> Similarly, did the Haskell designers consider pairs as an alternative to
> n-ary tuples?

I think performance was part of it: accessing the nth element of a
tuple is O(1), but the nth element of a nested pair is O(n).

On the other hand, you can't internally represent nested pairs as
n-tuples because of laziness. (a,(b,c)) has elements of the form
(x,_|_) that don't correspond to any triple.

-- 
Dave Menendez <[EMAIL PROTECTED]>
<http://www.eyrie.org/~zednenem/>
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to