Module Obj.Unknown

Unknown object members.

This module provides a type to handle unknown object members. By default unknown object members are skipped. This module provides different ways to handle them. See examples on how to collect them, how to error on them or treat them as uniform key-value maps.

type 'a jsont := 'a t

Unknown member maps

module Map : sig ... end

Predefined maps

val string_map : ?kind:string -> ?doc:string -> 'a jsont -> ('a Stdlib.Map.Make(Stdlib.String).t, 'a) Map.t

string_map t collects unknown member by name and types their values with t.

Unknown members

type ('o, 'mems) t

The type for representing, in objects of type 'o, unknown members by a value of type 'mems.

val error : ('o, unit) t

error errors on unknown members.

val drop : ('o, unit) t

drop drops unknown members.

val map : ?enc:('o -> 'mems) -> ('mems, 'a) Map.t -> ('o, 'mems) t

map m collects unknown members into the map described by m.