mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-21 14:18:46 +00:00
More ostap
This commit is contained in:
parent
f1f3c8aff0
commit
9163747ff3
7 changed files with 175 additions and 145 deletions
|
|
@ -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)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue