[Haskell-cafe] Default Tuple Orderings
mark.spezzano at chariot.net.au
Sun Mar 15 03:33:11 EDT 2009
Does anyone know how Haskells tuple ordering works? Presumably for some
tuple T1 (x1,x2,...xn) and another tuple T2 (y1,y2,...yn) Haskell would
compare T1 and T2 as follows:
T1 < T2 if:
x1 < y1 OR otherwise if x1 == y1 then if
x2 < y2 OR otherwise if x2 == y2 then if
x3 < y3 OR otherwise etc
xn < yn OR otherwise both tuple are equal
In other words my best guess is that the ordering of tuples is by comparing
the first tuple elements and then the seconds, thirds etc, until theres an
element less than another.
Is this reasoning correct?
So minimum xs
would yield the smallest tuple (according to the above rules and if xs is
a list of tuples)?
No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.557 / Virus Database: 270.11.13/2001 - Release Date: 14/03/2009
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe