mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-06 14:58:50 +00:00
23 lines
No EOL
261 B
Text
23 lines
No EOL
261 B
Text
import Ref;
|
|
|
|
public fun id (x) {
|
|
x
|
|
}
|
|
|
|
public infixl $ after := (f, x) {
|
|
f (x)
|
|
}
|
|
|
|
public infix # after * (f, g) {
|
|
fun (x) {
|
|
f (g (x))
|
|
}
|
|
}
|
|
|
|
public fun fix (f) {
|
|
local knot = ref ({});
|
|
|
|
knot ::= fun (x) {f (deref (knot)) (x)};
|
|
|
|
deref (knot)
|
|
} |