optimization.l3 299 Bytes
Newer Older
Luca Bataillard's avatar
Luca Bataillard committed
1
2
3
4
5
6
7
8
9
10
(def byte-write (fun (c) (@byte-write c)))
(def compose
     (fun (f g)
	  (fun (x) (f (g x)))))
(def + (fun (x y) (@+ x y)))
(def succ (fun (x) (+ x 1)))
(def twice (fun (x) (+ x x)))
(byte-write ((compose succ twice) 39))
(byte-write ((compose succ succ) 73))
(byte-write ((compose twice succ) 4))