Module Unknown.Map

type ('mems, 'a) t

The type for mapping unknown members to a value of type 'mems with member values of type 'a.

type ('mems, 'a) enc = {
  1. enc : 'acc. (Meta.t -> string -> 'a -> 'acc -> 'acc) -> 'mems -> 'acc -> 'acc;
}

The type for specifying unknown member folds.

val make : ?kind:string -> ?doc:string -> 'a jsont -> dec_empty:(Context.t -> 'mems) -> dec_add:(Meta.t -> string -> 'a -> 'mems -> 'mems) -> enc:('mems, 'a) enc -> ('mems, 'a) t

make type' ~empty ~add ~fold defines a structure of type 'mems to hold unknown members with values of type 'a. empty is the empty collection, add adds a member to the collection and fold folds over it.