
30 Mar
2008
30 Mar
'08
6:48 p.m.
2008/3/30, Bulat Ziganshin
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ï