@hackage validation1
A data-type like Either but with an accumulating Applicative
Categories
License
BSD-3-Clause
Maintainer
Tony Morris <ʇǝu˙sıɹɹoɯʇ@ןןǝʞsɐɥ> <dibblego>, Nick Partridge <nkpart>, Queensland Functional Programming Lab <oᴉ˙ldɟb@llǝʞsɐɥ>
Links
Versions
Installation
Tested Compilers
Dependencies (7)
- base >=4.5 && <5
- bifunctors >=5.1 && <6
- deepseq >=1.2 && <1.5
- ghc-prim ==0.2.0.0
- lens >=4 && <5
- semigroupoids >=5 && <6 Show all…
Dependents (28)
@hackage/sv, @hackage/railroad, @hackage/sv-core, @cardano/ouroboros-consensus-cardano, @hackage/imprevu, @hackage/strongweak, Show all…
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."