summaryrefslogtreecommitdiff
path: root/files/practicum/StdRoman.icl
blob: fec4461532c6323167d29e0ea5feaec2ec4374cb (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
implementation module StdRoman

import StdEnv, RomeinsGetal

instance +			Roman where ...
instance -  		Roman where ...

instance zero		Roman where ...

instance *  		Roman where ...

instance /			Roman where ...
instance one		Roman where ...


instance ^			Roman where ...
instance abs		Roman where ...
instance sign		Roman where ...
instance ~			Roman where ...

instance ==			Roman where ...
instance <  		Roman where ...
instance isEven 	Roman where ...
instance isOdd		Roman where ...

class toRoman a :: !a -> Roman
instance toRoman	Char  where ...
instance toRoman	Int   where ...
instance toRoman	Real  where ...
instance toRoman {#Char}  where ...

class fromRoman a :: !Roman -> a
instance fromRoman	Int   where ...
instance fromRoman	Char  where ...
instance fromRoman	Real  where ...
instance fromRoman {#Char}where ...

instance rem Roman        where ...
instance gcd Roman        where ...
instance lcm Roman        where ...

Start :: (Roman,String,Int,Int)
Start = (r,fromRoman r,toInt r,n)
where
	r = (toRoman 42) * (toRoman 101)
	n = 42 * 101