polysemy-check: QuickCheck for Polysemy

[ bsd3, library, polysemy ] [ Propose Tags ]


Maintainer's Corner

For package maintainers and hackage trustees


  • No Candidates
Versions [RSS],,,,,,,,,
Change log ChangeLog.md
Dependencies base (>=4.7 && <5), containers, kind-generics (<=, kind-generics-th, polysemy, QuickCheck [details]
License BSD-3-Clause
Copyright Sandy Maguire
Author Sandy Maguire
Maintainer sandy@sandymaguire.me
Category Polysemy
Home page https://github.com/polysemy-research/polysemy-check#readme
Bug tracker https://github.com/polysemy-research/polysemy-check/issues
Source repo head: git clone https://github.com/polysemy-research/polysemy-check
Uploaded by isovector at 2021-12-04T06:33:42Z
Distributions NixOS:
Downloads 894 total (15 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for polysemy-check-

[back to package description]




Success is most often achieved by those who don't know that failure is inevitable.

--Coco Chanel


polysemy-check is a little package that integrates polysemy with QuickCheck. It allows you to prove the equivalence of effects (see prepropLaw), the equivalence of interpreters (prepropEquivalent), and that two effects don't affect one another (prepropCommutative). These three things are about the only problems you could possibly run into with Polysemy --- and now you won't.

In addition polysemy-check provides lots of machinery to help avoid boilerplate, such as free Arbitrary instances for effects.


polysemy-check requires a Show and GenericK instance for every effect you'd like to run tests over.

{-# LANGUAGE TemplateHaskell #-}

import Polysemy
import Polysemy.Check

data Stack m a where
  Push :: Int -> Stack m ()
  Pop  :: Stack m (Maybe Int)
  Size :: Stack m Int

deriving instance Show (Stack m a)
makeSem ''Stack
deriveGenericK ''Stack


Check the test suite.