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

Data.Effect.Unlift

Description

Realizes unliftio in the form of higher-order effects.

Documentation

withRunInIO :: forall (es :: [Effect]) (ff :: (Type -> Type) -> Type -> Type) a (c :: (Type -> Type) -> Constraint). (UnliftIO :> es, Free c ff) => ((Eff ff es ~> IO) -> IO a) -> Eff ff es a Source #

withRunInBase :: forall b a f (es :: [Effect]) (ff :: (Type -> Type) -> Type -> Type) (c :: (Type -> Type) -> Constraint). (Free c ff, f ~ Eff ff es, UnliftBase b :> es) => ((forall x. f x -> b x) -> b a) -> f a Source #

pattern WithRunInIO :: ((f ~> IO) -> IO a) -> UnliftIO f a Source #

runUnliftBase :: forall b (ff :: (Type -> Type) -> Type -> Type) a (c :: (Type -> Type) -> Constraint). (c b, Free c ff) => Eff ff '[UnliftBase b, Emb b] a -> b a Source #

runUnliftIO :: forall m (c :: (Type -> Type) -> Constraint) (ff :: (Type -> Type) -> Type -> Type) a. (MonadUnliftIO m, Free c ff, c m) => Eff ff '[UnliftIO, Emb m] a -> m a Source #

withRunInBase' :: forall {k} (key :: k) b a f (es :: [Effect]) (ff :: (Type -> Type) -> Type -> Type) (c :: (Type -> Type) -> Constraint). (Free c ff, f ~ Eff ff es, Has key (UnliftBase b) es) => ((forall x. f x -> b x) -> b a) -> f a Source #

withRunInBase'' :: forall {k} (tag :: k) b a f (es :: [Effect]) (ff :: (Type -> Type) -> Type -> Type) (c :: (Type -> Type) -> Constraint). (Free c ff, f ~ Eff ff es, Tagged tag (UnliftBase b) :> es) => ((forall x. f x -> b x) -> b a) -> f a Source #

withRunInBase'_ :: forall b a f (es :: [Effect]) (ff :: (Type -> Type) -> Type -> Type) (c :: (Type -> Type) -> Constraint). (Free c ff, f ~ Eff ff es, In (UnliftBase b) es) => ((forall x. f x -> b x) -> b a) -> f a Source #

data UnliftBase (b :: Type -> Type) (f :: Type -> Type) a where #

Constructors

WithRunInBase :: forall (f :: Type -> Type) (b :: Type -> Type) a. ((forall x. f x -> b x) -> b a) -> UnliftBase b f a 

Instances

Instances details
HFunctor (UnliftBase b) 
Instance details

Defined in Data.Effect

Methods

hfmap :: (forall x. f x -> g x) -> UnliftBase b f a -> UnliftBase b g a #

type FormOf (UnliftBase b) 
Instance details

Defined in Data.Effect

type LabelOf (UnliftBase b) 
Instance details

Defined in Data.Effect

type OrderOf (UnliftBase b) 
Instance details

Defined in Data.Effect