summaryrefslogtreecommitdiff
path: root/files/practicum/LijstOverloading.icl
blob: 5d40186eec5f7d7df6c48cbea12972f997008b63 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
implementation module LijstOverloading

import StdEnv, LijstGenerator

instance zero [a] | zero a where 
instance one  [a] | one  a where 
instance ~    [a] | ~    a where 
instance +    [a] | +    a where 
instance -    [a] | -    a where 
instance *    [a] | *    a where 
instance /    [a] | /    a where 

Start  = (test [1,2,3], test [1.0,2.0,3.0])

test a = ( zero + a == a && a == a + zero
         , a - zero == a && a == ~ (zero - a)
         ,  one * a == a && a == a * one
         ,  a / one == a
         ,  ~ (~ a) == a
         )