failure-0.1.0.1: A simple type class for success/failure computations.
Source code
Contents
Index
Control.Failure
Contents
Type class
Wrapping failures
Convenience
String
failure
Convert
Failure
s into concrete types
Description
Type classes for returning failures.
Synopsis
class
Monad
f =>
Failure
e f
where
failure
:: e -> f v
class
Failure
e f =>
WrapFailure
e f
where
wrapFailure
:: (
forall
eIn.
Exception
eIn => eIn -> e) -> f a -> f a
newtype
StringException
=
StringException
String
failureString
::
Failure
StringException
m =>
String
-> m a
class
Try
f
where
type
Error
f
try
::
Failure
(
Error
f) f' => f a -> f' a
data
NothingException
=
NothingException
data
NullException
=
NullException
Type class
class
Monad
f =>
Failure
e f
where
Source
Methods
failure
:: e -> f v
Source
Instances
Exception
e =>
Failure
e
IO
Failure
e []
Failure
e
Maybe
Wrapping failures
class
Failure
e f =>
WrapFailure
e f
where
Source
Methods
wrapFailure
:: (
forall
eIn.
Exception
eIn => eIn -> e) -> f a -> f a
Source
Wrap the failure value, if any, with the given function. This is useful in particular when you want all the exceptions returned from a certain library to be of a certain type, even if they were generated by a different library.
Instances
Exception
e =>
WrapFailure
e
IO
Convenience
String
failure
newtype
StringException
Source
Constructors
StringException
String
Instances
Show
StringException
Typeable
StringException
Exception
StringException
failureString
::
Failure
StringException
m =>
String
-> m a
Source
Call
failure
with a
String
.
Convert
Failure
s into concrete types
class
Try
f
where
Source
Associated Types
type
Error
f
Source
Methods
try
::
Failure
(
Error
f) f' => f a -> f' a
Source
Instances
Try
[]
Try
Maybe
Try
(
Either
e)
data
NothingException
Source
Constructors
NothingException
Instances
Show
NothingException
Typeable
NothingException
Exception
NothingException
data
NullException
Source
Constructors
NullException
Instances
Show
NullException
Typeable
NullException
Exception
NullException
Produced by
Haddock
version 2.6.0