1
1
mirror of https://github.com/anoma/juvix.git synced 2025-01-05 22:46:08 +03:00
juvix/tests/Internal/positive/HigherOrderLambda.juvix
Łukasz Czajka 43d114f9b1
Adapt Juvix programs to the new pipeline (#1746)
Progress for #1742 

* Remove putStr and putStrLn
* Remove named Nats (one, two, ...)
2023-01-23 14:57:01 +01:00

15 lines
313 B
Plaintext

module HigherOrderLambda;
open import Stdlib.Prelude;
map' : {A : Type} → {B : Type} → (A → B) → List A → List B;
map' f := \{ nil := nil; (h :: t) := f h :: map' f t};
lst : List Nat;
lst := zero :: suc zero :: nil;
main : IO;
main := printNatLn (foldr (+) zero (map' ((+) (suc zero)) lst));
end;