on master help sign in
Rename type parameters to match other functions and adjust documentation
f5fecaaAndrzej Rybczak
src/Effectful/Interpreter.hs+9−8
@@ -134,7 +134,7 @@ localSeqUnlift
134 :: LocalEnv localEs
134 :: LocalEnv localEs
135 -- ^ Local environment from the effect handler.
135 -- ^ Local environment from the effect handler.
136 -> ((forall r. Eff localEs r -> Eff es r) -> Eff es a)
136 -> ((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.
138 -> Eff es a
138 -> Eff es a
139localSeqUnlift (LocalEnv les) f = unsafeEff $ \es -> do
139localSeqUnlift (LocalEnv les) f = unsafeEff $ \es -> do
140 unEff (seqUnliftEff $ \k -> unEff (f $ unsafeEff_ . k) es) les
140 unEff (seqUnliftEff $ \k -> unEff (f $ unsafeEff_ . k) es) les
@@ -146,7 +146,7 @@ localSeqUnliftIO
146 => LocalEnv localEs
146 => LocalEnv localEs
147 -- ^ Local environment from the effect handler.
147 -- ^ Local environment from the effect handler.
148 -> ((forall r. Eff localEs r -> IO r) -> IO a)
148 -> ((forall r. Eff localEs r -> IO r) -> IO a)
149− -- ^ Continuation with the unlifting function.
149+ -- ^ Continuation with the unlifting function in scope.
150 -> Eff es a
150 -> Eff es a
151localSeqUnliftIO (LocalEnv les) f = unsafeEff_ $ unEff (seqUnliftEff f) les
151localSeqUnliftIO (LocalEnv les) f = unsafeEff_ $ unEff (seqUnliftEff f) les
152
152
@@ -156,7 +156,7 @@ localUnlift
156 -- ^ Local environment from the effect handler.
156 -- ^ Local environment from the effect handler.
157 -> UnliftStrategy
157 -> UnliftStrategy
158 -> ((forall r. Eff localEs r -> Eff es r) -> Eff es a)
158 -> ((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.
160 -> Eff es a
160 -> Eff es a
161localUnlift (LocalEnv les) unlift f = unsafeEff $ \es -> case unlift of
161localUnlift (LocalEnv les) unlift f = unsafeEff $ \es -> case unlift of
162 SeqUnlift -> unEff (seqUnliftEff $ \k -> unEff (f $ unsafeEff_ . k) es) les
162 SeqUnlift -> unEff (seqUnliftEff $ \k -> unEff (f $ unsafeEff_ . k) es) les
@@ -169,13 +169,13 @@ localUnliftIO
169 -- ^ Local environment from the effect handler.
169 -- ^ Local environment from the effect handler.
170 -> UnliftStrategy
170 -> UnliftStrategy
171 -> ((forall r. Eff localEs r -> IO r) -> IO a)
171 -> ((forall r. Eff localEs r -> IO r) -> IO a)
172− -- ^ Continuation with the unlifting function.
172+ -- ^ Continuation with the unlifting function in scope.
173 -> Eff es a
173 -> Eff es a
174localUnliftIO (LocalEnv les) unlift f = unsafeEff_ $ case unlift of
174localUnliftIO (LocalEnv les) unlift f = unsafeEff_ $ case unlift of
175 SeqUnlift -> unEff (seqUnliftEff f) les
175 SeqUnlift -> unEff (seqUnliftEff f) les
176 ConcUnlift p b -> unEff (concUnliftEff p b f) les
176 ConcUnlift p b -> unEff (concUnliftEff p b f) les
177
177
178−-- | Bring into scope a higher order lifting function.
178+-- | Create a local higher order lifting function.
179--
179--
180-- Necessary for lifting 'Control.Concurrent.forkIOWithUnmask'-like operations:
180-- Necessary for lifting 'Control.Concurrent.forkIOWithUnmask'-like operations:
181--
181--
@@ -191,9 +191,10 @@ localUnliftIO (LocalEnv les) unlift f = unsafeEff_ $ case unlift of
191-- forkIOWithUnmask $ \unmask -> unlift $ m $ liftH unmask
191-- forkIOWithUnmask $ \unmask -> unlift $ m $ liftH unmask
192-- :}
192-- :}
193withLiftH
193withLiftH
194− :: IOE :> baseEs
194+ :: IOE :> es
195− => ((forall a b es. (IO a -> IO b) -> Eff es a -> Eff es b) -> Eff baseEs r)
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.
196− -> Eff baseEs r
197+ -> Eff es r
197withLiftH k = k $ \f m -> unsafeEff $ f . unEff m
198withLiftH k = k $ \f m -> unsafeEff $ f . unEff m
198
199
199-- $setup
200-- $setup