validation

A data-type like Either but with an accumulating Applicative

https://github.com/qfpl/validation

Version on this page:1.1.2
LTS Haskell 22.41:1.1.3@rev:1
Stackage Nightly 2024-11-12: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.2@sha256:5e7c3c13ee0efaa5df4aeb6d86a4eae3814a5fbc2e08c5530d2848d73be631e5,3586

Module documentation for 1.1.2

Used by 1 package in nightly-2022-01-19(full list with versions):

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."