More ostap

This commit is contained in:
Dmitry Boulytchev 2020-01-21 22:03:11 +03:00
parent f1f3c8aff0
commit 9163747ff3
7 changed files with 175 additions and 145 deletions

View file

@ -4,21 +4,20 @@ public fun id (x) {
x
}
public infixl $ after * (f, x) {
public infixl $ after := (f, x) {
f (x)
}
public infix # at $ (f, g) {
public infix # after * (f, g) {
fun (x) {
f (g (x))
}
}
public fun fix (f) {
local knot = ref (0);
knot ::= fun () {fun (x) {f (deref (knot) ()) (x)}};
local knot = ref ({});
knot ::= fun (x) {f (deref (knot)) (x)};
deref (knot) ()
deref (knot)
}