Hoogle Search
Within LTS Haskell 24.24 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
opt-env-conf OptEnvConf.Validation No documentation available.
-
reorder-expression Expression.Reorder Validation applicative, similar to Either but aggregates errors.
-
valida Valida Like Either, but accumulates failures upon applicative composition.
-
valida-base Valida Like Either, but accumulates failures upon applicative composition.
-
A data type similar to Data.Either that accumulates failures.
-
validation Data.Validation A Validation is either a value of the type err or a, similar to Either. However, the Applicative instance for Validation accumulates errors using a Semigroup on err. In contrast, the Applicative for Either returns only the first error. A consequence of this is that Validation has no Bind or Monad instance. This is because such an instance would violate the law that a Monad's ap must equal the Applicative's <*> An example of typical usage can be found here.
module Network.Wai.SAML2.
Validation Functions to process and validate SAML2 respones.
module Data.ErrorOr.
Validation Utilities for data validation
validation :: (e -> x) -> (a -> x) -> Validation e a -> xvalidation-selective Validation Transforms the value of the given Validation into x using provided functions that can transform Failure and Success value into the resulting type respectively.
>>> let myValidation = validation (<> " world!") (show . (* 10)) >>> myValidation (Success 100) "1000" >>> myValidation (Failure "Hello") "Hello world!"
validation :: (e -> c) -> (a -> c) -> Validation e a -> cvalida Valida Case analysis for Validation, i.e catamorphism. In case of 'Failure e', apply the first function to e; in case of 'Success a', apply the second function to a. This is a more generalized version of the bifoldMap implementation.
Examples
>>> validation (const Nothing) Just (Success 'c' :: Validation String Char) Just 'c' >>> validation (const Nothing) Just (Failure "error" :: Validation String Char) Nothing