Idris2/tests/idris2/primloop/PrimLoop.idr
Stefan Höck 5a962929e7
[ fix ] issue 2537 (#2538)
Co-authored-by: Zoe Stafford <zoepolarsax@gmail.com>
2022-07-07 09:54:52 +01:00

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