on master help sign in
Clarify note for unsafeConsEnv
04f427dAndrzej Rybczak
effectful-core/src/Effectful/Internal/Env.hs+2−1
@@ -341,7 +341,8 @@ checkSizeEnv k (Env (Forks _ baseIx lref _) _ _) = do
341-- | Extend the environment with a new data type (in place).
341-- | Extend the environment with a new data type (in place).
342--
342--
343-- /Note:/ this function is __unsafe__ because it renders the input 'Env'
343-- /Note:/ this function is __unsafe__ because it renders the input 'Env'
344−-- unusable, but it's not checked anywhere.
344+-- unusable until the corresponding 'unsafeTailEnv' call, but it's not checked
345+-- anywhere.
345unsafeConsEnv :: handler e -> Relinker handler e -> Env es -> IO (Env (e : es))
346unsafeConsEnv :: handler e -> Relinker handler e -> Env es -> IO (Env (e : es))
346unsafeConsEnv e f (Env fork gref gen) = case fork of
347unsafeConsEnv e f (Env fork gref gen) = case fork of
347 NoFork -> do
348 NoFork -> do