Idris2 icon indicating copy to clipboard operation
Idris2 copied to clipboard

[ bug ] Effectful computations can get "optimized" away

Open stefan-hoeck opened this issue 2 years ago • 0 comments

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.

stefan-hoeck avatar Jun 12 '22 18:06 stefan-hoeck