validation

A data-type like Either but with an accumulating Applicative

https://github.com/qfpl/validation

Version on this page:0.6.2
LTS Haskell 22.13:1.1.3
Stackage Nightly 2023-12-26:1.1.3
Latest on Hackage:1.1.3

See all snapshots validation appears in

BSD-3-Clause licensed by Tony Morris <ʇǝu˙sıɹɹoɯʇ@ןןǝʞsɐɥ> <dibblego>, Nick Partridge <nkpart>
Maintained by Tony Morris <ʇǝu˙sıɹɹoɯʇ@ןןǝʞsɐɥ> <dibblego>, Nick Partridge <nkpart>, Queensland Functional Programming Lab <oᴉ˙ldɟb@llǝʞsɐɥ>
This version can be pinned in stack with:validation-0.6.2@sha256:4684376e351b16be2bfc49c178d466523e8e1eae0ffaf62224d6c5d0925114d5,3587

Module documentation for 0.6.2

A data-type like Either but with differing properties and type-class instances.

Library support is provided for this different representation, include lens-related functions for converting between each and abstracting over their similarities.

  • AccValidation

The AccValidation data type is isomorphic to Either, but has an instance of Applicative that accumulates on the error side. That is to say, if two (or more) errors are encountered, they are appended using a Semigroup operation.

As a consequence of this Applicative instance, there is no corresponding Bind or Monad instance. AccValidation is an example of, "An applicative functor that is not a monad."