Copyright | (c) 2014 Chris Allen Edward Kmett |
---|---|
License | BSD-style |
Maintainer | ekmett@gmail.com |
Stability | provisional |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Monoidal Validation
sibling to Either
.
Synopsis
- data Validation e a
- _Success :: Prism (Validation c a) (Validation c b) a b
- _Failure :: Prism (Validation a c) (Validation b c) a b
- eitherToValidation :: Either e a -> Validation e a
- validationToEither :: Validation e a -> Either e a
- _Validation :: Iso (Validation e a) (Validation g b) (Either e a) (Either g b)
- vap :: Semigroup m => Either m (a -> b) -> Either m a -> Either m b
- ealt :: Validation e a -> Validation e a -> Validation e a
- vapm :: Monoid m => Either m (a -> b) -> Either m a -> Either m b
- apm :: Monoid m => Validation m (a -> b) -> Validation m a -> Validation m b
Documentation
data Validation e a Source #
Validation
is Either
with a Left that is a Monoid
Instances
_Success :: Prism (Validation c a) (Validation c b) a b Source #
_Failure :: Prism (Validation a c) (Validation b c) a b Source #
eitherToValidation :: Either e a -> Validation e a Source #
validationToEither :: Validation e a -> Either e a Source #
_Validation :: Iso (Validation e a) (Validation g b) (Either e a) (Either g b) Source #
Validation
is isomorphic to Either
ealt :: Validation e a -> Validation e a -> Validation e a Source #
apm :: Monoid m => Validation m (a -> b) -> Validation m a -> Validation m b Source #