A categorical programming language
修订版 | 9258165059b91564a7f2d80f880642cbee7cc603 (tree) |
---|---|
时间 | 2021-09-08 12:57:22 |
作者 | Corbin <cds@corb...> |
Commiter | Corbin |
Remove old scaffolding.
@@ -11,12 +11,8 @@ in pkgs.stdenv.mkDerivation { | ||
11 | 11 | (with chickenPackages.chickenEggs; [ srfi-189 mini-kanren ]) ++ [ |
12 | 12 | # maintaining frame/ |
13 | 13 | ocamlformat |
14 | - # debugging stub.ml | |
15 | - ocamlPackages.utop | |
16 | 14 | # working with sexps |
17 | 15 | ocamlPackages.sexp |
18 | - # running compile.sh | |
19 | - ocaml | |
20 | 16 | # publishing |
21 | 17 | keychain mktorrent |
22 | 18 | ]; |
@@ -1,29 +0,0 @@ | ||
1 | -let id x = x | |
2 | -let comp f g x = g (f x) | |
3 | -let ( >>> ) f g = comp f g | |
4 | -let pair f g x = (f x, g x) | |
5 | -let left = Result.ok | |
6 | -let right = Result.error | |
7 | -let case f g = Result.fold ~ok:f ~error:g | |
8 | -let assl (x, (y, z)) = ((x, y), z) | |
9 | -let assr ((x, y), z) = (x, (y, z)) | |
10 | -let swap (x, y) = (y, x) | |
11 | -let dup x = (x, x) | |
12 | -let curry f x y = f (x, y) | |
13 | -let uncurry f (x, y) = f x y | |
14 | -let app (f, x) = f x | |
15 | -let name f () = f | |
16 | -let t () = true | |
17 | -let f () = false | |
18 | -let conj (p, q) = p && q | |
19 | -let disj (p, q) = p || q | |
20 | - | |
21 | -type nat = O | S of nat | |
22 | - | |
23 | -let zero () = O | |
24 | -let succ n = S n | |
25 | -let rec pr x f n = match n with O -> x () | S p -> f (pr x f p) | |
26 | -let nil () = [] | |
27 | -let cons (x, xs) = x :: xs | |
28 | -let map f = List.map f | |
29 | -let fold x f = List.fold_left (fun y z -> f (z, y)) (x ()) |