summaryrefslogtreecommitdiff
path: root/assignment-12/gastje.dcl
blob: a52618c6f70803db53940a74ab480e35c250fd9e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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

:: Property
	= E.p t: (For) infix 0 (t -> p) [t] & prop p & string{|*|} t
	| E.p:   (==>) infix 0 Bool p       & prop p
	| E.t:   (=.=) infix 4 t t          & ==, string{|*|} t

instance prop Property