Lightweight Higher-Kinded Polymorphism [chapter]

Jeremy Yallop, Leo White
2014 Lecture Notes in Computer Science  
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
more » ... epresent 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.
doi:10.1007/978-3-319-07151-0_8 fatcat:duxnysgi5rb25oo2zwtl6v2zsu