aboutsummaryrefslogtreecommitdiff
path: root/stdlib.slip
blob: 107bb1f63cd1db887f98454d1bf23a0cf6c17472 (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' ((Vector (Int ...)) -> Int) ((Vector (Int ...)) -> Int)
		(fn vec (Vector (Int ...)) Int
			(case vec
				((h ..t) (+ h (sum' t)))
				(_ 0))
		)
	)
))