Proceedings of the 2007 Workshop on Workshop on ML 2007
DOI: 10.1145/1292535.1292548
|View full text |Cite
|
Sign up to set email alerts
|

Practical generic programming in OCaml

Abstract: We describe deriving, a system of extensible generic functions for OCaml implemented as a preprocessor and supporting library. We argue that generating code from type-definitions has significant advantages over a combinator approach, taking serialisation as an example application: our generate-your-boilerplate design results in a system that is easy to use, has comprehensive coverage of types and handles cyclic values without imposing a burden on the user. Users can extend generic functions with specialised im… Show more

Help me understand this report

Search citation statements

Order By: Relevance

Paper Sections

Select...
2
1
1
1

Citation Types

0
9
0

Year Published

2008
2008
2019
2019

Publication Types

Select...
8
2

Relationship

2
8

Authors

Journals

citations
Cited by 14 publications
(9 citation statements)
references
References 20 publications
0
9
0
Order By: Relevance
“…More recently, the ppx framework, which supports transformations on abstract syntax [17], has become popular. Syntax transformers based on ppx, such as ppx_deriving (a reimplementation of the deriving generic programming framework [18]), js_of_ocaml-ppx (an extension for manipulating JavaScript properties, distributed as part of the js_of_ocaml OCaml-to-JavaScript compiler [16]), ppx_lwt (a syntax for constructing promise computations, part of the lwt lightweight concurrency framework [15]) and ppx_stage (a preprocessor for typed multi-stage programming), may also generate large amounts of code.…”
Section: Local Names In Generated Codementioning
confidence: 99%
“…More recently, the ppx framework, which supports transformations on abstract syntax [17], has become popular. Syntax transformers based on ppx, such as ppx_deriving (a reimplementation of the deriving generic programming framework [18]), js_of_ocaml-ppx (an extension for manipulating JavaScript properties, distributed as part of the js_of_ocaml OCaml-to-JavaScript compiler [16]), ppx_lwt (a syntax for constructing promise computations, part of the lwt lightweight concurrency framework [15]) and ppx_stage (a preprocessor for typed multi-stage programming), may also generate large amounts of code.…”
Section: Local Names In Generated Codementioning
confidence: 99%
“…As follows from this exposition, a typed embedding of miniKanren in OCaml can be done with a combination of datatype-generic programming [12] and ad hoc polymorphism. There are a number of generic frameworks for OCaml (for example, [25]). On the other hand, the support for ad hoc polymorphism in OCaml is weak; there is nothing comparable in power to Haskell type classes, and even though sometimes the object-oriented layer of the language can be used to mimic desirable behavior, the result, as a rule, is far from satisfactory.…”
Section: Related Workmentioning
confidence: 99%
“…Deriving [40] is an extension to OCAML implemented using the preprocessor Camlp4. Generic functions are defined over the structure of types definitions, using a special syntax.…”
Section: Generic Libraries and Extensions In MLmentioning
confidence: 99%