Copyright | (c) 2014 Chris Allen, Edward Kmett |
---|---|
License | BSD-style |
Maintainer | ekmett@gmail.com |
Stability | provisional |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell98 |
Monoidal Validation
sibling to Either
.
- 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)
Documentation
data Validation e a Source
Validation
is Either
with a Left that is a Monoid
Bitraversable Validation | |
Bifunctor Validation | |
Bifoldable Validation | |
(Semigroup e, Monoid e) => Alternative (Validation e) | |
Functor (Validation e) | |
Semigroup e => Applicative (Validation e) | |
Foldable (Validation e) | |
Traversable (Validation e) | |
Alt (Validation e) | |
(Eq e, Eq a) => Eq (Validation e a) | |
(Ord e, Ord a) => Ord (Validation e a) | |
(Show e, Show a) => Show (Validation e a) | |
Monoid e => Monoid (Validation e a) | |
Semigroup e => Semigroup (Validation e a) |
_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