{"id":20606120,"url":"https://github.com/rudymatela/leancheck-instances","last_synced_at":"2026-03-04T05:01:55.366Z","repository":{"id":56845478,"uuid":"159575331","full_name":"rudymatela/leancheck-instances","owner":"rudymatela","description":"Common LeanCheck instances","archived":false,"fork":false,"pushed_at":"2025-05-12T13:44:39.000Z","size":135,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-12-08T06:48:09.857Z","etag":null,"topics":["enumerative-testing","haskell","leancheck","property-based-testing","property-testing","testing","testing-tools"],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rudymatela.png","metadata":{"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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-11-28T22:45:53.000Z","updated_at":"2025-05-12T13:44:43.000Z","dependencies_parsed_at":"2024-02-09T10:30:07.851Z","dependency_job_id":"1a4868a6-7aee-49ba-9f30-a075b3fd8610","html_url":"https://github.com/rudymatela/leancheck-instances","commit_stats":{"total_commits":96,"total_committers":1,"mean_commits":96.0,"dds":0.0,"last_synced_commit":"f280b63547d754fa25f6f104dc27c8d6ac0b2599"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/rudymatela/leancheck-instances","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudymatela%2Fleancheck-instances","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudymatela%2Fleancheck-instances/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudymatela%2Fleancheck-instances/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudymatela%2Fleancheck-instances/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rudymatela","download_url":"https://codeload.github.com/rudymatela/leancheck-instances/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudymatela%2Fleancheck-instances/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30071895,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T03:25:38.285Z","status":"ssl_error","status_checked_at":"2026-03-04T03:25:05.086Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["enumerative-testing","haskell","leancheck","property-based-testing","property-testing","testing","testing-tools"],"created_at":"2024-11-16T09:32:37.101Z","updated_at":"2026-03-04T05:01:55.337Z","avatar_url":"https://github.com/rudymatela.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"LeanCheck\n=========\n\n[![leancheck-instances's Build Status][build-status]][build-log]\n[![leancheck-instances on Hackage][hackage-version]][leancheck-instances-on-hackage]\n[![leancheck-instances on Stackage LTS][stackage-lts-badge]][leancheck-instances-on-stackage-lts]\n[![leancheck-instances on Stackage Nightly][stackage-nightly-badge]][leancheck-instances-on-stackage-nightly]\n\nThis package extends [LeanCheck] by providing [`Listable`] instances for common types provided by the\nHaskell Platform.\n\nThis package is to [LeanCheck] what [quickcheck-instances] is to [QuickCheck].\nThe current objective is to include all types supported by [quickcheck-instances].\n\n\nInstalling\n----------\n\nTo install the latest leancheck-instances version from Hackage, just run:\n\n\t$ cabal update\n\t$ cabal install leancheck-instances\n\n\nExamples\n--------\n\nImporting the library:\n\n\t\u003e import Test.LeanCheck\n\t\u003e import Test.LeanCheck.Instances\n\nChecking properties of [`Text`]:\n\n\t\u003e import qualified Data.Text as T\n\t\u003e check $ \\t -\u003e T.reverse (T.reverse t) == t\n\t+++ OK, passed 200 tests.\n\t\u003e check $ \\t -\u003e T.reverse t == t\n\t*** Failed! Falsifiable (after 6 tests):\n\t\"a \"\n\nEnumerating [`Map`]s:\n\n\t\u003e import Data.Map\n\t\u003e list :: [Map Bool Bool]\n\t[ fromList []\n\t, fromList [(False,False)]\n\t, fromList [(False,True)]\n\t, fromList [(True,False)]\n\t, fromList [(True,True)]\n\t, fromList [(False,False),(True,False)]\n\t, fromList [(False,False),(True,True)]\n\t, fromList [(False,True),(True,False)]\n\t, fromList [(False,True),(True,True)]\n\t]\n\t\u003e take 7 $ list :: [Map Int Int]\n\t[ fromList []\n\t, fromList [(0,0)]\n\t, fromList [(0,1)]\n\t, fromList [(1,0)]\n\t, fromList [(0,-1)]\n\t, fromList [(1,1)]\n\t, fromList [(0,0),(1,0)]\n\t]\n\n\nAdding more instances\n---------------------\n\nAlthough the current objective is to include all types supported by\n[quickcheck-instances], [leancheck-instances] only has about 10% of what is\nneeded.  Any help with new instances to increase that percentage will be\nappreciated.\n\nThis section provides a quick guide on how to add new instances.\n\n1. __Choose the type to support__\n\tCompare the instances provided on [quickcheck-instances] and\n\t[leancheck-instances] and choose any that has not been added to\n\t[leancheck-instances] yet.\n\n2. __Create the module file if needed__\n\tIf needed, create a module that will contain your instance following the\n\tsame structure in [quickcheck-instances]:\n\n       $ cat \u003e src/Test/LeanCheck/Instances/Something.hs\n       -- |\n       -- Module      : Test.LeanCheck.Instances.Containers\n       -- Copyright   : (c) 2019 Authors of leancheck-instances\n       -- License     : 3-Clause BSD  (see the file LICENSE)\n       -- Maintainer  : Rudy Matela \u003crudy@matela.com.br\u003e\n       --\n       -- 'Listable' something.\n       module Test.LeanCheck.Instances.Something () where\n\n       import Test.LeanCheck\n       import Something\n       ^D\n\n\tRemember to:\n\n\t* Import your newly created module on `src/Test/LeanCheck/Instances.hs`\n\n\t* Add your newly created module to the `exposed-modules` list in\n\t  `leancheck-instances.cabal`.\n\n\t* You may need to add a package dependency to `build-depends` on\n\t  `leancheck-instances.cabal`.\n\n\t* (Optionally) run `make depend` to update the `mk/depend.mk` file.\n\n3. __Create your instance__\n\tOpen the relevant module with your favourite text editor and add your\n\tinstance:\n\n       instance ... =\u003e Listable Something where\n         ...\n\n\tCheck the existing modules and the [`Listable`] typeclass documentation for\n\thow to create one.\n\n\tMake sure your instance builds with `cabal build`.\n\n4. __Create tests__\n\tGo into `tests/main.hs` and add two properties exercising your type, one\n\tthat [`holds`] and one that [`fails`].  Make sure the tests pass by running\n\t`cabal test`.\n\n5. (Optional) __Add diff-tests__\n\n\t* on `bench/tiers.hs` add an entry for your type;\n\t* add two matching entries on the `diff-test-tiers` and\n\t  `update-diff-test-tiers` Makefile targets.\n\t* run `make update-diff-test` to generate the reference output file.\n\t* run `make test` just to make sure the test is working.\n\n6. __Submit a Pull Request__\n\tThen submit a [pull request on GitHub] and wait for your build to pass.\n\tAlternatively, send a patch via e-mail.\n\n\nFurther reading / see also\n--------------------------\n\n* [leancheck-instances' Haddock Documentation];\n* [LeanCheck];\n* [LeanCheck provider for Tasty]\n  -- `$ cabal install tasty-leancheck` ;\n* [LeanCheck provider for test-framework]\n  -- `$ cabal install test-framework-leancheck` ;\n* [LeanCheck provider for Hspec]\n  -- `$ cabal install hspec-leancheck` .\n\n\n[leancheck-instances' Haddock documentation]: https://hackage.haskell.org/package/leancheck-instances/docs/Test-LeanCheck-Instances.html\n[LeanCheck's Haddock documentation]: https://hackage.haskell.org/package/leancheck/docs/Test-LeanCheck.html\n\n[`Listable`]:       https://hackage.haskell.org/package/leancheck/docs/Test-LeanCheck.html#t:Listable\n[`holds`]:          https://hackage.haskell.org/package/leancheck/docs/Test-LeanCheck.html#v:holds\n[`fails`]:          https://hackage.haskell.org/package/leancheck/docs/Test-LeanCheck.html#v:fails\n[`counterExample`]: https://hackage.haskell.org/package/leancheck/docs/Test-LeanCheck.html#v:counterExample\n[`check`]:          https://hackage.haskell.org/package/leancheck/docs/Test-LeanCheck.html#v:check\n[`tiers`]:          https://hackage.haskell.org/package/leancheck/docs/Test-LeanCheck.html#v:tiers\n[`list`]:           https://hackage.haskell.org/package/leancheck/docs/Test-LeanCheck.html#v:list\n[`Text`]:           https://hackage.haskell.org/package/text/docs/Data-Text.html#t:Text\n[`Map`]:            https://hackage.haskell.org/package/containers/docs/Data-Map-Lazy.html#t:Map\n\n[LeanCheck provider for Tasty]:          https://hackage.haskell.org/package/tasty-leancheck\n[LeanCheck provider for test-framework]: https://hackage.haskell.org/package/test-framework-leancheck\n[LeanCheck provider for Hspec]:          https://hackage.haskell.org/package/hspec-leancheck\n[LeanCheck]:                             https://github.com/rudymatela/leancheck\n[QuickCheck]:                            https://hackage.haskell.org/package/QuickCheck\n[quickcheck-instances]:                  https://hackage.haskell.org/package/quickcheck-instances\n[leancheck-instances]:                   https://hackage.haskell.org/package/leancheck-instances\n\n[build-log]:    https://github.com/rudymatela/leancheck-instances/actions/workflows/build.yml\n[build-status]: https://github.com/rudymatela/leancheck-instances/actions/workflows/build.yml/badge.svg\n[hackage-version]: https://img.shields.io/hackage/v/leancheck-instances.svg\n[leancheck-instances-on-hackage]:          https://hackage.haskell.org/package/leancheck-instances\n[stackage-lts-badge]:                      https://stackage.org/package/leancheck-instances/badge/lts\n[stackage-nightly-badge]:                  https://stackage.org/package/leancheck-instances/badge/nightly\n[leancheck-instances-on-stackage]:         https://stackage.org/package/leancheck-instances\n[leancheck-instances-on-stackage-lts]:     https://stackage.org/lts/package/leancheck-instances\n[leancheck-instances-on-stackage-nightly]: https://stackage.org/nightly/package/leancheck-instances\n[pull request on GitHub]:                  https://github.com/rudymatela/leancheck-instances/pulls\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frudymatela%2Fleancheck-instances","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frudymatela%2Fleancheck-instances","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frudymatela%2Fleancheck-instances/lists"}