StdCompare.dcl 596 Bytes
Newer Older
Ronny Wichers Schreur's avatar
Ronny Wichers Schreur committed
1
2
3
4
5
6
7
8
9
10
11
definition module StdCompare

import syntax, compare_constructor

::	CompareValue :== Int
Smaller :== -1
Greater	:== 1
Equal	:== 0

class (=<) infix 4 a :: !a !a -> CompareValue

12
instance =< Int, Expression, {# Char}, Ident, [a] | =< a, BasicType //, (Global a) | =< a
Ronny Wichers Schreur's avatar
Ronny Wichers Schreur committed
13

14
instance =< Type, SymbIdent
Ronny Wichers Schreur's avatar
Ronny Wichers Schreur committed
15

Artem Alimarine's avatar
Artem Alimarine committed
16
instance == BasicType, TypeVar, AttributeVar, AttrInequality, TypeSymbIdent, DefinedSymbol, 
John van Groningen's avatar
John van Groningen committed
17
			TypeContext, BasicValue, FunKind, (Global a) | == a, Priority, Assoc, Type, 
18
			ConsVariable, SignClassification, TypeCons, TCClass
Ronny Wichers Schreur's avatar
Ronny Wichers Schreur committed
19
20
21

instance < MemberDef

22
smallerOrEqual :: !Type !Type -> CompareValue