validations-0.1.0.2: A nice way to define field validations in Haskell.

Safe HaskellSafe-Inferred
LanguageHaskell2010

Validations.Validation

Synopsis

Documentation

newtype Validation errors monad state newState Source

Constructors

Validation 

Fields

runValidation :: state -> monad (newState, errors)
 

Instances

(Monad m, Monoid e) => Category * (Validation e m) 

validation :: Monad m => Lens b s -> a -> Validator ek ev m a b -> Validation [(ek, ev)] m s s Source

validation_ :: Monad m => a -> Validator ek ev m a b -> Validation [(ek, ev)] m s s Source

Same as "validation", but throws away validator result. This is useful for the side effects from a monadic validator.

composeValidation :: (Monad m, Monoid e) => Validation e m s t -> Validation e m t u -> Validation e m s u Source

composeValidation' :: Monad m => (e -> f -> g) -> Validation e m s t -> Validation f m t u -> Validation g m s u Source