Safe Haskell | None |
---|---|
Language | Haskell2010 |
Error handling in B9 via extensible effects.
B9 wraps errors in SomeException
.
Since: 0.5.64
Synopsis
- throwSomeException :: (Member ExcB9 e, Exception x) => x -> Eff e a
- throwSomeException_ :: (Member ExcB9 e, Exception x) => x -> Eff e ()
- throwB9Error :: Member ExcB9 e => String -> Eff e a
- throwB9Error_ :: Member ExcB9 e => String -> Eff e ()
- errorOnException :: Lifted IO e => Eff (ExcB9 ': e) a -> Eff e a
- type ExcB9 = Exc SomeException
- type WithIoExceptions e = SetMember Exc (Exc SomeException) e
- runExcB9 :: Eff (ExcB9 ': e) a -> Eff e (Either SomeException a)
- newtype B9Error = MkB9Error String
- fromB9Error :: B9Error -> String
- catchB9Error :: Member ExcB9 e => Eff e a -> (SomeException -> Eff e a) -> Eff e a
- catchB9ErrorAsEither :: Member ExcB9 e => Eff e a -> Eff e (Either SomeException a)
- finallyB9 :: Member ExcB9 e => Eff e a -> Eff e () -> Eff e a
Documentation
throwSomeException :: (Member ExcB9 e, Exception x) => x -> Eff e a Source #
SomeException
wrapped into Exc
ecption Eff
ects
Since: 0.5.64
throwSomeException_ :: (Member ExcB9 e, Exception x) => x -> Eff e () Source #
SomeException
wrapped into Exc
ecption Eff
ects
Since: 0.5.64
throwB9Error :: Member ExcB9 e => String -> Eff e a Source #
SomeException
wrapped into Exc
ecption Eff
ects
Since: 0.5.64
throwB9Error_ :: Member ExcB9 e => String -> Eff e () Source #
SomeException
wrapped into Exc
ecption Eff
ects
Since: 0.5.64
type ExcB9 = Exc SomeException Source #
The exception effect used in most places in B9.
This is Exc
specialized with SomeException
.
Since: 0.5.64
type WithIoExceptions e = SetMember Exc (Exc SomeException) e Source #
Constraint alias for the exception effect that allows to
throw SomeException
.
Since: 1.0.0
This is a simple runtime exception to indicate that B9 code encountered some exceptional event.
Since: 0.5.64
Instances
Show B9Error Source # | |
IsString B9Error Source # | |
Defined in B9.B9Error fromString :: String -> B9Error # | |
Exception B9Error Source # | |
Defined in B9.B9Error toException :: B9Error -> SomeException # fromException :: SomeException -> Maybe B9Error # displayException :: B9Error -> String # |
fromB9Error :: B9Error -> String Source #
catchB9Error :: Member ExcB9 e => Eff e a -> (SomeException -> Eff e a) -> Eff e a Source #
Catch exceptions.
Since: 0.5.64
catchB9ErrorAsEither :: Member ExcB9 e => Eff e a -> Eff e (Either SomeException a) Source #
Catch exceptions and return them via Either
.
Since: 0.5.64