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.Except

Description

 

Documentation

data Throw e (a :: Type) where Source #

Constructors

Throw :: e -> Throw e a 

data Catch e f (a :: Type) where Source #

Constructors

Catch :: f a -> (e -> f a) -> Catch e f a 

Instances

Instances details
() => HFunctor (Catch e) Source # 
Instance details

Defined in Data.Effect.Except

Methods

hfmap :: forall (f :: Type -> Type) (g :: Type -> Type). (f :-> g) -> Catch e f :-> Catch e g #

type LThrow e = LiftIns (Throw e) Source #

catch'' :: forall key (a :: Type) (e :: Type) f. SendSigBy key (Catch e) f => f a -> (e -> f a) -> f a Source #

catch' :: forall tag (a :: Type) (e :: Type) f. SendSig (TagH (Catch e) tag) f => f a -> (e -> f a) -> f a Source #

catch :: forall (a :: Type) (e :: Type) f. SendSig (Catch e) f => f a -> (e -> f a) -> f a Source #

pattern LThrow :: () => (a ~ a, ()) => e -> LiftIns (Throw e) f a Source #

throw'' :: forall key (e :: Type) (a :: Type) f. SendInsBy key (Throw e) f => e -> f a Source #

throw' :: forall tag (e :: Type) (a :: Type) f. SendIns (Tag (Throw e) tag) f => e -> f a Source #

throw :: forall (e :: Type) (a :: Type) f. SendIns (Throw e) f => e -> f a Source #

liftEither :: (Throw e <: f, Applicative f) => Either e a -> f a Source #

joinEither :: (Throw e <: m, Monad m) => m (Either e a) -> m a Source #

joinExcept :: Monad m => Either (m a) a -> m a Source #

exc :: Monad m => m (Either (m a) a) -> m a Source #

withExcept :: (Catch e <<: f, Throw e <: f, Applicative f) => f a -> (e -> f ()) -> f a Source #

onExcept :: forall e f a. (Catch e <<: f, Throw e <: f, Applicative f) => f a -> f () -> f a Source #