Generic Programming in OCaml

12/31/2018
by   Florent Balestrieri, et al.
0

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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
06/02/2021

Generic Programming with Combinators and Objects

We present a generic programming framework for OCAML which makes it poss...
research
06/19/2017

Generic Approach to Certified Static Checking of Module-like Constructs

In this paper we consider the problem of certified static checking of mo...
research
10/15/2021

Zipping Strategies and Attribute Grammars

Strategic term rewriting and attribute grammars are two powerful program...
research
03/10/2021

Evaluating Linear Functions to Symmetric Monoidal Categories

A number of domain specific languages, such as circuits or data-science ...
research
10/12/2021

Generic Level Polymorphic N-ary Functions

Agda's standard library struggles in various places with n-ary functions...
research
08/09/2023

__host__ __device__ – Generic programming in Cuda

We present patterns for Cuda/C++ to write save generic code which works ...
research
11/09/2017

Refinement Reflection: Complete Verification with SMT

We introduce Refinement Reflection, a new framework for building SMT-bas...

Please sign up or login with your details

Forgot password? Click here to reset