@@ -35,7 +35,7 @@ module Effectful.Internal.Monad
3535 , withEffToIO
3636
3737 --- *** Low-level helpers
38− , unsafeWithLiftMapIO
38+ , unsafeLiftMapIO
3939 , seqUnliftEff
4040 , concUnliftEff
4141
@@ -154,19 +154,17 @@ unsafeEff_ m = unsafeEff $ \_ -> m
154154--
155155-- to
156156--
157−-- @forall localEs. 'Eff' localEs a -> 'Eff' localEs b@
157+-- @'Eff' es a -> 'Eff' es b@
158158--
159−-- This function is __unsafe__ because it can be used to introduce arbitrary
160−-- 'IO' actions into pure 'Eff' operations.
159+-- This function is __unsafe__ because:
161160--
162−-- /Note:/ the 'IO' operation must not run its argument in a separate thread,
163−-- attempting to do so will result in a runtime error.
164−unsafeWithLiftMapIO
165− :: HasCallStack
166− => ((forall a b localEs. (IO a -> IO b) -> Eff localEs a -> Eff localEs b) -> Eff es r)
167− -> Eff es r
168−unsafeWithLiftMapIO k = k $ \mapIO m -> unsafeEff $ \es -> do
169− seqUnliftEff es $ \unlift -> mapIO $ unlift m
161+-- - It can be used to introduce arbitrary 'IO' actions into pure 'Eff'
162+-- operations.
163+--
164+-- - The 'IO' operation must not run its argument in a separate thread, but it's
165+-- not checked anywhere.
166+unsafeLiftMapIO :: (IO a -> IO b) -> Eff es a -> Eff es b
167+unsafeLiftMapIO f m = unsafeEff $ \es -> f (unEff m es)
170168
171169-- | Lower 'Eff' operations into 'IO' ('SeqUnlift').
172170seqUnliftEff