A data-type like Either but with an accumulating Applicative

Version on this page:1.1.1
LTS Haskell 22.29:1.1.3@rev:1
Stackage Nightly 2024-07-19: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.1.1@sha256:3e76a5e7ee032b130275a77ec9821b6a7db99dc08d416fa45c3d16706c03dc5f,3629

Module documentation for 1.1.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."