mirror of
https://github.com/anoma/juvix.git
synced 2025-01-07 08:08:44 +03:00
2baad15a41
* Enables new function syntax in local let-declarations * Closes #2251
14 lines
262 B
Plaintext
14 lines
262 B
Plaintext
-- case folding
|
|
module test057;
|
|
|
|
import Stdlib.Prelude open;
|
|
|
|
myfun : {A : Type} -> (A -> A -> A) -> A -> List A -> A
|
|
| f x xs :=
|
|
case x :: xs
|
|
| nil := x
|
|
| y :: nil := y
|
|
| y :: z :: _ := f y z;
|
|
|
|
main : Nat := myfun (+) 1 (7 :: 3 :: nil);
|