package orsetto
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=81283687ce3204263bc955a332dd7b90bf5b648a990c01160f33aaa77d80962f
md5=7346293aa013c2a8974c6fb7c521166a
doc/orsetto.cf/Cf_annot/Create/Meta/index.html
Module Create.Meta
A submodule to facilitate structural interchange of metadata.
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:B.Meta.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:B.Meta.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:B.Meta.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:B.Meta.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:B.Meta.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:B.Meta.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
.