data-effects-0.2.0.0: A basic framework for effect systems based on effects represented by GADTs.
Copyright(c) 2023-2024 Sayo Koyoneda
LicenseMPL-2.0 (see the file LICENSE)
Maintainerymdfield@outlook.jp
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageGHC2021

Data.Effect.Provider

Description

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

Documentation

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

Constructors

Provide :: forall i (f :: Type -> Type) (b :: Type -> Type) a1 (ctx :: Type -> Type). i -> ((forall x. f x -> b x) -> b a1) -> Provider' ctx i b f (ctx a1) 

Instances

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

Defined in Data.Effect.Provider

Methods

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

provide :: forall i b a ctx f. SendHOE (Provider' ctx i b) f => i -> ((forall x. f x -> b x) -> b a) -> f (ctx a) Source #

provide' :: forall {k} (tag :: k) i b a ctx f. SendHOE (TagH (Provider' ctx i b) tag) f => i -> ((forall x. f x -> b x) -> b a) -> f (ctx a) Source #

provide'' :: forall {k} (key :: k) i b a ctx f. SendHOEBy key (Provider' ctx i b) f => i -> ((forall x. f x -> b x) -> b a) -> f (ctx a) Source #

data ProviderKey (ctx :: k) (i :: k1) Source #

type Provider (ctx :: Type -> Type) i (b :: Type -> Type) = ProviderKey ctx i ##> Provider' ctx i b Source #

(.!) :: forall i f a b. (SendHOEBy (ProviderKey Identity i) (Provider' Identity i b) f, Functor f) => i -> ((f ~> b) -> b a) -> f a infix 2 Source #

(..!) :: forall ctx i f a b. SendHOEBy (ProviderKey ctx i) (Provider' ctx i b) f => i -> ((f ~> b) -> b a) -> f (ctx a) infix 2 Source #