polysemy-check: QuickCheck for Polysemy

[ bsd3, library, polysemy ] [ Propose Tags ] [ Report a vulnerability ]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.2.0.0, 0.3.0.0, 0.4.0.0, 0.5.0.0, 0.6.0.0, 0.7.0.0, 0.8.0.0, 0.8.1.0, 0.9.0.0, 0.9.0.1
Change log ChangeLog.md
Dependencies base (>=4.7 && <5), containers, kind-generics (>=0.4.1.2), 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 2022-12-19T16:17:15Z
Distributions NixOS:0.9.0.1
Downloads 1375 total (47 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-0.9.0.1

[back to package description]

polysemy-check

Hackage

Dedication

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

--Coco Chanel

Overview

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.

Usage

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

Examples

Check the test suite.