{"id":26264764,"url":"https://github.com/jonathanknowles/quickcheck-groups","last_synced_at":"2025-10-18T23:22:19.996Z","repository":{"id":137803826,"uuid":"537698562","full_name":"jonathanknowles/quickcheck-groups","owner":"jonathanknowles","description":"QuickCheck support for testing instances of classes defined in the groups library.","archived":false,"fork":false,"pushed_at":"2025-04-04T19:06:19.000Z","size":403,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-30T14:28:27.778Z","etag":null,"topics":["abelian-groups","classes","groups","haskell","quickcheck"],"latest_commit_sha":null,"homepage":"https://hackage.haskell.org/package/quickcheck-groups","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonathanknowles.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}},"created_at":"2022-09-17T04:34:04.000Z","updated_at":"2025-04-14T17:54:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"ea70a4e2-e047-4559-a9ad-1d99d36ff47f","html_url":"https://github.com/jonathanknowles/quickcheck-groups","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanknowles%2Fquickcheck-groups","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanknowles%2Fquickcheck-groups/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanknowles%2Fquickcheck-groups/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanknowles%2Fquickcheck-groups/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonathanknowles","download_url":"https://codeload.github.com/jonathanknowles/quickcheck-groups/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251721201,"owners_count":21632783,"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":["abelian-groups","classes","groups","haskell","quickcheck"],"created_at":"2025-03-14T02:17:57.821Z","updated_at":"2025-10-18T23:22:19.901Z","avatar_url":"https://github.com/jonathanknowles.png","language":"Haskell","readme":"# `quickcheck-groups`\n\n\u003ca href=\"http://jonathanknowles.net/quickcheck-groups/\"\u003e\u003cimg src=\"https://img.shields.io/badge/API-Documentation-green\" /\u003e\u003c/a\u003e\n\n## Overview\n\nThe `quickcheck-groups` library provides:\n- [QuickCheck](https://hackage.haskell.org/package/QuickCheck) support for testing instances of type classes defined in the [`groups`](https://hackage.haskell.org/package/groups) library.\n- Compatibility with the [`quickcheck-classes`](https://hackage.haskell.org/package/quickcheck-classes) library.\n- Reusable properties for type class laws, in the form of [`Laws`](https://hackage.haskell.org/package/quickcheck-classes/docs/Test-QuickCheck-Classes.html#t:Laws) definitions.\n\n## Usage\n\nIn general, usage is identical to that of the [`quickcheck-classes`](https://hackage.haskell.org/package/quickcheck-classes) library. If you're already familiar with [`quickcheck-classes`](https://hackage.haskell.org/package/quickcheck-classes), then using this library should be straightforward.\n\n### Testing laws for a single type class\n\nTo test that the laws of a particular class hold for a particular type, use the [`lawsCheck`](https://hackage.haskell.org/package/quickcheck-classes/docs/Test-QuickCheck-Classes.html#v:lawsCheck) function with the [`Laws`](https://hackage.haskell.org/package/quickcheck-classes/docs/Test-QuickCheck-Classes.html#t:Laws) definition for the class you wish to test.\n\n\u003e #### :stars: Example\n\u003e\n\u003e To test that the [`Group`](https://hackage.haskell.org/package/groups/docs/Data-Group.html#t:Group) laws hold for the [`Sum`](https://hackage.haskell.org/package/base/docs/Data-Monoid.html#t:Sum) [`Integer`](https://hackage.haskell.org/package/base/docs/Prelude.html#t:Integer) type:\n\u003e\n\u003e ```hs\n\u003e import Data.Monoid (Sum)\n\u003e import Data.Proxy (Proxy (Proxy))\n\u003e import Test.QuickCheck.Classes (lawsCheck)\n\u003e import Test.QuickCheck.Classes.Group (groupLaws)\n\u003e\n\u003e lawsCheck (groupLaws (Proxy :: Proxy (Sum Integer)))\n\u003e ```\n\u003e\n\u003e If all tests pass, you should see output similar to:\n\u003e\n\u003e ```hs\n\u003e Group: groupLaw_invert_mempty    +++ OK, passed 1 test.\n\u003e Group: groupLaw_invert_invert    +++ OK, passed 100 tests.\n\u003e Group: groupLaw_invert_mappend_1 +++ OK, passed 100 tests.\n\u003e Group: groupLaw_invert_mappend_2 +++ OK, passed 100 tests.\n\u003e Group: groupLaw_subtract_mempty  +++ OK, passed 100 tests.\n\u003e Group: groupLaw_subtract_self    +++ OK, passed 100 tests.\n\u003e Group: groupLaw_subtract_other   +++ OK, passed 100 tests.\n\u003e Group: groupLaw_pow_zero         +++ OK, passed 100 tests.\n\u003e Group: groupLaw_pow_nonNegative  +++ OK, passed 100 tests.\n\u003e Group: groupLaw_pow_nonPositive  +++ OK, passed 100 tests.\n\u003e ```\n\n### Testing laws for multiple type classes\n\nTo test that the laws of __multiple__ classes hold for a particular type, use the [`lawsCheckOne`](https://hackage.haskell.org/package/quickcheck-classes/docs/Test-QuickCheck-Classes.html#v:lawsCheckOne) function with the [`Laws`](https://hackage.haskell.org/package/quickcheck-classes/docs/Test-QuickCheck-Classes.html#t:Laws) definitions for the classes you wish to test.\n\n\u003e #### :stars: Example\n\u003e\n\u003e To test that the [`Sum`](https://hackage.haskell.org/package/base/docs/Data-Monoid.html#t:Sum) [`Integer`](https://hackage.haskell.org/package/base/docs/Prelude.html#t:Integer) type satisfies the laws of [`Abelian`](https://hackage.haskell.org/package/groups/docs/Data-Group.html#t:Abelian) and all superclasses:\n\u003e\n\u003e ```hs\n\u003e import Data.Monoid (Sum)\n\u003e import Data.Proxy (Proxy (Proxy))\n\u003e import Test.QuickCheck.Classes\n\u003e import Test.QuickCheck.Classes.Group\n\u003e\n\u003e lawsCheckOne (Proxy :: Proxy (Sum Integer))\n\u003e     [ semigroupLaws\n\u003e     , monoidLaws\n\u003e     , groupLaws\n\u003e     , abelianLaws\n\u003e     ]\n\u003e ```\n\n## Subclasses and superclasses\n\nEach of the [`Laws`](https://hackage.haskell.org/package/quickcheck-classes/docs/Test-QuickCheck-Classes.html#t:Laws) definitions provided by this library corresponds to exactly __one__ type class, and includes __just__ the laws for that class. Laws for subclasses and superclasses are __not__ automatically included. Therefore, you'll need to __explicitly__ test the laws of every single class you wish to cover.\n\n## Coverage checks\n\nThis library includes __coverage checks__ to ensure that important cases are covered, and to reduce the probability of test passes that are false positives. These coverage checks are performed automatically.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonathanknowles%2Fquickcheck-groups","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonathanknowles%2Fquickcheck-groups","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonathanknowles%2Fquickcheck-groups/lists"}