The right kind of generic programming

  • Authors:
  • José Pedro Magalhães

  • Affiliations:
  • University of Oxford, Oxford, United Kingdom

  • Venue:
  • Proceedings of the 8th ACM SIGPLAN workshop on Generic programming
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

Abstract

Haskell is known for its strong, static type system. A good type system classifies values, constraining the valid terms of the language and preventing many common programming errors. The Glasgow Haskell Compiler (GHC) has further extended the type language of Haskell, adding support for type-level computation and explicit type equality constraints. Type-level programming is used to classify values, but types themselves have remained notoriously unclassified. Recently, however, the kind-level language was extended with support for user-defined kinds and kind polymorphism. In this paper we revisit generic programming approaches that rely heavily on type-level computation, and analyse how to improve them with the extended kind language. For instructive purposes, we list a series of advantages given by the new features, and also a number of shortcomings that prevent desirable use patterns.