package orsetto

  1. Overview
  2. Docs
A library of assorted structured data interchange languages

Install

Dune Dependency

Authors

Maintainers

Sources

r1.1.2.tar.gz
sha512=e260412b2dd0f98cfe3dc7ed5c31a694eb31c93cd207c51fa12675b790234ee0ad3bf07d9be17a4dc266fedfe55b14c967cad7bc0c9414063eef8afd59f3d0d1

doc/orsetto.cf/Cf_record_scan/index.html

Module Cf_record_scan

Parser combinators for record types.

Overview

This module provides functional combinators for parsing records comprising lists of indexed fields, where an index is a value of totally ordered type, and the associated value has a type that depends on the value of the index.

Theory of Operation: Define a Basis that provides the scanners for field indexes and separators. Use that to Create() a profile of the record scanner in the syntax of each interchange language. Its users may then define a schema for each application record to scan, and use them to define scanners that first produce a pack by scanning according to the schema, then unpack the scanned records from the pack into application data structures.

Interface

Define a module of this signature according to the syntax of record types for a given structural interchange language.

module type Basis = sig ... end

The basis signature of a record scanning module.

module type Profile = sig ... end

The signature of a record scanning module.

module Create (B : Basis) : Profile with type index := B.Index.t and type 'a form := 'a B.Form.t and type 'a t := 'a B.Scan.t

Use Create(B) to make a record scanning module with basis B.

OCaml

Innovation. Community. Security.