Finalizer running prematurely in ghci
I have been building a library for doing hash consing, but it seemed to incorrectly finalize references to live entries in the hash cons table when I use it from ghci.
I've distilled the problem to the following test case.
Prelude System.Mem.Weak GHC.IO> let x = let y = "foo" in (unsafePerformIO $ addFinalizer y (putStrLn "deleted")) `seq` y Prelude System.Mem.Weak GHC.IO> x "foo" deleted Prelude System.Mem.Weak GHC.IO> x "foo"
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information