Module
Polyform.Validation 
- Package
 - purescript-polyform
 - Repository
 - paluh/purescript-polyform
 
#V Source
data V e aConstructors
Instances
Functor (V e)Bifunctor V(Semigroup e) => Apply (V e)(Eq e, Eq a) => Eq (V e a)(Ord e, Ord a) => Ord (V e a)(Show e, Show a) => Show (V e a)(Monoid e) => Applicative (V e)(Semigroup e) => Alt (V e)(Semigroup err, Semigroup a) => Semigroup (V err a)Defaul
Semigroupinstance appends valid and invalid parts of ourV.(Monoid e, Monoid a) => Monoid (V e a)
#Validation Source
newtype Validation m e a bConstructors
Validation (a -> m (V e b))
Instances
Newtype (Validation m e a b) _(Functor m) => Functor (Validation m e a)(Semigroup e, Monad m) => Apply (Validation m e a)(Monoid e, Monad m) => Applicative (Validation m e a)(Monoid e, Monad m) => Alt (Validation m e a)(Semigroup (m (V e b))) => Semigroup (Validation m e a b)(Applicative m, Monoid e, Monoid b, Semigroup (m (V e b))) => Monoid (Validation m e a b)(Monad m, Semigroup e) => Semigroupoid (Validation m e)(Monad m, Monoid e) => Category (Validation m e)(Monad m, Monoid e) => Profunctor (Validation m e)(Monad m, Monoid e) => Choice (Validation m e)
#runValidation Source
runValidation :: forall m e b a. Validation m e a b -> (a -> m (V e b))#hoistFnV Source
hoistFnV :: forall m b e a. Monad m => Monoid e => (a -> V e b) -> Validation m e a b#hoistFnMV Source
hoistFnMV :: forall m b e a. Monad m => Monoid e => (a -> m (V e b)) -> Validation m e a b#BifunctorValidation Source
newtype BifunctorValidation m a e bProvides access to validation result
so you can bimap over e and b type in resulting V e b.
Constructors
BifunctorValidation (Validation m e a b)
Instances
Newtype (BifunctorValidation m a e b) _(Monad m) => Bifunctor (BifunctorValidation m a)
#bimapValidation Source
bimapValidation :: forall m e' e b' b a. Monad m => (e -> e') -> (b -> b') -> Validation m e a b -> Validation m e' a b'- Modules
 - Polyform.
Field  - Polyform.
Field. Generic  - Polyform.
Field. Generic. Option  - Polyform.
Field. Html5  - Polyform.
Field. Validation. Combinators  - Polyform.
Form. Component  - Polyform.
Input. Foreign  - Polyform.
Input. Http  - Polyform.
Input. Interpret  - Polyform.
Input. Interpret. Http  - Polyform.
Input. Interpret. Record  - Polyform.
Input. Interpret. Validation  - Polyform.
Validation  - Polyform.
Validation. Par  
This instance uses first valid value and accumulates our semigroup.
pure (Valid e1 a1) <|> pure (Invalid e2) = Valid (e1 <> e2) a1 pure (Valid e1 a1) <|> pure (Valid e2 a2) = Valid (e1 <> e2) a1
If you need opposite strategy just use apply which "prefers" invalid results:
pure (Valid e1 a1) > pure (Invalid e2) = Invalid (e1 <> e2) pure (Invalid e1) > pure (Valid e2 a2) = Invalid (e1 <> e2) pure (Valid e1 a1) *> pure (Valid e2 a2) = Valid e2 a2
If you find not accumulative instances useful please provide a PR with related tests.