Classes of arbitrary kind

Alejandro Serrano*, Victor Cacciari Miraldo

*Corresponding author for this work

Research output: Chapter in Book/Report/Conference proceedingConference contributionAcademicpeer-review

Abstract

The type class system in the Haskell Programming language provides a useful abstraction for a wide range of types, such as those that support comparison, serialization, ordering, between others. This system can be extended by the programmer by providing custom instances to one’s custom types. Yet, this is often a monotonous task. Some notions, such as equality, are very regular regardless if it is being encoded for a ground type or a type constructor. In this paper we present a technique that unifies the treatment of ground types and type constructors whenever possible. This reduces code duplication and improves consistency. We discuss the encoding of several classes in this form, including the generic programming facility in GHC.

Original languageEnglish
Title of host publicationPractical Aspects of Declarative Languages
Subtitle of host publication21st International Symposium, PADL 2019, Proceedings
EditorsJosé Júlio Alferes, Moa Johansson
PublisherSpringer
Pages150-168
Number of pages19
ISBN (Electronic) 978-3-030-05998-9
ISBN (Print)978-3-030-05997-2
DOIs
Publication statusPublished - 1 Jan 2019
Event21st International Symposium on Practical Aspects of Declarative Languages, PADL 2019 - Lisbon, Portugal
Duration: 14 Jan 201915 Jan 2019

Publication series

NameLecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)
Volume11372 LNCS
ISSN (Print)0302-9743
ISSN (Electronic)1611-3349

Conference

Conference21st International Symposium on Practical Aspects of Declarative Languages, PADL 2019
Country/TerritoryPortugal
CityLisbon
Period14/01/1915/01/19

Keywords

  • Generic programming
  • Haskell
  • Type classes

Fingerprint

Dive into the research topics of 'Classes of arbitrary kind'. Together they form a unique fingerprint.

Cite this