mirror of
https://github.com/anoma/juvix.git
synced 2024-11-30 14:13:27 +03:00
b8cd84170b
This PR updates the juvix-stdlib to the current main commit which includes: * https://github.com/anoma/juvix-stdlib/issues/59 * https://github.com/anoma/juvix-stdlib/issues/101 All the Juvix test suite files and examples in this repo have been updated to be compatible with the new stdlib.
20 lines
422 B
Plaintext
20 lines
422 B
Plaintext
-- nested lists
|
|
module test031;
|
|
|
|
import Stdlib.Prelude open;
|
|
|
|
mklst : Nat → List Nat
|
|
| zero := nil
|
|
| (suc n) := suc n :: mklst n;
|
|
|
|
mklst2 : Nat → List (List Nat)
|
|
| zero := nil
|
|
| (suc n) := mklst (suc n) :: mklst2 n;
|
|
|
|
printListNatLn : List Nat → IO
|
|
| nil := printStringLn "nil"
|
|
| (x :: xs) :=
|
|
printNat x >>> printString " :: " >>> printListNatLn xs;
|
|
|
|
main : IO := printListNatLn (flatten (mklst2 4));
|