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