Copyright | (c) 2023-2025 Sayo contributors |
---|---|
License | MPL-2.0 (see the file LICENSE) |
Maintainer | ymdfield@outlook.jp |
Safe Haskell | None |
Language | GHC2021 |
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 #
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
HFunctor (UnliftBase b) | |
Defined in Data.Effect Methods hfmap :: (forall x. f x -> g x) -> UnliftBase b f a -> UnliftBase b g a # | |
type FormOf (UnliftBase b) | |
Defined in Data.Effect | |
type LabelOf (UnliftBase b) | |
Defined in Data.Effect | |
type OrderOf (UnliftBase b) | |
Defined in Data.Effect |
type UnliftIO = UnliftBase IO #