TL;DR
This paper introduces a generic programming library for OCaml that leverages recent language features to facilitate type reflection, extensibility, and concise recursive function definitions, demonstrated through a type-safe deserialization case study.
Contribution
It presents a novel OCaml library utilizing recent language features to enable flexible, type-safe generic programming and recursive traversal capabilities.
Findings
Library supports various generic programming approaches via views.
Provides powerful combinators for recursive functions over complex types.
Enables type-safe deserialization respecting type abstraction.
Abstract
We present a library for generic programming in OCaml, adapting some techniques borrowed from other functional languages. The library makes use of three recent additions to OCaml: generalised abstract datatypes are essential to reflect types, extensible variants allow this reflection to be open for new additions, and extension points provide syntactic sugar and generate boiler plate code that simplify the use of the library. The building blocks of the library can be used to support many approaches to generic programming through the concept of view. Generic traversals are implemented on top of the library and provide powerful combinators to write concise definitions of recursive functions over complex tree types. Our case study is a type-safe deserialisation function that respects type abstraction.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
