@@ -36,7 +36,9 @@ import Effectful.Internal.Monad
36----------------------------------------
36----------------------------------------
37-- Interpreter
37-- Interpreter
39−-- | Representation of the local 'Eff' environment.
39+-- | Opaque representation of the 'Eff' environment at the point of calling the
40+-- 'send' function, i.e. right before the control is passed to the effect
40newtype LocalEnv es = LocalEnv (Env es)
42newtype LocalEnv es = LocalEnv (Env es)
42data Interpreter (e :: Effect) = forall handlerEs. Interpreter
44data Interpreter (e :: Effect) = forall handlerEs. Interpreter
@@ -133,7 +135,7 @@ reinterpretM runHandlerEs interpreter m = unsafeEff $ \es -> do
133-- general version see 'localUnlift'.
135-- general version see 'localUnlift'.
134localSeqUnlift
136localSeqUnlift
135 :: LocalEnv localEs
137 :: LocalEnv localEs
136− -- ^ Local environment from the effect handler.
138+ -- ^ Local environment.
137 -> ((forall r. Eff localEs r -> Eff es r) -> Eff es a)
139 -> ((forall r. Eff localEs r -> Eff es r) -> Eff es a)
138 -- ^ Continuation with the unlifting function in scope.
140 -- ^ Continuation with the unlifting function in scope.
139 -> Eff es a
141 -> Eff es a
@@ -145,7 +147,7 @@ localSeqUnlift (LocalEnv les) f = unsafeEff $ \es -> do
145localSeqUnliftIO
147localSeqUnliftIO
146 :: IOE :> es
148 :: IOE :> es
147 => LocalEnv localEs
149 => LocalEnv localEs
148− -- ^ Local environment from the effect handler.
150+ -- ^ Local environment.
149 -> ((forall r. Eff localEs r -> IO r) -> IO a)
151 -> ((forall r. Eff localEs r -> IO r) -> IO a)
150 -- ^ Continuation with the unlifting function in scope.
152 -- ^ Continuation with the unlifting function in scope.
151 -> Eff es a
153 -> Eff es a
@@ -159,7 +161,7 @@ localSeqUnliftIO (LocalEnv les) f = unsafeEff_ $ unEff (seqUnliftEff f) les
159localSeqLiftUnliftIO
161localSeqLiftUnliftIO
160 :: IOE :> es
162 :: IOE :> es
161 => LocalEnv localEs
163 => LocalEnv localEs
162− -- ^ Local environment from the effect handler.
164+ -- ^ Local environment.
163 -> ((forall r. IO r -> Eff localEs r) -> (forall r. Eff localEs r -> IO r) -> IO a)
165 -> ((forall r. IO r -> Eff localEs r) -> (forall r. Eff localEs r -> IO r) -> IO a)
164 -- ^ Continuation with the lifting and unlifting function.
166 -- ^ Continuation with the lifting and unlifting function.
165 -> Eff es a
167 -> Eff es a
@@ -169,7 +171,7 @@ localSeqLiftUnliftIO (LocalEnv les) f = unsafeEff_ $ do
169-- | Create a local unlifting function with the given strategy.
171-- | Create a local unlifting function with the given strategy.
170localUnlift
172localUnlift
171 :: LocalEnv localEs
173 :: LocalEnv localEs
172− -- ^ Local environment from the effect handler.
174+ -- ^ Local environment.
173 -> UnliftStrategy
175 -> UnliftStrategy
174 -> ((forall r. Eff localEs r -> Eff es r) -> Eff es a)
176 -> ((forall r. Eff localEs r -> Eff es r) -> Eff es a)
175 -- ^ Continuation with the unlifting function in scope.
177 -- ^ Continuation with the unlifting function in scope.
@@ -182,7 +184,7 @@ localUnlift (LocalEnv les) unlift f = unsafeEff $ \es -> case unlift of
182localUnliftIO
184localUnliftIO
183 :: IOE :> es
185 :: IOE :> es
184 => LocalEnv localEs
186 => LocalEnv localEs
185− -- ^ Local environment from the effect handler.
187+ -- ^ Local environment.
186 -> UnliftStrategy
188 -> UnliftStrategy
187 -> ((forall r. Eff localEs r -> IO r) -> IO a)
189 -> ((forall r. Eff localEs r -> IO r) -> IO a)
188 -- ^ Continuation with the unlifting function in scope.
190 -- ^ Continuation with the unlifting function in scope.
@@ -212,7 +214,7 @@ localUnliftIO (LocalEnv les) unlift f = unsafeEff_ $ case unlift of
212localLiftUnliftIO
214localLiftUnliftIO
213 :: IOE :> es
215 :: IOE :> es
214 => LocalEnv localEs
216 => LocalEnv localEs
215− -- ^ Local environment from the effect handler.
217+ -- ^ Local environment.
216 -> UnliftStrategy
218 -> UnliftStrategy
217 -> ((forall r. IO r -> Eff localEs r) -> (forall r. Eff localEs r -> IO r) -> IO a)
219 -> ((forall r. IO r -> Eff localEs r) -> (forall r. Eff localEs r -> IO r) -> IO a)
218 -- ^ Continuation with the lifting and unlifting function in scope.
220 -- ^ Continuation with the lifting and unlifting function in scope.