A datastructure (based on Hashtbl) to accumulate values.
An Accu.t can be seen as a generalized histogram: values
are mapped to bins, and each bin has a corresponding value
which may be its size or its contents depending on the need.
module Biocaml_accu: sigtype ('instance, 'bin, 'increment, 'accu) t
'instances are mapped to 'bins,
and the 'accumulated value for a 'bin is updated with an
'incrementval create : ?n:int ->
'd -> ('a -> 'b) -> ('c -> 'd -> 'd) -> ('a, 'b, 'c, 'd) t create ~n e f op creates an accumulator, which maps instances to bins
with f, uses e as a neutral element (that is the value associated to a
bin before any value has been added to it) and updates the value of a bin
with op. n is an estimation of the maximum number of bins.val add : ('a, 'b, 'c, 'd) t -> 'a -> 'c -> unitadd accu x y updates the value in accu for
the bin of x by an increment yval get : ('a, 'b, 'c, 'd) t -> 'b -> 'd optionget accu x returns the value associated to b in accu.type'instancecounter =('instance, 'instance, int, int) t
module Counter: sigtype'at ='a Biocaml_accu.counter
val add : 'a Biocaml_accu.counter -> 'a -> int -> unitval tick : 'a Biocaml_accu.counter -> 'a -> unitval stream : 'a Biocaml_accu.counter -> ('a * int) Stream.tval of_stream : 'a Stream.t -> 'a Biocaml_accu.counter endval counts : ('a -> 'b) -> 'a Stream.t -> ('b * int) Stream.tval product : ?filter:('a -> 'b -> bool) ->
('a -> 'b -> 'c) -> 'a list -> 'b list -> ('c * int) Stream.tproduct filter f l1 l2 computes an histogram of values returned by f
when it is applied for all combinations of elements in l1 and
l2 such that the predicate filter is truetype('a, 'b)relation =('a, 'a, 'b, 'b list) t
module Relation: sigtype('a, 'b)t =('a, 'b) Biocaml_accu.relation
val stream : ('a, 'b) Biocaml_accu.relation -> ('a * 'b list) Stream.tval of_stream : ('a * 'b) Stream.t -> ('a, 'b) Biocaml_accu.relation endval relation : ('a * 'b) Stream.t -> ('a * 'b list) Stream.tend