@@ -84,12 +84,12 @@ import Effectful.Internal.Unlift
85type role Eff nominal representational
85type role Eff nominal representational
87−-- | The 'Eff' monad provides the implementation of an operation that performs
87+-- | The 'Eff' monad provides the implementation of a computation that performs
88-- an arbitrary set of effects. In @'Eff' es a@, @es@ is a type-level list that
88-- an arbitrary set of effects. In @'Eff' es a@, @es@ is a type-level list that
89−-- contains all the effects that the operation may perform. For example, an
89+-- contains all the effects that the computation may perform. For example, a
90−-- operation that produces an 'Integer' by consuming a 'String' from the global
90+-- computation that produces an 'Integer' by consuming a 'String' from the
91−-- environment and acting upon a single mutable value of type 'Bool' would have
91+-- global environment and acting upon a single mutable value of type 'Bool'
92−-- the following type:
92+-- would have the following type:
95-- 'Eff' '['Effectful.Reader.Reader' 'String', 'Effectful.State.State' 'Bool'] 'Integer'
95-- 'Eff' '['Effectful.Reader.Reader' 'String', 'Effectful.State.State' 'Bool'] 'Integer'
@@ -97,7 +97,7 @@ type role Eff nominal representational
98-- Normally, a concrete list of effects is not used to parameterize 'Eff'.
98-- Normally, a concrete list of effects is not used to parameterize 'Eff'.
99-- Instead, the '(:>)' type class is used to express constraints on the list of
99-- Instead, the '(:>)' type class is used to express constraints on the list of
100−-- effects without coupling an operation to a concrete list of effects. For
100+-- effects without coupling a computation to a concrete list of effects. For
101-- example, the above example would more commonly be expressed with the
101-- example, the above example would more commonly be expressed with the
102-- following type:
102-- following type:
@@ -105,15 +105,15 @@ type role Eff nominal representational
105-- ('Effectful.Reader.Reader' 'String' ':>' es, 'Effectful.State.State' 'Bool' ':>' es) => 'Eff' es 'Integer'
105-- ('Effectful.Reader.Reader' 'String' ':>' es, 'Effectful.State.State' 'Bool' ':>' es) => 'Eff' es 'Integer'
108−-- This abstraction allows the operation to be used in functions that may
108+-- This abstraction allows the computation to be used in functions that may
109-- perform other effects, and it also allows the effects to be handled in any
109-- perform other effects, and it also allows the effects to be handled in any
111newtype Eff (es :: [Effect]) a = Eff (Env es -> IO a)
111newtype Eff (es :: [Effect]) a = Eff (Env es -> IO a)
112 deriving (Monoid, Semigroup)
112 deriving (Monoid, Semigroup)
114−-- | Run a pure 'Eff' operation.
114+-- | Run a pure 'Eff' computation.
116−-- For running operations with side effects see 'runEff'.
116+-- For running computations with side effects see 'runEff'.
117runPureEff :: Eff '[] a -> a
117runPureEff :: Eff '[] a -> a
118runPureEff (Eff m) =
118runPureEff (Eff m) =
119 -- unsafePerformIO is safe here since IOE was not on the stack, so no IO with
119 -- unsafePerformIO is safe here since IOE was not on the stack, so no IO with
@@ -134,14 +134,14 @@ unEff (Eff m) = m
134-- | Access the underlying 'IO' monad along with the environment.
134-- | Access the underlying 'IO' monad along with the environment.
136-- This function is __unsafe__ because it can be used to introduce arbitrary
136-- This function is __unsafe__ because it can be used to introduce arbitrary
137−-- 'IO' actions into pure 'Eff' operations.
137+-- 'IO' actions into pure 'Eff' computations.
138unsafeEff :: (Env es -> IO a) -> Eff es a
138unsafeEff :: (Env es -> IO a) -> Eff es a
139unsafeEff m = Eff (oneShot m)
139unsafeEff m = Eff (oneShot m)
141-- | Access the underlying 'IO' monad.
141-- | Access the underlying 'IO' monad.
143-- This function is __unsafe__ because it can be used to introduce arbitrary
143-- This function is __unsafe__ because it can be used to introduce arbitrary
144−-- 'IO' actions into pure 'Eff' operations.
144+-- 'IO' actions into pure 'Eff' computations.
145unsafeEff_ :: IO a -> Eff es a
145unsafeEff_ :: IO a -> Eff es a
146unsafeEff_ m = unsafeEff $ \_ -> m
146unsafeEff_ m = unsafeEff $ \_ -> m
@@ -264,13 +264,13 @@ instance Fail :> es => MonadFail (Eff es) where
264----------------------------------------
264----------------------------------------
267−-- | Run arbitrary 'IO' operations via 'MonadIO' or 'MonadUnliftIO'.
267+-- | Run arbitrary 'IO' computations via 'MonadIO' or 'MonadUnliftIO'.
268newtype IOE :: Effect where
268newtype IOE :: Effect where
269 IOE :: UnliftStrategy -> IOE m r
269 IOE :: UnliftStrategy -> IOE m r
271−-- | Run an 'Eff' operation with side effects.
271+-- | Run an 'Eff' computation with side effects.
273−-- For running pure operations see 'runPureEff'.
273+-- For running pure computations see 'runPureEff'.
274runEff :: Eff '[IOE] a -> IO a
274runEff :: Eff '[IOE] a -> IO a
275runEff m = unEff (evalEffect (IdA (IOE SeqUnlift)) m) =<< emptyEnv
275runEff m = unEff (evalEffect (IdA (IOE SeqUnlift)) m) =<< emptyEnv
@@ -300,7 +300,7 @@ instance IOE :> es => MonadBaseControl IO (Eff es) where
300data Prim :: Effect where
300data Prim :: Effect where
301 Prim :: Prim m r
301 Prim :: Prim m r
303−-- | Run an 'Eff' operation with primitive state-transformer actions.
303+-- | Run an 'Eff' computation with primitive state-transformer actions.
304runPrim :: IOE :> es => Eff (Prim : es) a -> Eff es a
304runPrim :: IOE :> es => Eff (Prim : es) a -> Eff es a
305runPrim = evalEffect (IdA Prim)
305runPrim = evalEffect (IdA Prim)
@@ -325,8 +325,8 @@ newtype LocalEnv (localEs :: [Effect]) (handlerEs :: [Effect]) = LocalEnv (Env l
325type EffectHandler e es
325type EffectHandler e es
326 = forall a localEs. HasCallStack
326 = forall a localEs. HasCallStack
327 => LocalEnv localEs es
327 => LocalEnv localEs es
328− -- ^ Capture of the local environment for handling local 'Eff' operations when
328+ -- ^ Capture of the local environment for handling local 'Eff' computations
329− -- @e@ is a higher order effect.
329+ -- when @e@ is a higher order effect.
330 -> e (Eff localEs) a
330 -> e (Eff localEs) a
331 -- ^ The effect performed in the local environment.
331 -- ^ The effect performed in the local environment.
332 -> Eff es a
332 -> Eff es a