Sexplib syntax extension simplifies serialization and deserialization of custom user data structures in OCaml. This is usually done by adding the annotation with sexp to the end of the type definition:
type a = A of int | B of float with sexp
This is not like generalizing directly to functor-based types, and itβs not clear how even standard functors can capture Sexplib standard type converters.
So far I have been working on this, smoothing out a specific instance of a map type (e.g. int Map.Make(String).t ) before the list before serializing and vice versa, but, of course, this was not completely missed by the ambitious Sexplib / Jane Street authors at all Core. I also notice that older versions of Batteries mix in the custom serialization of sexp with their core modules such as [Bat] Map, but that it has been removed for some time.
What are Maps or other complex types of functors commonly used with Sexplib serialization?
source share