package bam

  1. Overview
  2. Docs

The bind function needs to be able to merge nodes between two trees. This library allows you to override the default behaviour be defining your own merge function. The function with_merge aims to be used just before the next bind.

By default, bind uses the Merge.default strategy. See Tree.with_merge for an explanation of what merging is.

type 'a t
val default : 'a t

default is the merging function used by bind. While using bind gen f, values of gen always preceeds the values produced by f a where a is either the value produced by the generator gen or during the shrinking.

val drop_left : 'a t

drop_left is the merging function that drops the values of gen.

val drop_right : 'a t

drop_left is the merging function that drops the values produced by f a.

val of_compare : compare:('a -> 'a -> int) -> 'a t

drop_left is the merging function that, with a bind, merges values of gen or f a according to compare.

OCaml

Innovation. Community. Security.