Module CCMultiMap.MakeBidir

Parameters

Signature

type t
type left = L.t
type right = R.t
val empty : t
val is_empty : t -> bool
val add : t -> left -> right -> t

Add a binding (left,right).

val remove : t -> left -> right -> t

Remove a specific binding.

val cardinal_left : t -> int

Number of distinct left keys.

val cardinal_right : t -> int

Number of distinct right keys.

val remove_left : t -> left -> t

Remove all bindings for the left key.

val remove_right : t -> right -> t

Remove all bindings for the right key.

val mem_left : t -> left -> bool

Is the left key present in at least one pair?

val mem_right : t -> right -> bool

Is the right key present in at least one pair?

val find_left : t -> left -> right sequence

Find all bindings for this given left-key.

val find_right : t -> right -> left sequence

Find all bindings for this given right-key.

val find1_left : t -> left -> right option

Like find_left but returns at most one value.

val find1_right : t -> right -> left option

Like find_right but returns at most one value.

val fold : ('a -> left -> right -> 'a) -> 'a -> t -> 'a

Fold on pairs.

val pairs : t -> (left * right) sequence

Iterate on pairs.

val add_pairs : t -> (left * right) sequence -> t

Add pairs.

val seq_left : t -> left sequence
val seq_right : t -> right sequence