https://github.com/ocramz/validation-micro
Small validation library based on Applicative
https://github.com/ocramz/validation-micro
applicative-functors validation
Last synced: over 1 year ago
JSON representation
Small validation library based on Applicative
- Host: GitHub
- URL: https://github.com/ocramz/validation-micro
- Owner: ocramz
- License: other
- Created: 2023-06-18T10:57:42.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-18T11:59:51.000Z (about 3 years ago)
- Last Synced: 2025-03-02T05:43:45.480Z (over 1 year ago)
- Topics: applicative-functors, validation
- Language: Haskell
- Homepage:
- Size: 14.6 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# validation-micro
[](https://github.com/ocramz/validation-micro/actions/workflows/CI.yml)
[](https://hackage.haskell.org/package/validation-micro)
[](https://opensource.org/licenses/BSD-3-Clause)
Lightweight pure data validation based on `Applicative` .
`validation-micro` is built around the following data type:
```haskell
data Validation e a
= Failure e
| Success a
```
This data type is similar to `Either` but allows accumulating all
errors instead of short-circuiting on the first one.
## Comparison with other packages
`validation-micro` is not the only package that provides the `Validation` data type.
Here are some differences and commonalities to other validation packages:
+ **Lightweight**. `validation-micro` depends only on `base` and
`deepseq`, which make it fast to build.
So adding validation capabilities to your
library or application doesn't contribute much to your dependency
footprint.
+ **Future-proof**. Both `base` and `deepseq` are GHC boot packages, which means that `validation-micro` can be imported as long as GHC can run.
+ **No Selective instance**. This means you cannot choose which validation to use based on the value. On the other hand, we don't need to depend on `selective` which is a somewhat experimental package.
+ **No Monad instance** - but there is a `bindValidation` utility function which behaves like `(>>=)`.
## Copyright
Copyright: (c) 2014 Chris Allen, Edward Kmett
(c) 2018-2023 Kowainik
(c) 2023 Marco Zocca
License: BSD3
Maintainer: oss@unfoldml.com