added practicum files, updated gitignore
[fp1415.git] / files / practicum / StdRoman.icl
1 implementation module StdRoman
2
3 import StdEnv, RomeinsGetal
4
5 instance + Roman where ...
6 instance - Roman where ...
7
8 instance zero Roman where ...
9
10 instance * Roman where ...
11
12 instance / Roman where ...
13 instance one Roman where ...
14
15
16 instance ^ Roman where ...
17 instance abs Roman where ...
18 instance sign Roman where ...
19 instance ~ Roman where ...
20
21 instance == Roman where ...
22 instance < Roman where ...
23 instance isEven Roman where ...
24 instance isOdd Roman where ...
25
26 class toRoman a :: !a -> Roman
27 instance toRoman Char where ...
28 instance toRoman Int where ...
29 instance toRoman Real where ...
30 instance toRoman {#Char} where ...
31
32 class fromRoman a :: !Roman -> a
33 instance fromRoman Int where ...
34 instance fromRoman Char where ...
35 instance fromRoman Real where ...
36 instance fromRoman {#Char}where ...
37
38 instance rem Roman where ...
39 instance gcd Roman where ...
40 instance lcm Roman where ...
41
42 Start :: (Roman,String,Int,Int)
43 Start = (r,fromRoman r,toInt r,n)
44 where
45 r = (toRoman 42) * (toRoman 101)
46 n = 42 * 101