diff options
Diffstat (limited to 'assignment-12/gastje.dcl')
-rw-r--r-- | assignment-12/gastje.dcl | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/assignment-12/gastje.dcl b/assignment-12/gastje.dcl new file mode 100644 index 0000000..a08d35b --- /dev/null +++ b/assignment-12/gastje.dcl @@ -0,0 +1,34 @@ +definition module gastje + +import StdGeneric +from StdOverloaded import class == +from GenEq import generic gEq + +test :: p -> [String] | prop p + +class prop a where holds :: a Prop -> [Prop] + +instance prop Bool + +instance prop (a->b) | prop b & testArg a + +class testArg a | gen{|*|}, string{|*|}, gEq{|*|} a + +:: Prop + +generic gen a :: [a] +derive gen Int, Bool, Char, UNIT, PAIR, EITHER, CONS, OBJECT, RECORD, FIELD +generic string a :: a -> String +derive string Int, Bool, Char, UNIT, PAIR, EITHER, CONS of gcd, OBJECT, RECORD of grd, FIELD of gfd + +:: For t = E.p: (For) infix 0 (t -> p) [t] & prop p + +instance prop (For t) | string{|*|} t + +:: Implies = E.p: (==>) infix 0 Bool p & prop p + +instance prop Implies + +:: Equals a = (=.=) infix 4 a a + +instance prop (Equals a) | ==, string{|*|} a |