diff options
Diffstat (limited to 'frontend/hashtable.icl')
-rw-r--r-- | frontend/hashtable.icl | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/frontend/hashtable.icl b/frontend/hashtable.icl index 934bbfc..78c2767 100644 --- a/frontend/hashtable.icl +++ b/frontend/hashtable.icl @@ -20,6 +20,7 @@ import predef, syntax, StdCompare, compare_constructor | IC_Field !Ident | IC_Selector | IC_Instance ![Type] + | IC_InstanceMember ![Type] | IC_Generic | IC_GenericCase !Type | IC_Unknown @@ -39,18 +40,8 @@ instance =< IdentClass where (=<) (IC_Instance types1) (IC_Instance types2) = compare_types types1 types2 - where - compare_types [t1 : t1s] [t2 : t2s] - # cmp = t1 =< t2 - | cmp == Equal - = t1s =< t2s - = cmp - compare_types [] [] - = Equal - compare_types [] _ - = Smaller - compare_types _ [] - = Greater + (=<) (IC_InstanceMember types1) (IC_InstanceMember types2) + = compare_types types1 types2 (=<) (IC_GenericCase type1) (IC_GenericCase type2) = type1 =< type2 (=<) (IC_Field typ_id1) (IC_Field typ_id2) @@ -62,6 +53,18 @@ where = Smaller = Greater +compare_types [t1 : t1s] [t2 : t2s] + # cmp = t1 =< t2 + | cmp == Equal + = t1s =< t2s + = cmp +compare_types [] [] + = Equal +compare_types [] _ + = Smaller +compare_types _ [] + = Greater + instance =< (!a,!b) | =< a & =< b where (=<) (x1,y1) (x2,y2) |