Lightweight Higher-Kinded Polymorphism

  • Jeremy Yallop
  • Leo White
Conference paper

DOI: 10.1007/978-3-319-07151-0_8

Part of the Lecture Notes in Computer Science book series (LNCS, volume 8475)
Cite this paper as:
Yallop J., White L. (2014) Lightweight Higher-Kinded Polymorphism. In: Codish M., Sumii E. (eds) Functional and Logic Programming. FLOPS 2014. Lecture Notes in Computer Science, vol 8475. Springer, Cham

Abstract

Higher-kinded polymorphism —i.e. abstraction over type constructors— is an essential component of many functional programming techniques such as monads, folds, and embedded DSLs. ML-family languages typically support a form of abstraction over type constructors using functors, but the separation between the core language and the module language leads to awkwardness as functors proliferate.

We show how to express higher-kinded polymorphism in OCaml without functors, using an abstract type app to represent type application, and opaque brands to denote abstractable type constructors. We demonstrate the flexibility of our approach by using it to translate a variety of standard higher-kinded programs into functor-free OCaml code.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Springer International Publishing Switzerland 2014

Authors and Affiliations

  • Jeremy Yallop
    • 1
  • Leo White
    • 1
  1. 1.University of CambridgeUK

Personalised recommendations