Module Generic.Map

module type Comparator = Bonsai_types.Comparator

Comparator is just Base.Comparator plus t_of_sexp.

type ('k, 'cmp) comparator = ('k'cmp) Bonsai_types.comparator
val assoc_input : ('key'cmp) comparator -> ('data'result'incr'event) t -> (('key'data'cmp) Base.Map.t('key'result'cmp) Base.Map.t'incr'event) t

Transforms a component into a new component whose input and result are maps.

val associ_input : ('key'cmp) comparator -> ('key * 'data'result'incr'event) t -> (('key'data'cmp) Base.Map.t('key'result'cmp) Base.Map.t'incr'event) t

Transforms a component into a new component whose input and result are maps. The input for the transformed component also receives its key as an input.

val associ_input_with_extra : ('key'cmp) comparator -> ('key * 'data * 'input'result'incr'event) t -> (('key'data'cmp) Base.Map.t * 'input('key'result'cmp) Base.Map.t'incr'event) t
val merge : ('input('k'r1'cmp) Base.Map.t'incr'event) t -> ('input('k'r2'cmp) Base.Map.t'incr'event) t -> f:(key:'k -> [ `Both of 'r1 * 'r2 | `Left of 'r1 | `Right of 'r2 ] -> 'result option) -> ('input('k'result'cmp) Base.Map.t'incr'event) t

Given two components that produce maps, create a new component that produces a map that is merged according provided function f.