data-effects-0.1.2.0: A basic framework for effect systems based on effects represented by GADTs.
Copyright(c) 2023 Yamada Ryo
LicenseMPL-2.0 (see the file LICENSE)
Maintainerymdfield@outlook.jp
Stabilityexperimental
Portabilityportable
Safe HaskellSafe-Inferred
LanguageGHC2021

Data.Effect.Provider

Description

This module provides the Provider effect, comes from Effectful.Provider in the effectful package.

Documentation

data Provider' c i ctx e (f :: Type -> Type) (a :: Type) where Source #

Constructors

Provide :: i -> (forall g. (c g, e g) => (forall x. f x -> g x) -> g a) -> Provider' c i ctx e f (ctx a) 

Instances

Instances details
() => HFunctor (Provider' c i ctx e) Source # 
Instance details

Defined in Data.Effect.Provider

Methods

hfmap :: forall (f :: Type -> Type) (g :: Type -> Type). (f :-> g) -> Provider' c i ctx e f :-> Provider' c i ctx e g #

type Provider c i ctx e = (##>) ProviderKey (Provider' c i ctx e) Source #

provide :: forall (i :: Type) (c :: (Type -> Type) -> Constraint) (e :: (Type -> Type) -> Constraint) (a :: Type) (ctx :: Type -> Type) f. SendSigBy ProviderKey (Provider' c i ctx e) f => i -> (forall (g :: Type -> Type). (c g, e g) => (forall (x :: Type). f x -> g x) -> g a) -> f (ctx a) Source #

provide'' :: forall key (i :: Type) (c :: (Type -> Type) -> Constraint) (e :: (Type -> Type) -> Constraint) (a :: Type) (ctx :: Type -> Type) f. SendSigBy key (Provider' c i ctx e) f => i -> (forall (g :: Type -> Type). (c g, e g) => (forall (x :: Type). f x -> g x) -> g a) -> f (ctx a) Source #

provide' :: forall tag (i :: Type) (c :: (Type -> Type) -> Constraint) (e :: (Type -> Type) -> Constraint) (a :: Type) (ctx :: Type -> Type) f. SendSig (TagH (Provider' c i ctx e) tag) f => i -> (forall (g :: Type -> Type). (c g, e g) => (forall (x :: Type). f x -> g x) -> g a) -> f (ctx a) Source #

provide'_ :: forall (i :: Type) (c :: (Type -> Type) -> Constraint) (e :: (Type -> Type) -> Constraint) (a :: Type) (ctx :: Type -> Type) f. SendSig (Provider' c i ctx e) f => i -> (forall (g :: Type -> Type). (c g, e g) => (forall (x :: Type). f x -> g x) -> g a) -> f (ctx a) Source #

type MonadProvider i ctx e = Provider Monad i ctx e Source #

mprovide :: forall e i ctx f a. SendSigBy ProviderKey (MonadProvider' i ctx e) f => i -> (forall g. (Monad g, e g) => (f ~> g) -> g a) -> f (ctx a) Source #

aprovide :: forall e i ctx f a. SendSigBy ProviderKey (ApplicativeProvider' i ctx e) f => i -> (forall h. (Applicative h, e h) => (f ~> h) -> h a) -> f (ctx a) Source #