From: Mart Lubbers Date: Mon, 31 Aug 2015 17:30:16 +0000 (+0200) Subject: rose >< nog en tests X-Git-Tag: assignment2~12 X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=dc126aec5272b81980c8be7159d559c6245ba0ee;p=ap2015.git rose >< nog en tests --- diff --git a/a1/mart/skeleton1.icl b/a1/mart/skeleton1.icl index 3e13262..bcb57fe 100644 --- a/a1/mart/skeleton1.icl +++ b/a1/mart/skeleton1.icl @@ -111,13 +111,15 @@ listToGen [x:xs] = RIGHT (PAIR x xs) instance >< UNIT where (><) _ _ = Equal -instance >< (PAIR a b) | >< a & >< b +instance >< (PAIR a b) | >< a & >< b where (><) (PAIR x1 y1) (PAIR x2 y2) = case x1 >< x2 of Equal = y1 >< y2 otherwise = x1 >< x2 -instance >< (EITHER a b) | >< a & >< b +instance >< (EITHER a b) | >< a & >< b where (><) (LEFT _) (RIGHT _) = Bigger (><) (RIGHT _) (LEFT _) = Smaller (><) (RIGHT x) (RIGHT y) = x >< y (><) (LEFT x) (LEFT y) = x >< y + +Start = "Hello World"