aboutsummaryrefslogtreecommitdiff
path: root/stdlib.slip
blob: e73674e9695cf94a1b0ab40cb42cb7b88cabd1dc (plain)
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
(let if
     (fn (cond iftrue iffalse) (Bool T T) T
         (case cond
             (true iftrue)
             (_ iffalse))
     )
)


(let ++
     (fn x Int Int
         (+ x 1)
     )
)


(let --
    (fn x Int Int
        (- x 1)
    )
)


(let sum (fix
	(fn sum' ((Int ...) -> Int) ((Int ...) -> Int)
		(fn vec (Int ...) Int
			(case vec
				((h ..t) (+ h (sum' t)))
				(_ 0))
		)
	)
))