@@ -43,8 +43,8 @@ module Effectful.Internal.Monad
4343 -- ** Handler
4444 , EffectHandler
4545 , LocalEnv(..)
46− , Handler(..)
47− , runHandler
46+ , HandlerA(..)
47+ , runHandlerA
4848
4949 -- *** Sending operations
5050 , send
@@ -151,12 +151,12 @@ unsafeEff_ m = unsafeEff $ \_ -> m
151151-- | Get the current 'UnliftStrategy'.
152152unliftStrategy :: IOE :> es => Eff es UnliftStrategy
153153unliftStrategy = do
154− IdE (IOE unlift) <- getEffect
154+ IdA (IOE unlift) <- getEffect
155155 pure unlift
156156
157157-- | Locally override the 'UnliftStrategy' with the given value.
158158withUnliftStrategy :: IOE :> es => UnliftStrategy -> Eff es a -> Eff es a
159−withUnliftStrategy unlift = localEffect $ \_ -> IdE (IOE unlift)
159+withUnliftStrategy unlift = localEffect $ \_ -> IdA (IOE unlift)
160160
161161-- | Create an unlifting function with the current 'UnliftStrategy'.
162162--
@@ -272,7 +272,7 @@ newtype IOE :: Effect where
272272--
273273-- For running pure operations see 'runPureEff'.
274274runEff :: Eff '[IOE] a -> IO a
275−runEff m = unEff (evalEffect (IdE (IOE SeqUnlift)) m) =<< emptyEnv
275+runEff m = unEff (evalEffect (IdA (IOE SeqUnlift)) m) =<< emptyEnv
276276
277277instance IOE :> es => MonadIO (Eff es) where
278278 liftIO = unsafeEff_
@@ -302,7 +302,7 @@ data Prim :: Effect where
302302
303303-- | Run an 'Eff' operation with primitive state-transformer actions.
304304runPrim :: IOE :> es => Eff (Prim : es) a -> Eff es a
305−runPrim = evalEffect (IdE Prim)
305+runPrim = evalEffect (IdA Prim)
306306
307307instance Prim :> es => PrimMonad (Eff es) where
308308 type PrimState (Eff es) = RealWorld
@@ -334,26 +334,26 @@ type EffectHandler e es
334334-- | An adapter for dynamically dispatched effects.
335335--
336336-- Represents the effect handler bundled along with its environment.
337−data Handler :: Effect -> Type where
338− Handler :: !(Env es) -> !(EffectHandler e es) -> Handler e
337+data HandlerA :: Effect -> Type where
338+ HandlerA :: !(Env es) -> !(EffectHandler e es) -> HandlerA e
339339
340340-- | Run the effect with the given handler.
341−runHandler :: Handler e -> Eff (e : es) a -> Eff es a
342−runHandler e m = unsafeEff $ \es0 -> do
341+runHandlerA :: HandlerA e -> Eff (e : es) a -> Eff es a
342+runHandlerA e m = unsafeEff $ \es0 -> do
343343 size0 <- sizeEnv es0
344344 E.bracket (unsafeConsEnv e relinker es0)
345345 (unsafeTailEnv size0)
346346 (\es -> unEff m es)
347347 where
348− relinker :: Relinker Handler e
349− relinker = Relinker $ \relink (Handler handlerEs handle) -> do
348+ relinker :: Relinker HandlerA e
349+ relinker = Relinker $ \relink (HandlerA handlerEs handle) -> do
350350 newHandlerEs <- relink handlerEs
351− pure $ Handler newHandlerEs handle
351+ pure $ HandlerA newHandlerEs handle
352352
353353-- | Send an operation of the given effect to its handler for execution.
354354send :: (HasCallStack, e :> es) => e (Eff es) a -> Eff es a
355355send op = unsafeEff $ \es -> do
356− Handler handlerEs handle <- getEnv es
356+ HandlerA handlerEs handle <- getEnv es
357357 unEff (handle (LocalEnv es) op) handlerEs
358358
359359----------------------------------------