Skip to Main content Skip to Navigation
Conference papers

Lightweight Typed Customizable Unmarshaling

Pascal Cuoq 1 Julien Signoles 1 Damien Doligez 2, * 
* Corresponding author
1 LSL - Laboratoire Sûreté des Logiciels
DILS - Département Ingénierie Logiciels et Systèmes : DRT/LIST/DILS
Abstract : 1. Abstract The contribution of this work is threefold. First, we offer an OCaml unmarshaling algorithm that uses a lightweight type-directed de-scription of the expected structure of data to make consistency checks. The second contribution is the opportunity to specify func-tions to be systematically applied on values as they are being un-marshaled. Our third contribution is a type-safe layer for these functions and for the unmarshaling algorithm itself. 2. Description The standard OCaml unmarshaling function is input value: in channel → α. The aforementioned first contribution is a function descr input val with type in channel → descr → α. One value of type descr that can be passed as second argu-ment is Abstract, and then the behavior is exactly identical to input value. The programmer can provide as much information as (s)he wants for the additional consistency checks. For instance, (s)he can pass the value (t array Abstract) to specify that the value being read is an array of undescribed values. Our unmar-shaling algorithm maintains a cursor into the structure description, allowing it to know what the current loaded value should look like.
Document type :
Conference papers
Complete list of metadata

Cited literature [12 references]  Display  Hide  Download
Contributor : Damien Doligez Connect in order to contact the contributor
Submitted on : Wednesday, February 4, 2015 - 5:29:05 AM
Last modification on : Saturday, June 25, 2022 - 9:09:17 PM
Long-term archiving on: : Tuesday, May 5, 2015 - 10:05:55 AM


Files produced by the author(s)


  • HAL Id : hal-01091947, version 1




Pascal Cuoq, Julien Signoles, Damien Doligez. Lightweight Typed Customizable Unmarshaling. ACM SIGPLAN Workshop on ML, Sep 2011, Tokyo, Japan. ⟨hal-01091947⟩



Record views


Files downloads