validation

A data-type like Either but with an accumulating Applicative https://github.com/qfpl/validation

LTS Haskell 12.6:1
Stackage Nightly 2018-08-17:1
Latest on Hackage:1

See all snapshots validation appears in

BSD3 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ɐɥ>

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

Changes

1

* Rename `AccValidation` to `Validation`

0.6.3

* Add `Generic` and `NFData` instances
* Make AccValidation Apply and Applicative lazier

0.6.2

* Add `bindValidation` and `validationed`

0.6.1

* Add validate, validationnel, fromEither, liftError, validation, toEither, orElse, valueOr, ensure, codiagonal, revalidate

0.6.0

* Delete `Validation`, `ValidationB`, `ValidationT`, `Validation'`
* Remove `_Validation` member from `Validate` class

0.5.5

* Raise upper bounds on base.
* Include nix build.

0.5.4

* remove redundant constraints.
* add instance `Validate` for `ValidationB Identity`.

0.5.3

* Update `transformers` dependency to work with GHC8.

0.5.2

* Remove LANGUAGE Safe because won't build against lens-4.13 or higher otherwise.

0.5.1

* Update documentation

0.5.0

* Export the `ValidationB` (formerly `ValidationTB`) data type.
* Renamed `ValidationTB` to `ValidationB`.
* Add upper-bounds on some dependencies.
* Move repository to https://github.com/NICTA/validation.
* Add README.
* Update copyright notice for 2015.

0.4.3

* Rename `ValidationT` to `ValidationTB`
* Introduce `ValidationT` with `MonadTrans` instance

0.4.2

* Export constructors on `AccValidation` and `Validation`.

0.4.1

* Remove `Alternative` instances. They are obscene.
* INLINE pragmas

0.4.0

* Change the premise of the `Validate` type-class to more strongly reflect the isomorphism to Either.
* The `_Failure` and `_Success` prisms are now derived.
* Lots more examples

0.3.0

A restructuring of 0.2.x where:

* Tests updated to use doctest
* Update API to use Prism and Iso (Control.Lens)
* Rename package Validation (deprecated) to validation

0.3.1

Use Safe Haskell pragma

0.3.2

Implement Validate on Either

0.3.3

Provide Isos between (ValidationT Identity) and other data types.

0.3.4

Loosen the type of the Isos for polymorphic update.

comments powered byDisqus