{"id":13681617,"url":"https://github.com/kowainik/validation-selective","last_synced_at":"2025-04-30T06:31:18.640Z","repository":{"id":38019719,"uuid":"245262974","full_name":"kowainik/validation-selective","owner":"kowainik","description":"💂‍♂️ Lightweight pure validation based on Applicative and Selective functors","archived":false,"fork":false,"pushed_at":"2024-12-23T16:23:11.000Z","size":97,"stargazers_count":67,"open_issues_count":3,"forks_count":10,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-26T05:41:43.706Z","etag":null,"topics":["applicative","functors","haskell","haskell-libraries","selective","validation"],"latest_commit_sha":null,"homepage":"https://kowainik.github.io/projects/validation-selective","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kowainik.png","metadata":{"funding":{"ko_fi":"kowainik","github":["vrom911"]},"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-05T20:38:50.000Z","updated_at":"2025-01-21T13:20:50.000Z","dependencies_parsed_at":"2023-11-06T12:41:43.701Z","dependency_job_id":"f8eade8a-be03-4779-a9fb-bb0969fca58c","html_url":"https://github.com/kowainik/validation-selective","commit_stats":{"total_commits":52,"total_committers":10,"mean_commits":5.2,"dds":0.6346153846153846,"last_synced_commit":"9e9d7fab7b2c7c7c43e13e5aa357fd86c62f6845"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kowainik%2Fvalidation-selective","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kowainik%2Fvalidation-selective/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kowainik%2Fvalidation-selective/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kowainik%2Fvalidation-selective/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kowainik","download_url":"https://codeload.github.com/kowainik/validation-selective/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251654063,"owners_count":21622252,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["applicative","functors","haskell","haskell-libraries","selective","validation"],"created_at":"2024-08-02T13:01:33.110Z","updated_at":"2025-04-30T06:31:18.334Z","avatar_url":"https://github.com/kowainik.png","language":"Haskell","funding_links":["https://ko-fi.com/kowainik","https://github.com/sponsors/vrom911"],"categories":["Haskell"],"sub_categories":[],"readme":"# validation-selective\n\n![Logo](https://user-images.githubusercontent.com/8126674/76859713-c0880200-6851-11ea-8bc1-bb9dee87d44f.png)\n[![GitHub CI](https://github.com/kowainik/validation-selective/workflows/CI/badge.svg)](https://github.com/kowainik/validation-selective/actions)\n\n[![Hackage](https://img.shields.io/hackage/v/validation-selective.svg?logo=haskell)](https://hackage.haskell.org/package/validation-selective)\n[![MPL-2.0 license](https://img.shields.io/badge/license-MPL--2.0-blue.svg)](LICENSE)\n\nLightweight pure data validation based on `Applicative` and `Selective` functors.\n\n`validation-selective` is built around the following data type:\n\n```haskell\ndata Validation e a\n    = Failure e\n    | Success a\n```\n\nThis data type is similar to `Either` but allows accumulating all\nerrors instead of short-circuiting on the first one.\n\nFor more examples and library tutorial, refer to Haddock:\n\n* [`validation`: Official documentation](http://hackage.haskell.org/package/validation-selective/docs/Validation.html)\n\n## Comparison with other packages\n\n`validation-selective` is not the only package that provides such\n`Validation` data type. However, unlike other packages, it has some\nnoticeable advantages:\n\n+ **Lightweight**. `validation-selective` depends only on `base` and\n  `selective` (which is tiny) Haskell libraries which make this\n  package fast to build. So adding validation capabilities to your\n  library or application doesn't contribute much to your dependency\n  footprint.\n+ **Selective instance.** `validation-selective` is the only package\n  that provides `Selective` instance for `Validation` which allows\n  using `Monad`-like branching behaviour but without implementing\n  wrong `Monad` instance.\n+ **More algebraic instances.** `validation-selective` also provides\n  the `Alternative` instance and a more general `Semigroup` instance.\n+ **Best-in-class documentation.** Official Haddock documentation\n  contains mini-tutorial, usage example, per-component comparison with\n  `Either`, the motivation behind each instance and the interface in\n  general along with examples for **each instance and function**.\n\nThe below section provides per-package comparison with the most\npopular validation packages in the Haskell ecosystem:\n\n+ [`either`](https://hackage.haskell.org/package/either): `Validation`\n  implementation by Edward Kmett. This package is more heavyweight,\n  since it depends on more Haskell libraries like `profunctors`,\n  `bifunctors`, `semigroupoids`. But it also provides prisms for\n  `Validation` and some combinators for `Either`.\n+ [`validation`](https://hackage.haskell.org/package/validation):\n  `Validation` from [Queensland Functional Programming Lab](https://qfpl.io/).\n  Depends on `lens`, which makes it even heavier but also have richer\n  interface compared to the `either` package.\n\n## How to use\n\n`validation-selective` is compatible with the latest GHC compiler\nversions starting from `8.6`.\n\nIn order to start using `validation-selective` in your project, you\nwill need to set it up with the three easy steps:\n\n1. Add the dependency on `validation-selective` in your project's\n   `.cabal` file. For this, you should modify the `build-depends`\n   section by adding the name of this library. After the adjustment,\n   this section could look like this:\n\n   ```haskell\n   build-depends: base ^\u003e= 4.14\n                , validation-selective ^\u003e= 0.0\n   ```\n2. In the module where you wish to implement pure data validation, you\n   should add the import:\n\n   ```haskell\n   import Validation (Validation (..))\n   ```\n3. Now you can use the types and functions from the library:\n\n   ```haskell\n   main :: IO ()\n   main = print [Failure \"wrong\", Success 42]\n   ```\n\n### Usage with Stack\n\nIf `validation-selective` is not available on your current Stackage\nresolver yet, fear not! You can still use it from Hackage by adding\nthe following to the `extra-deps` section of your `stack.yaml` file:\n\n```yaml\nextra-deps:\n  - validation-selective-CURRENT_VERSION\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkowainik%2Fvalidation-selective","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkowainik%2Fvalidation-selective","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkowainik%2Fvalidation-selective/lists"}