A categorical programming language
修订版 | 8922d03c3e61e9afc65b9c31576dd09d49f9e517 (tree) |
---|---|
时间 | 2021-08-30 08:57:46 |
作者 | Corbin <cds@corb...> |
Commiter | Corbin |
movelist: Expose djinn functionality.
@@ -1,4 +1,5 @@ | ||
1 | 1 | (import (chicken process-context)) |
2 | +(import (matchable)) | |
2 | 3 | (import (mini-kanren)) |
3 | 4 | |
4 | 5 | ; Relate a Cammy expression to its input and output types. |
@@ -61,6 +62,10 @@ | ||
61 | 62 | (define (djinn x s t) |
62 | 63 | (run x (q) (cammyo q s t))) |
63 | 64 | |
64 | -(begin | |
65 | - (display (type-check (read))) | |
66 | - (newline)) | |
65 | +(match (map (lambda (s) (read (open-input-string s))) | |
66 | + (command-line-arguments)) | |
67 | + [('type-check) (begin | |
68 | + (display (type-check (read))) (newline))] | |
69 | + [('djinn (? number? count) in out) (begin | |
70 | + (display (djinn count in out)) | |
71 | + (newline))]) |
@@ -6,3 +6,5 @@ | ||
6 | 6 | * rat |
7 | 7 | * jelly: zero (pr ...), succ (pr ...), nil (fold ...), cons (fold ...) can all |
8 | 8 | be unrolled one step, allowing for loops to be inlined |
9 | +* refactoring from the bikeshed: ignore -> ! | |
10 | +* allow user-defined non-nullary functors |