Proving Type Class Laws for Haskell

08/17/2018
by   Andreas Arvidsson, et al.
0

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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
07/01/2020

Equational Reasoning for MTL Type Classes

Ability to use definitions occurring in the code directly in equational ...
research
03/16/2023

Full Abstraction for Free

Structured recursion schemes such as folds and unfolds have been widely ...
research
07/24/2019

Learning abstract perceptual notions: the example of space

Humans are extremely swift learners. We are able to grasp highly abstrac...
research
06/19/2023

Controlling Type Confounding in Ad Hoc Teamwork with Instance-wise Teammate Feedback Rectification

Ad hoc teamwork requires an agent to cooperate with unknown teammates wi...
research
06/28/2019

Bidirectional Type Class Instances (Extended Version)

GADTs were introduced in Haskell's eco-system more than a decade ago, bu...
research
08/19/2021

Convexity via Weak Distributive Laws

We study the canonical weak distributive law δ of the powerset monad ove...
research
02/23/2022

Reconstruction of observed mechanical motions with Artificial Intelligence tools

The goal of this paper is to determine the laws of observed trajectories...

Please sign up or login with your details

Forgot password? Click here to reset