From f7606c4eb8c45033db41b2ec1fc3e446b375fa87 Mon Sep 17 00:00:00 2001 From: johnvg Date: Thu, 21 Apr 2011 15:11:27 +0000 Subject: use strictness annotations in instance member types, add instance member types in definition modules git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@1932 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d --- frontend/hashtable.icl | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'frontend/hashtable.icl') 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) -- cgit v1.2.3