@@ -124,16 +124,20 @@ localUnliftIO (LocalEnv les) strategy k = case strategy of
124124--
125125-- to
126126--
127−-- @forall localEs. 'Eff' localEs a -> 'Eff' localEs b@
127+-- @'Eff' localEs a -> 'Eff' localEs b@
128128--
129129-- /Note:/ the operation must not run its argument in a separate thread,
130130-- attempting to do so will result in a runtime error.
131131withLiftMap
132132 :: HasCallStack
133− => ((forall a b localEs. (Eff es a -> Eff es b) -> Eff localEs a -> Eff localEs b) -> Eff es r)
133+ => LocalEnv localEs
134+ -- ^ Local environment.
135+ -> ((forall a b. (Eff es a -> Eff es b) -> Eff localEs a -> Eff localEs b) -> Eff es r)
134136 -- ^ Continuation with the lifting function in scope.
135137 -> Eff es r
136−withLiftMap k = unsafeEff $ \es -> do
138+withLiftMap !_ k = unsafeEff $ \es -> do
139+ -- The LocalEnv parameter is not used, but we need it to constraint the
140+ -- localEs type variable. It's also strict so that callers don't cheat.
137141 (`unEff` es) $ k $ \mapEff m -> unsafeEff $ \localEs -> do
138142 seqUnliftEff localEs $ \unlift -> do
139143 (`unEff` es) . mapEff . unsafeEff_ $ unlift m
@@ -144,7 +148,7 @@ withLiftMap k = unsafeEff $ \es -> do
144148--
145149-- to
146150--
147−-- @forall localEs. 'Eff' localEs a -> 'Eff' localEs b@
151+-- @'Eff' localEs a -> 'Eff' localEs b@
148152--
149153-- /Note:/ the operation must not run its argument in a separate thread,
150154-- attempting to do so will result in a runtime error.
@@ -159,16 +163,20 @@ withLiftMap k = unsafeEff $ \es -> do
159163--
160164-- >>> :{
161165-- runFork :: IOE :> es => Eff (Fork : es) a -> Eff es a
162−-- runFork = interpret $ \env (ForkWithUnmask m) -> withLiftMapIO $ \liftMap -> do
166+-- runFork = interpret $ \env (ForkWithUnmask m) -> withLiftMapIO env $ \liftMap -> do
163167-- localUnliftIO env (ConcUnlift Ephemeral $ Limited 1) $ \unlift -> do
164168-- forkIOWithUnmask $ \unmask -> unlift $ m $ liftMap unmask
165169-- :}
166170withLiftMapIO
167171 :: (HasCallStack, IOE :> es)
168− => ((forall a b localEs. (IO a -> IO b) -> Eff localEs a -> Eff localEs b) -> Eff es r)
172+ => LocalEnv localEs
173+ -- ^ Local environment.
174+ -> ((forall a b. (IO a -> IO b) -> Eff localEs a -> Eff localEs b) -> Eff es r)
169175 -- ^ Continuation with the lifting function in scope.
170176 -> Eff es r
171−withLiftMapIO k = k $ \mapIO m -> unsafeEff $ \es -> do
177+withLiftMapIO !_ k = k $ \mapIO m -> unsafeEff $ \es -> do
178+ -- The LocalEnv parameter is not used, but we need it to constraint the
179+ -- localEs type variable. It's also strict so that callers don't cheat.
172180 seqUnliftEff es $ \unlift -> mapIO $ unlift m
173181
174182----------------------------------------