bb11adf56a97e0ea4db8c88ac22aa52d81342205
[tt2015.git] / a3 / code / Generics / GenLexOrd.dcl
1 definition module GenLexOrd
2
3 import StdGeneric, GenEq
4
5 :: LexOrd = LT |EQ | GT
6 derive gEq LexOrd
7
8 generic gLexOrd a b :: a b -> LexOrd
9
10 // base cases
11 derive gLexOrd Char, Bool, Int, Real, String, UNIT, PAIR, EITHER, FIELD, CONS, OBJECT, [], {}, {!}
12
13 // standard types
14 derive gLexOrd (,), (,,), (,,,), (,,,,), (,,,,,), (,,,,,,), (,,,,,,,)
15
16 (=?=) infix 4 :: a a -> LexOrd | gLexOrd{|*|} a