validation

A data-type like Either but with an accumulating Applicative

https://github.com/qfpl/validation

Version on this page:1@rev:1
LTS Haskell 22.43:1.1.3@rev:1
Stackage Nightly 2024-11-30:1.1.3@rev:1
Latest on Hackage:1.1.3@rev:1

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-1@sha256:0396b87a0f96af33799050aed04e61df24c6ac1a3550626090017d6b95252ff4,3658

Module documentation for 1

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.

  • Validation

The Validation 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. Validation is an example of, "An applicative functor that is not a monad."