ClassLaws: Stating and checking laws for type class methods

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

The specification of a class in Haskell often starts with stating, in text, the laws that should be satisfied by methods defined in instances of the class, followed by the type of the methods of the class. The ClassLaws library is a framework that supports testing such class laws using QuickCheck. Our framework is a light-weight class law testing framework, which requires a limited amount of work per class law, and per datatype for which the class law is tested. We also show how to test class laws with partially-defined values. Using partially-defined values, we show that the standard lazy and strict implementations of the state monad do not satisfy the expected laws. More information can be found at http://wiki.portal.chalmers.se/cse/pmwiki.php/FP/ClassLaws. Built with ghc-7.4.2 and ghc-7.6.1. (Fails to build with ghc-7.2.2 due to http://hackage.haskell.org/trac/ghc/ticket/5745. Could be worked around.)

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.3.0.0, 0.3.0.1, 0.3.0.2, 0.3.1.0
Dependencies base (>=4.1.0.0 && <5), ChasingBottoms (>=1.3 && <2), mtl (>=1 && <3), QuickCheck (>=2 && <2.5) [details]
License BSD-3-Clause
Author Patrik Jansson and Johan Jeuring
Maintainer patrikj@chalmers.se
Category Testing
Home page http://wiki.portal.chalmers.se/cse/pmwiki.php/FP/ClassLaws
Uploaded by PatrikJansson at 2012-09-14T15:09:05Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 3977 total (11 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]