ppx_poly_record

AuthorJun Furuse
Homepagehttps://bitbucket.org/camlspotter/ppx_poly_record
Issue Trackerhttps://bitbucket.org/camlspotter/ppx_poly_record/issues?status=new&status=open
Maintainerjun.furuse@gmail.com
Dependencies
&ocamlfind
omake0.10
ppxx>= 2.3.0&2.4.0
Availableocaml-version >= "4.03.0"
PublishedSep 15, 2017
Source [http] https://bitbucket.org/camlspotter/ppx_poly_record/get/1.2.2.tar.gz
8122c8398d94b4e72e5fb99f7b9a97c8
StatisticsInstalled 2 times last month.
Edithttps://github.com/ocaml/opam-repository/tree/master/packages/ppx_poly_record/ppx_poly_record.1.2.2/opam

ppx for polymorphic records

Polymorphic record in OCaml

This ppx adds an extension point [%poly_record <exp>] for polymorphic record.

In side [%poly_record <exp>], the record syntax { l = e; .. }, { e with l = e'; .. }, r.l and r.l <- e become for polymorphic records whose type is _ Ppx_poly_record.Poly_record.t. The field information is encoded into OCaml's object type. For example:

# [%poly_record { x = 1; y = 1.0 }];;
- : < x : int; y : float > Ppx_poly_record.Poly_record.t = <abstr>

Implementation of _ PPx_poly_record.Poly_record.t is not by OCaml objects: it has no method table inside therefore safely serializable between different programs if its fields have no functional value.

No package is dependent