diff options
Diffstat (limited to 'assignment-12/gastje.icl')
-rw-r--r-- | assignment-12/gastje.icl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/assignment-12/gastje.icl b/assignment-12/gastje.icl index 06148cf..d3b20ce 100644 --- a/assignment-12/gastje.icl +++ b/assignment-12/gastje.icl @@ -54,6 +54,7 @@ generic string a :: a -> String string{|Int|} i = toString i string{|Bool|} b = toString b string{|Char|} c = toString ['\'',c,'\''] +string{|Real|} r = toString r string{|UNIT|} _ = "" string{|PAIR|} f g (PAIR x y) = f x + " " + g y string{|EITHER|} f g (LEFT x) = f x @@ -88,8 +89,8 @@ where rev [x:r] accu = rev r [x:accu] /** - * TODO: mixing deep and shallow embedding. This is not how this is supposed to - * be done. These can be plain functions or classes. + * Making this one ADT makes type specifications more natural. You can e.g. + * have 'Int Int -> Property' rather than 'Int Int -> Equals (Int)' or so. */ :: Property = E.p t: (For) infix 0 (t -> p) [t] & prop p & string{|*|} t |