Hello everyone, I would like to ask something that I found in the ebook "a Gentle Introduction to Haskell". http://haskell.org/tutorial/stdclasses.html#sect8.4
data Tree a = Leaf a | Branch (Tree a) (Tree a) instance (Ord a) => Ord (Tree a) where (Leaf _) <= (Branch _) = True (Leaf x) <= (Leaf y) = x <= y (Branch _) <= (Leaf _) = False (Branch l r) <= (Branch l' r') = l == l' && r <= r' || l <= l' The latter specifies a lexicographic order: Constructors are ordered by the order of their appearance the data declaration, and the arguments of a constructor are compared from left to right. Although I have tried to make sense what lexicographic order means I haven't figured out. Maybe an example with a simple application of this would be helpful. To be honest I can't understand what the symbol <= really means. Thanks -- View this message in context: http://www.nabble.com/lexicographic-order-tp16381434p16381434.html Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com. _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe