package bam

  1. Overview
  2. Docs

Module Gen.MergeSource

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.

Sourcetype 'a t
Sourceval 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.

Sourceval drop_left : 'a t

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

Sourceval drop_right : 'a t

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

Sourceval 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.