2008/3/30, Bulat Ziganshin <[EMAIL PROTECTED]>:
>  although the last alternative,
>    (Branch l r) <= (Branch l' r')  =  l == l' && r <= r' || l <= l'
> seems suspicious to me. isn't it the same as
>    (Branch l r) <= (Branch l' r')  =  l <= l'

Yes, it should be :
(Branch l r) <= (Branch l' r')  =  l < l' || l == l' && r <= r'

Lexical order for a tuple (a,b) is :
(a,b) <= (a',b') iff (a < a' or (a == a' and b <= b'))
The same idea can be applied to list (where Nil is strictly less than
anything else) or other datatypes.

-- 
Jedaï
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to