mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-21 02:31:50 +03:00
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
|