A categorical programming language
修订版 | 120cf18b2648b020c167ba1e389d8fdc51838640 (tree) |
---|---|
时间 | 2021-11-14 15:03:49 |
作者 | Corbin <cds@corb...> |
Commiter | Corbin |
Refactor demos.
@@ -1,9 +1,3 @@ | ||
1 | 1 | (comp |
2 | - (comp | |
3 | - (pair v2/burning-ship (comp (fun/const f-zero) fun/dup)) | |
4 | - fun/app-80) | |
5 | - (comp | |
6 | - (comp (pair v2/norm (fun/const f/2)) f-lt) | |
7 | - (comp | |
8 | - (comp either (case f-zero f-one)) | |
9 | - (v3/triple id id id))))) | |
2 | + (fractal-membership v2/burning-ship nat/256) | |
3 | + (v3/broadcast (f/subpair (fun/const f-one) id))) |
@@ -1,12 +1,3 @@ | ||
1 | 1 | (comp |
2 | - (comp | |
3 | - (comp | |
4 | - (fun/apppair | |
5 | - (fun/const (comp nat/256 nonempty/unfold)) | |
6 | - (pair (comp (fun/const f-zero) fun/dup) v2/mandelbrot)) | |
7 | - snd) | |
8 | - (comp | |
9 | - (list/filter (comp (pair v2/norm (fun/const f/2)) f-lt)) | |
10 | - (comp list/len | |
11 | - (f/divpair nat/to-f (fun/const (comp nat/256 nat/to-f)))))) | |
2 | + (fractal-membership v2/mandelbrot nat/256) | |
12 | 3 | (v3/broadcast (f/subpair (fun/const f-one) id))) |
@@ -0,0 +1,6 @@ | ||
1 | +(comp | |
2 | + (iter-fractal @0 @1) | |
3 | + (comp | |
4 | + (list/filter (comp (pair v2/norm (fun/const f/2)) f-lt)) | |
5 | + (comp list/len | |
6 | + (f/divpair nat/to-f (fun/const (comp @1 nat/to-f)))))) |
@@ -0,0 +1,5 @@ | ||
1 | +(comp | |
2 | + (fun/apppair | |
3 | + (fun/const (comp @1 nonempty/unfold)) | |
4 | + (pair (comp (fun/const f-zero) fun/dup) @0)) | |
5 | + snd) |
@@ -0,0 +1 @@ | ||
1 | +(comp zero (comp succ succ)) |
@@ -0,0 +1 @@ | ||
1 | +(comp (pair nat/2 nat/8) nat/exp) |
@@ -0,0 +1 @@ | ||
1 | +(comp nat/2 succ) |
@@ -0,0 +1 @@ | ||
1 | +(comp (pair nat/2 nat/3) nat/exp) |