package orsetto

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

A submodule to facilitate structural interchange of metadata.

type fields = [
  1. | `Serial
  2. | `Stream
  3. | `Offsets
  4. | `Lines
]

Relevant portions of a position indicator.

The ~style and ~fields parameters for all the functions below are used as described in Meta to control what fields are encoded in a position and how they are to be decoded.

All the of_opaque_xxxxx function raise Cf_type.Type_error if the type of v is not witnessed correctly for the style and fields specified. Otherwise, raises Failure if the encapsulated value is witnessed by the correct type, but the encoded value is not a valid representation of a position.

val of_opaque_iota : ?style:[< Meta.style ] -> ?fields:fields list -> (Cf_type.opaque -> B.Symbol.t) -> Cf_type.opaque -> iota

Use of_opaque_iota f v to translate v into an iota value provided it was decoded from an interchange language representation of it produced by to_opaque_iota below. Applies f to the symbol encapsulated in v to compose the result.

val of_opaque_span : ?style:[< Meta.style ] -> ?fields:fields list -> Cf_type.opaque -> span

Use of_opaque_span v to translate v into a span value provided it was decoded from an interchange language representation of it produced by to_opaque_span below.

val of_opaque_form : ?style:[< Meta.style ] -> ?fields:fields list -> (Cf_type.opaque -> 'a) -> Cf_type.opaque -> 'a form

Use of_opaque_form f v to translate v into a form value provided it was decoded from an interchange language representation of it produced by to_opaque_form below. The value encapsulated in the form is unpacked by applying v.

val to_opaque_iota : ?style:[< Meta.style ] -> ?fields:fields list -> (B.Symbol.t -> Cf_type.opaque) -> iota -> Cf_type.opaque

Use to_opaque_iota f i to translate i into an opaque value ready to encode in an interchange language. The symbol encapsulated by in the iota is packed by applying f.

val to_opaque_span : ?style:[< Meta.style ] -> ?fields:fields list -> span -> Cf_type.opaque

Use to_opaque_span s to translate s into an opaque value ready to encode in an interchange language.

val to_opaque_form : ?style:[< Meta.style ] -> ?fields:fields list -> ('a -> Cf_type.opaque) -> 'a form -> Cf_type.opaque

Use to_opaque_form f loc to translate loc into an opaque value ready to encode in an interchange language. The value encapsulated in the form is packed by applying f.

OCaml

Innovation. Community. Security.