| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Bluefin.Internal.Exception
Synopsis
- data HandledKey ret = forall ex. MkHandledKey !(Exception ex) (ex -> ret)
- checkHandledKey :: HandledKey ret -> InFlight -> Maybe ret
- runBodyWithHandlers :: ([HandledKey (r -> Eff es a)], BracketBase b r a es) -> Eff es a
- newtype MakeExceptions r a h es = MkMakeExceptions (Eff es (HandlerUnwrapped r a h es))
- data HandlerUnwrapped r a h es = MkHandlerUnwrapped [HandledKey (r -> Eff es a)] (forall b. (forall e. h e -> Eff (e :& es) b) -> Eff es b)
- pureHandlerUnwrapped :: h e -> HandlerUnwrapped r a h e
- pureMakeExceptions :: h e -> MakeExceptions r a h e
- apHandlerUnwrapped :: (Handle h1, Handle h2) => HandlerUnwrapped r a (h1 :~> h2) e -> HandlerUnwrapped r a h1 e -> HandlerUnwrapped r a h2 e
- apMakeExceptions :: (Handle h1, Handle h2) => MakeExceptions r a (h1 :~> h2) e -> MakeExceptions r a h1 e -> MakeExceptions r a h2 e
- fmapHandlerUnwrapped :: (Handle h1, Handle h2) => (h1 :~> h2) e -> HandlerUnwrapped r a h1 e -> HandlerUnwrapped r a h2 e
- fmapMakeExceptions :: (Handle h1, Handle h2) => (h1 :~> h2) e -> MakeExceptions r a h1 e -> MakeExceptions r a h2 e
- catchWithResource :: forall ex r a es. (r -> ex -> Eff es a) -> MakeExceptions r a (Exception ex) es
- generalBracket :: forall r b h a es. Handle h => Eff es r -> MakeExceptions r a h es -> (r -> b -> Eff es a) -> (r -> Eff es ()) -> (forall e. h e -> r -> Eff (e :& es) b) -> Eff es a
- data BracketBase bodyRes r a es = MkBracketBase {
- acquire :: !(Eff es r)
- normalRelease :: !(r -> bodyRes -> Eff es a)
- unknownExceptionRelease :: !(r -> Eff es ())
- body :: !(r -> Eff es bodyRes)
- useImplBracketBase :: e <: es => BracketBase b r a e -> BracketBase b r a es
Documentation
data HandledKey ret Source #
Constructors
| forall ex. MkHandledKey !(Exception ex) (ex -> ret) |
Instances
| Functor HandledKey Source # | |
Defined in Bluefin.Internal.Exception | |
checkHandledKey :: HandledKey ret -> InFlight -> Maybe ret Source #
runBodyWithHandlers :: ([HandledKey (r -> Eff es a)], BracketBase b r a es) -> Eff es a Source #
newtype MakeExceptions r a h es Source #
To create a MakeExceptions use catchWithResource and the
Applicative-like functions that produce and combine them.
Constructors
| MkMakeExceptions (Eff es (HandlerUnwrapped r a h es)) |
Instances
| (Handle h, e <: es) => OneWayCoercible (MakeExceptions r a h e :: Type) (MakeExceptions r a h es :: Type) Source # | |
Defined in Bluefin.Internal.Exception Methods oneWayCoercibleImpl :: OneWayCoercibleD (MakeExceptions r a h e) (MakeExceptions r a h es) Source # | |
| Handle h => Handle (MakeExceptions r a h) Source # | |
Defined in Bluefin.Internal.Exception Methods handleImpl :: HandleD (MakeExceptions r a h) Source # | |
data HandlerUnwrapped r a h es Source #
Constructors
| MkHandlerUnwrapped [HandledKey (r -> Eff es a)] (forall b. (forall e. h e -> Eff (e :& es) b) -> Eff es b) |
Instances
| (Handle h, e <: es) => OneWayCoercible (HandlerUnwrapped r a h e :: Type) (HandlerUnwrapped r a h es :: Type) Source # | |
Defined in Bluefin.Internal.Exception Methods oneWayCoercibleImpl :: OneWayCoercibleD (HandlerUnwrapped r a h e) (HandlerUnwrapped r a h es) Source # | |
| Handle h => Handle (HandlerUnwrapped r a h) Source # | |
Defined in Bluefin.Internal.Exception Methods handleImpl :: HandleD (HandlerUnwrapped r a h) Source # | |
pureHandlerUnwrapped :: h e -> HandlerUnwrapped r a h e Source #
apHandlerUnwrapped :: (Handle h1, Handle h2) => HandlerUnwrapped r a (h1 :~> h2) e -> HandlerUnwrapped r a h1 e -> HandlerUnwrapped r a h2 e Source #
Arguments
| :: (Handle h1, Handle h2) | |
| => MakeExceptions r a (h1 :~> h2) e | |
| -> MakeExceptions r a h1 e | |
| -> MakeExceptions r a h2 e | ͘ |
fmapHandlerUnwrapped :: (Handle h1, Handle h2) => (h1 :~> h2) e -> HandlerUnwrapped r a h1 e -> HandlerUnwrapped r a h2 e Source #
Arguments
| :: (Handle h1, Handle h2) | |
| => (h1 :~> h2) e | |
| -> MakeExceptions r a h1 e | |
| -> MakeExceptions r a h2 e | ͘ |
Analogous to fmap and <$>
Arguments
| :: forall ex r a es. (r -> ex -> Eff es a) | |
| -> MakeExceptions r a (Exception ex) es | ͘ |
Arguments
| :: forall r b h a es. Handle h | |
| => Eff es r | Acquire the resource |
| -> MakeExceptions r a h es | Construct the handle |
| -> (r -> b -> Eff es a) | To run on normal termination |
| -> (r -> Eff es ()) | To run on unknown exception |
| -> (forall e. h e -> r -> Eff (e :& es) b) | Body |
| -> Eff es a |
A generalization of bracket that enables distinguishing
exceptional from normal exit.
r- The type of the resource
b- The result type of the body
a- The type of the overall result
h- The handle of exceptions available in the body
data BracketBase bodyRes r a es Source #
Constructors
| MkBracketBase | |
Fields
| |
Instances
| e <: es => OneWayCoercible (BracketBase bodyRes r a e :: Type) (BracketBase bodyRes r a es :: Type) Source # | |
Defined in Bluefin.Internal.Exception Methods oneWayCoercibleImpl :: OneWayCoercibleD (BracketBase bodyRes r a e) (BracketBase bodyRes r a es) Source # | |
| Generic (BracketBase bodyRes r a es) Source # | |
Defined in Bluefin.Internal.Exception Associated Types type Rep (BracketBase bodyRes r a es) :: Type -> Type Methods from :: BracketBase bodyRes r a es -> Rep (BracketBase bodyRes r a es) x to :: Rep (BracketBase bodyRes r a es) x -> BracketBase bodyRes r a es | |
| type Rep (BracketBase bodyRes r a es) Source # | |
Defined in Bluefin.Internal.Exception type Rep (BracketBase bodyRes r a es) = D1 ('MetaData "BracketBase" "Bluefin.Internal.Exception" "bluefin-internal-0.8.0.0-EmnzG2oI8mEK2tbAfQmSmp" 'False) (C1 ('MetaCons "MkBracketBase" 'PrefixI 'True) ((S1 ('MetaSel ('Just "acquire") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Eff es r)) :*: S1 ('MetaSel ('Just "normalRelease") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (r -> bodyRes -> Eff es a))) :*: (S1 ('MetaSel ('Just "unknownExceptionRelease") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (r -> Eff es ())) :*: S1 ('MetaSel ('Just "body") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (r -> Eff es bodyRes))))) | |
useImplBracketBase :: e <: es => BracketBase b r a e -> BracketBase b r a es Source #