Idris2
Idris2 copied to clipboard
[ bug ] Effectful computations can get "optimized" away
Steps to Reproduce
Run the following:
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
Expected Behavior
Prints a couple of numbers.
Observed Behavior
Prints nothing.
I think this is related to the comments here, and I'm trying to get a fix working at the moment.