package jsont
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha512=6206f73a66cb170b560a72e58f70b9fb2c20397b9ab819dceba49b6602b9b79e47ba307e6910e61ca4694555c66fdcd7a17490afb99548e8f43845a5a88913e7
doc/jsont/Jsont/Array/index.html
Module Jsont.ArraySource
Mapping JSON arrays.
Maps
The type for specifying array encoding functions. A function to fold over the elements of type 'elt of the array of type 'array.
The type for mapping JSON arrays with elements of type 'elt to arrays of type 'array using values of type 'builder to build them.
val map :
?kind:string ->
?doc:string ->
?dec_empty:(unit -> 'builder) ->
?dec_skip:(int -> 'builder -> bool) ->
?dec_add:(int -> 'elt -> 'builder -> 'builder) ->
?dec_finish:(Meta.t -> int -> 'builder -> 'array) ->
?enc:('array, 'elt) enc ->
?enc_meta:('array -> Meta.t) ->
'elt t ->
('array, 'elt, 'builder) mapmap elt maps JSON arrays of type 'elt to arrays of type 'array built with type 'builder.
kindnames the entities represented by the map anddocdocuments them. Both default to"".dec_empty ()is used to create a builder for the empty array. Can be omitted if the map is only used for encoding, the default unconditionally errors.dec_skip i bis used to skip theith index of the JSON array. Iftrue, the element is not decoded witheltand not added withdec_addbut skipped. The default always returnsfalse.dec_add i vis used to add theith JSON elementv$ decoded byeltto the builderb. Can be omitted if the map is only used for encoding, the default unconditionally errors.dec_finish bconverts the builder to the final array. Can be omitted if the map is only used for encoding, the default unconditionally errors.enc.enc f acc afolds over the elements of arrayain increasing order withfand starting withacc. This function is used to encodeato a JSON array. Can be omitted if the map is only used for decoding, the default unconditionally errors.enc_meta ais the metadata to use for encodingvto a JSON array. Default returnsMeta.none.
val list_map :
?kind:string ->
?doc:string ->
?dec_skip:(int -> 'a list -> bool) ->
'a t ->
('a list, 'a, 'a list) maplist_map elt maps JSON arrays with elements of type elt to list values. See also Jsont.list.
The type for array builders.
val array_map :
?kind:string ->
?doc:string ->
?dec_skip:(int -> 'a array_builder -> bool) ->
'a t ->
('a array, 'a, 'a array_builder) maparray_map elt maps JSON arrays with elements of type elt to array values. See also Jsont.array.
The type for bigarray_builders.
val bigarray_map :
?kind:string ->
?doc:string ->
?dec_skip:(int -> ('a, 'b, 'c) bigarray_builder -> bool) ->
('a, 'b) Bigarray.kind ->
'c Bigarray.layout ->
'a t ->
(('a, 'b, 'c) Bigarray.Array1.t, 'a, ('a, 'b, 'c) bigarray_builder) mapbigarray k l elt maps JSON arrays with elements of type elt to bigarray values of kind k and layout l. See also Jsont.bigarray.
JSON types
array map maps with map JSON arrays to values of type 'a. See the the array combinators.