2019-04-11 23:00:55 +03:00
|
|
|
--The expression in red needs the {𝛆} ability, but this location only has access to the {𝛆} ability,
|
|
|
|
--
|
2021-12-16 02:00:56 +03:00
|
|
|
-- 8 | odd n = if n == 1 then true else even2 (drop n 1)
|
2019-04-11 23:00:55 +03:00
|
|
|
|
|
|
|
use Universal ==
|
|
|
|
|
|
|
|
even : Nat -> Boolean
|
2021-12-16 02:00:56 +03:00
|
|
|
even n = if n == 0 then true else odd (drop n 1)
|
2019-04-11 23:00:55 +03:00
|
|
|
|
|
|
|
odd : Nat -> Boolean
|
2021-12-16 02:00:56 +03:00
|
|
|
odd n = if n == 1 then true else even2 (drop n 1)
|
2019-04-11 23:00:55 +03:00
|
|
|
|
|
|
|
even2 = even
|
|
|
|
|
|
|
|
increment : Nat -> Nat -- signature is optional
|
|
|
|
increment n = n + 1
|