bork
[clean-tests.git] / abc / test.icl
1 module test
2
3 (+) :: !Int !Int -> Int
4 (+) a b
5 = code {
6 addI
7 }
8
9 (*) :: !Int !Int -> Int
10 (*) a b
11 = code {
12 mulI
13 }
14
15 (-) :: !Int !Int -> Int
16 (-) a b
17 = code {
18 subI
19 }
20
21 fac :: Int -> Int
22 fac 0 = 1
23 fac n = n * fac (n - 1)
24
25 :: List a = Cons a (List a) | Nil
26 toList :: [a] -> List a
27 toList [] = Nil
28 toList [x:xs] = Cons x (toList xs)
29
30 length :: (List a) -> Int
31 length Nil = 0
32 length (Cons _ xs) = 1 + length xs
33
34 inc :: (Int -> Int)
35 inc = (+) 1
36
37 plus :: Int -> (Int -> Int)
38 plus x = \y->(+) x y
39
40 Start = (fac 5, length (toList [0,1,2,3,4,5]), inc, plus)