on master help sign in
Rename type parameters to match other functions and adjust documentation
commitf5fecaa4b130fbf8d057745ce71ea7fe4c45dfc5 authorAndrzej Rybczak <andrzej@rybczak.net> dateFri 9 Jul 2021, 15:14 (5 years ago) parent53715ff
1 file changed+9−8
src/Effectful/Interpreter.hs+9−8
src/Effectful/Interpreter.hs+9−8
@@ -134,7 +134,7 @@ localSeqUnlift
134134 :: LocalEnv localEs
135135 -- ^ Local environment from the effect handler.
136136 -> ((forall r. Eff localEs r -> Eff es r) -> Eff es a)
137− -- ^ Continuation with the unlifting function.
137+ -- ^ Continuation with the unlifting function in scope.
138138 -> Eff es a
139139localSeqUnlift (LocalEnv les) f = unsafeEff $ \es -> do
140140 unEff (seqUnliftEff $ \k -> unEff (f $ unsafeEff_ . k) es) les
@@ -146,7 +146,7 @@ localSeqUnliftIO
146146 => LocalEnv localEs
147147 -- ^ Local environment from the effect handler.
148148 -> ((forall r. Eff localEs r -> IO r) -> IO a)
149− -- ^ Continuation with the unlifting function.
149+ -- ^ Continuation with the unlifting function in scope.
150150 -> Eff es a
151151localSeqUnliftIO (LocalEnv les) f = unsafeEff_ $ unEff (seqUnliftEff f) les
152152
@@ -156,7 +156,7 @@ localUnlift
156156 -- ^ Local environment from the effect handler.
157157 -> UnliftStrategy
158158 -> ((forall r. Eff localEs r -> Eff es r) -> Eff es a)
159− -- ^ Continuation with the unlifting function.
159+ -- ^ Continuation with the unlifting function in scope.
160160 -> Eff es a
161161localUnlift (LocalEnv les) unlift f = unsafeEff $ \es -> case unlift of
162162 SeqUnlift -> unEff (seqUnliftEff $ \k -> unEff (f $ unsafeEff_ . k) es) les
@@ -169,13 +169,13 @@ localUnliftIO
169169 -- ^ Local environment from the effect handler.
170170 -> UnliftStrategy
171171 -> ((forall r. Eff localEs r -> IO r) -> IO a)
172− -- ^ Continuation with the unlifting function.
172+ -- ^ Continuation with the unlifting function in scope.
173173 -> Eff es a
174174localUnliftIO (LocalEnv les) unlift f = unsafeEff_ $ case unlift of
175175 SeqUnlift -> unEff (seqUnliftEff f) les
176176 ConcUnlift p b -> unEff (concUnliftEff p b f) les
177177
178−-- | Bring into scope a higher order lifting function.
178+-- | Create a local higher order lifting function.
179179--
180180-- Necessary for lifting 'Control.Concurrent.forkIOWithUnmask'-like operations:
181181--
@@ -191,9 +191,10 @@ localUnliftIO (LocalEnv les) unlift f = unsafeEff_ $ case unlift of
191191-- forkIOWithUnmask $ \unmask -> unlift $ m $ liftH unmask
192192-- :}
193193withLiftH
194− :: IOE :> baseEs
195− => ((forall a b es. (IO a -> IO b) -> Eff es a -> Eff es b) -> Eff baseEs r)
196− -> Eff baseEs r
194+ :: IOE :> es
195+ => ((forall a b localEs. (IO a -> IO b) -> Eff localEs a -> Eff localEs b) -> Eff es r)
196+ -- ^ Continuation with the higher order lifting function in scope.
197+ -> Eff es r
197198withLiftH k = k $ \f m -> unsafeEff $ f . unEff m
198199
199200-- $setup