mirror of
https://github.com/anoma/juvix.git
synced 2024-12-12 14:28:08 +03:00
8 lines
195 B
Plaintext
8 lines
195 B
Plaintext
|
-- recursion through higher-order functions
|
||
|
|
||
|
def g : (Int -> Int) -> Int -> Int :=
|
||
|
\(f : Int -> Int) \(x : Int) if x = 0 then 0 else f (x - 1);
|
||
|
def f : Int -> Int := \(x : Int) x + g f x;
|
||
|
|
||
|
f
|