Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Turn a handler of multiple effects into an effectful operation.
Generalizes Effectful.Provider.
Since: 2.3.1.0
Synopsis
- data ProviderList (providedEs :: [Effect]) (input :: Type) (f :: Type -> Type) :: Effect
- type ProviderList_ providedEs input = ProviderList providedEs input Identity
- runProviderList :: (HasCallStack, KnownEffects providedEs) => (forall r. HasCallStack => input -> Eff (providedEs ++ es) r -> Eff es (f r)) -> Eff (ProviderList providedEs input f : es) a -> Eff es a
- runProviderList_ :: (HasCallStack, KnownEffects providedEs) => (forall r. HasCallStack => input -> Eff (providedEs ++ es) r -> Eff es r) -> Eff (ProviderList_ providedEs input : es) a -> Eff es a
- provideList :: forall providedEs f es a. (HasCallStack, ProviderList providedEs () f :> es) => Eff (providedEs ++ es) a -> Eff es (f a)
- provideList_ :: forall providedEs es a. (HasCallStack, ProviderList_ providedEs () :> es) => Eff (providedEs ++ es) a -> Eff es a
- provideListWith :: forall providedEs input f es a. (HasCallStack, ProviderList providedEs input f :> es) => input -> Eff (providedEs ++ es) a -> Eff es (f a)
- provideListWith_ :: forall providedEs input es a. (HasCallStack, ProviderList_ providedEs input :> es) => input -> Eff (providedEs ++ es) a -> Eff es a
- type family (xs :: [Effect]) ++ (ys :: [Effect]) :: [Effect] where ...
- class KnownEffects (es :: [Effect])
Effect
data ProviderList (providedEs :: [Effect]) (input :: Type) (f :: Type -> Type) :: Effect Source #
Provide a way to run a handler of multiple providedEs
with a given
input
.
Note: f
can be used to alter the return type of the handler. If that's
unnecessary, use ProviderList_
.
Instances
type DispatchOf (ProviderList providedEs input f) Source # | |
Defined in Effectful.Provider.List | |
data StaticRep (ProviderList providedEs input f) Source # | |
Defined in Effectful.Provider.List data StaticRep (ProviderList providedEs input f) where
|
type ProviderList_ providedEs input = ProviderList providedEs input Identity Source #
A restricted variant of ProviderList
with unchanged return type of the
handler.
Handlers
:: (HasCallStack, KnownEffects providedEs) | |
=> (forall r. HasCallStack => input -> Eff (providedEs ++ es) r -> Eff es (f r)) | The handler. |
-> Eff (ProviderList providedEs input f : es) a | |
-> Eff es a |
Run the ProviderList
effect with a given handler.
:: (HasCallStack, KnownEffects providedEs) | |
=> (forall r. HasCallStack => input -> Eff (providedEs ++ es) r -> Eff es r) | The handler. |
-> Eff (ProviderList_ providedEs input : es) a | |
-> Eff es a |
Run the Provider
effect with a given handler that doesn't change its
return type.
Operations
provideList :: forall providedEs f es a. (HasCallStack, ProviderList providedEs () f :> es) => Eff (providedEs ++ es) a -> Eff es (f a) Source #
Run the handler.
provideList_ :: forall providedEs es a. (HasCallStack, ProviderList_ providedEs () :> es) => Eff (providedEs ++ es) a -> Eff es a Source #
Run the handler with unchanged return type.
:: forall providedEs input f es a. (HasCallStack, ProviderList providedEs input f :> es) | |
=> input | The input to the handler. |
-> Eff (providedEs ++ es) a | |
-> Eff es (f a) |
Run the handler with a given input.
:: forall providedEs input es a. (HasCallStack, ProviderList_ providedEs input :> es) | |
=> input | The input to the handler. |
-> Eff (providedEs ++ es) a | |
-> Eff es a |
Run the handler that doesn't change its return type with a given input.
Misc
type family (xs :: [Effect]) ++ (ys :: [Effect]) :: [Effect] where ... infixr 5 Source #
Append two type-level lists together.
class KnownEffects (es :: [Effect]) Source #
Calculate length of a list of known effects.
Instances
KnownEffects ('[] :: [Effect]) Source # | |
Defined in Effectful.Internal.Effect | |
KnownEffects es => KnownEffects (e ': es) Source # | |
Defined in Effectful.Internal.Effect |