Safe Haskell | None |
---|---|
Language | Haskell2010 |
- nothing :: Monad m => m ()
- maybe2bool :: Maybe a -> Bool
- either2maybe :: Either e a -> Maybe a
- either2bool :: Either e a -> Bool
- failed :: MonadThrow m => String -> m a
- maybe2throw :: (a -> Maybe b) -> forall m. MonadThrow m => a -> m b
- list2throw :: (a -> [b]) -> forall m. MonadThrow m => a -> m b
- either2throw :: (a -> Either SomeException b) -> forall m. MonadThrow m => a -> m b
- throw2maybe :: (forall m. MonadThrow m => a -> m b) -> a -> Maybe b
- throw2either :: (forall m. MonadThrow m => a -> m b) -> a -> Either SomeException b
- throw2list :: (forall m. MonadThrow m => a -> m b) -> a -> [b]
- totalizeFunction :: (NFData b, MonadThrow m) => (a -> b) -> a -> m b
- defaultPartialityHandlers :: MonadThrow m => [Handler (m a)]
- spoonWith :: (NFData a, MonadThrow m) => [Handler (m a)] -> a -> m a
- showsPrecWith :: Show b => String -> (a -> b) -> Int -> a -> ShowS
- module Control.DeepSeq
- module Data.Semigroup
- module GHC.Generics
- module Data.Data
- module Control.Arrow
- module Data.Function
- module Data.List
- module Data.Foldable
Documentation
maybe2bool :: Maybe a -> Bool Source
either2maybe :: Either e a -> Maybe a Source
either2bool :: Either e a -> Bool Source
maybe2throw :: (a -> Maybe b) -> forall m. MonadThrow m => a -> m b Source
generalize a function that fails with Nothing
.
list2throw :: (a -> [b]) -> forall m. MonadThrow m => a -> m b Source
generalize a function that fails with []
.
either2throw :: (a -> Either SomeException b) -> forall m. MonadThrow m => a -> m b Source
generalize a function that fails with Left
.
throw2maybe :: (forall m. MonadThrow m => a -> m b) -> a -> Maybe b Source
specialization
throw2either :: (forall m. MonadThrow m => a -> m b) -> a -> Either SomeException b Source
specialization
throw2list :: (forall m. MonadThrow m => a -> m b) -> a -> [b] Source
specialization
totalizeFunction :: (NFData b, MonadThrow m) => (a -> b) -> a -> m b Source
makes an *unsafely*-partial function (i.e. a function that throws exceptions or that has inexhaustive pattern matching) into a *safely*-partial function (i.e. that explicitly returns in a monad that supports failure).
defaultPartialityHandlers :: MonadThrow m => [Handler (m a)] Source
handles the following exceptions:
spoonWith :: (NFData a, MonadThrow m) => [Handler (m a)] -> a -> m a Source
showsPrecWith :: Show b => String -> (a -> b) -> Int -> a -> ShowS Source
the eliminator as a function and the introducer as a string
helper for declaring Show instances of datatypes without
visible constructors (like Map
which is shown as a list).
module Control.DeepSeq
module Data.Semigroup
module GHC.Generics
module Data.Data
module Control.Arrow
module Data.Function
module Data.List
module Data.Foldable