@@ -40,7 +40,7 @@ import Control.Monad.IO.Class
4040import Control.Monad.IO.Unlift
4141import Control.Monad.Trans.Control
4242import GHC.Magic (oneShot)
43−import System.IO.Unsafe (unsafePerformIO)
43+import System.IO.Unsafe (unsafeDupablePerformIO)
4444
4545import Effectful.Internal.Effect
4646import Effectful.Internal.Env
@@ -57,7 +57,10 @@ runEff (Eff m) =
5757 -- unsafePerformIO is safe here since IOE was not on the stack, so no IO with
5858 -- side effects was performed (unless someone sneakily introduced side effects
5959 -- with unsafeEff, but then all bets are off).
60− unsafePerformIO $ m =<< emptyEnv
60+ --
61+ -- Moreover, internals don't allocate any resources that require explicit
62+ -- cleanup actions to run, so the "Dupable" part should also be just fine.
63+ unsafeDupablePerformIO $ m =<< emptyEnv
6164
6265unsafeEff :: (Env es -> IO a) -> Eff es a
6366unsafeEff m = Eff (oneShot m)