Idris2/tests/idris2/primloop/PrimLoop.idr

13 lines
204 B
Idris
Raw Normal View History

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