<div dir="auto">I filed a ticket[*] for this, but I think maybe the libraries list should weigh in on whether it is something that should be fixed. In general, fixST f is supposed to bottom out if f forces its argument. However, the lazy way GHC blackholes thunks under evaluation sometimes leads to the computation being run again. In certain contrived situations, this can allow the computation to succeed!<div dir="auto"><br></div><div dir="auto">The example I give in the ticket:</div><div dir="auto"><br></div><div dir="auto"><div dir="auto">import Control.Monad.ST.Strict</div><div dir="auto">import Control.Monad.Fix</div><div dir="auto">import Data.STRef</div><div dir="auto"><br></div><div dir="auto">foo :: ST s Int</div><div dir="auto">foo = do</div><div dir="auto">  ref <- newSTRef True</div><div dir="auto">  mfix $ \res -> do</div><div dir="auto">    x <- readSTRef ref</div><div dir="auto">    if x</div><div dir="auto">      then do</div><div dir="auto">        writeSTRef ref False</div><div dir="auto">        return $! res + 5 -- force the final result</div><div dir="auto">      else return 10</div><div dir="auto"><br></div><div dir="auto">main = print $ runST foo</div><div dir="auto"><br></div><div dir="auto">Here, the computation writes to an STRef before forcing the final result. Forcing the final result causes the computation to run again, this time taking the other branch. The program prints 15. When compiled with -O -feager-blackholing, however, the expected <<loop>> exception occurs.</div><div dir="auto"><br></div><div dir="auto">As far as I know, this weirdness never changes the value produced by a non-bottoming computation, and never changes a non-bottoming computation into a bottoming one. The fix (defining fixST the way fixIO is currently defined) would have a slight performance impact. Is it worth it?</div></div><div dir="auto"><br></div><div dir="auto"><div dir="auto"><div dir="auto">[*] <a href="https://ghc.haskell.org/trac/ghc/ticket/15349">https://ghc.haskell.org/trac/ghc/ticket/15349</a></div></div></div></div>