| Copyright | (c) 2019 Yann Herklotz Grave |
|---|---|
| License | GPL-3 |
| Maintainer | yann [at] yannherklotz [dot] com |
| Stability | experimental |
| Portability | POSIX |
| Safe Haskell | None |
| Language | Haskell2010 |
Verismith.Result
Description
Result monadic type. This is nearly equivalent to the transformers Error type,
but to have more control this is reimplemented with the instances that are
needed in Verismith.
Synopsis
- data Result a b
- newtype ResultT a (m :: Type -> Type) b = ResultT {
- runResultT :: m (Result a b)
- justPass :: Result a b -> Maybe b
- justFail :: Result a b -> Maybe a
- (<?>) :: forall (m :: Type -> Type) a b. (Monad m, Monoid a) => ResultT a m b -> a -> ResultT a m b
- annotate :: forall (m :: Type -> Type) a b. (Monad m, Monoid a) => a -> ResultT a m b -> ResultT a m b
Documentation
Result type which is equivalent to Either or Error. This is
reimplemented so that there is full control over the Monad definition and
definition of a Monad transformer ResultT.
Instances
| Bifunctor Result Source # | |
| Applicative (Result a) Source # | |
| Functor (Result a) Source # | |
| Monad (Result a) Source # | |
| MonadBase (Result a) (Result a) Source # | |
Defined in Verismith.Result | |
| Monoid b => Monoid (Result a b) Source # | |
| Semigroup (Result a b) Source # | |
| (Show a, Show b) => Show (Result a b) Source # | |
| (Eq a, Eq b) => Eq (Result a b) Source # | |
newtype ResultT a (m :: Type -> Type) b Source #
The transformer for the Result type. This
Constructors
| ResultT | |
Fields
| |
Instances
| MonadBaseControl IO m => MonadBaseControl IO (ResultT a m) Source # | |
| MonadBase b m => MonadBase b (ResultT a m) Source # | |
Defined in Verismith.Result | |
| MonadTransControl (ResultT a) Source # | |
| MonadTrans (ResultT e) Source # | |
Defined in Verismith.Result | |
| MonadIO m => MonadIO (ResultT a m) Source # | |
Defined in Verismith.Result | |
| Monad m => Applicative (ResultT a m) Source # | |
Defined in Verismith.Result | |
| Functor f => Functor (ResultT a f) Source # | |
| Monad m => Monad (ResultT a m) Source # | |
| (MonadSh m, Monoid a) => MonadSh (ResultT a m) Source # | |
Defined in Verismith.Result | |
| MonadShControl m => MonadShControl (ResultT a m) Source # | |
| type StT (ResultT a) b Source # | |
Defined in Verismith.Result | |
| newtype ShM (ResultT a m) b Source # | |
Defined in Verismith.Result | |
| type StM (ResultT a m) b Source # | |
Defined in Verismith.Result | |