mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-19 01:01:59 +03:00
5a962929e7
Co-authored-by: Zoe Stafford <zoepolarsax@gmail.com>
13 lines
204 B
Idris
13 lines
204 B
Idris
module PrimLoop
|
|
|
|
%default total
|
|
|
|
loop : Nat -> PrimIO ()
|
|
loop Z w = MkIORes () w
|
|
loop (S k) w =
|
|
let MkIORes () w2 := toPrim (printLn (S k)) w
|
|
in loop k w2
|
|
|
|
main : IO ()
|
|
main = fromPrim $ loop 10
|