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.

  1. data Validation e a

    opt-env-conf OptEnvConf.Validation

    No documentation available.

  2. data Validation e a

    reorder-expression Expression.Reorder

    Validation applicative, similar to Either but aggregates errors.

  3. data Validation e a

    valida Valida

    Like Either, but accumulates failures upon applicative composition.

  4. data Validation e a

    valida-base Valida

    Like Either, but accumulates failures upon applicative composition.

  5. module Data.Validation

    A data type similar to Data.Either that accumulates failures.

  6. data Validation err a

    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.

  7. module Network.Wai.SAML2.Validation

    Functions to process and validate SAML2 respones.

  8. module Data.ErrorOr.Validation

    Utilities for data validation

  9. validation :: (e -> x) -> (a -> x) -> Validation e a -> x

    validation-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!"
    

  10. validation :: (e -> c) -> (a -> c) -> Validation e a -> c

    valida 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
    

Page 4 of many | Previous | Next