Proving Type Class Laws for Haskell
Paper in proceeding, 2019

Type classes in Haskell are used to implement ad-hoc polymorphism, i.e. a way to ensure both to the programmer and the compiler that a set of functions are defined for a specific data type. All instances of such type classes are expected to behave in a certain way and satisfy laws associated with the respective class. These are however typically just stated in comments and as such, there is no real way to enforce that they hold. In this paper we describe a system which allows the user to write down type class laws which are then automatically instantiated and sent to an inductive theorem prover when declaring a new instance of a type class.

Ad-hoc polymorphism

Program compilers

Author

Andreas Arvidsson

Chalmers, Computer Science and Engineering (Chalmers), Formal methods

Moa Johansson

Chalmers, Computer Science and Engineering (Chalmers), Formal methods

Robin Touche

Chalmers, Computer Science and Engineering (Chalmers), Formal methods

Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)

03029743 (ISSN) 16113349 (eISSN)

Vol. 10447 LNCS 61-74

17th International Symposium on Trends in Functional Programming, TFP 2016
College Park, USA,

Subject Categories

Algebra and Logic

Biomedical Laboratory Science/Technology

Mathematical Analysis

DOI

10.1007/978-3-030-14805-8_4

More information

Latest update

1/17/2022