Affiliation:
1. Utrecht University & Open Universiteit, Utrecht, Netherlands
2. Chalmers University of Technology, Göteborg, Sweden
Abstract
The specification of a class in Haskell often starts with stating, in comments, the laws that should be satisfied by methods defined in instances of the class, followed by the type of the methods of the class. This paper develops 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.
Publisher
Association for Computing Machinery (ACM)
Subject
Computer Graphics and Computer-Aided Design,Software
Cited by
7 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Haskell⁻¹: automatic function inversion in Haskell;Proceedings of the 14th ACM SIGPLAN International Symposium on Haskell;2021-08-18
2. Extensional equality preservation and verified generic programming;Journal of Functional Programming;2021
3. Verifying effectful Haskell programs in Coq;Proceedings of the 12th ACM SIGPLAN International Symposium on Haskell - Haskell 2019;2019
4. Proving Type Class Laws for Haskell;Lecture Notes in Computer Science;2019
5. Effect Polymorphism in Higher-Order Logic (Proof Pearl);Journal of Automated Reasoning;2018-07-10