-<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Merge (bam.Bam.Gen.Merge)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../../odoc.support/odoc.css"/><meta name="generator" content="odoc 2.4.3"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../../odoc.support/highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> – <a href="../../../index.html">bam</a> » <a href="../../index.html">Bam</a> » <a href="../index.html">Gen</a> » Merge</nav><header class="odoc-preamble"><h1>Module <code><span>Gen.Merge</span></code></h1><p>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 <a href="../index.html#val-with_merge"><code>with_merge</code></a> aims to be used just before the next bind.</p><p>By default, <a href="../index.html#val-bind"><code>bind</code></a> uses the <a href="#val-default"><code>Merge.default</code></a> strategy. See <a href="../../Tree/index.html#val-with_merge"><code>Tree.with_merge</code></a> for an explanation of what merging is.</p></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type anchored" id="type-t"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> <span>'a t</span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-default"><a href="#val-default" class="anchor"></a><code><span><span class="keyword">val</span> default : <span><span class="type-var">'a</span> <a href="#type-t">t</a></span></span></code></div><div class="spec-doc"><p><code>default</code> is the merging function used by <code>bind</code>. While using <code>bind gen f</code>, values of <code>gen</code> always preceeds the values produced by <code>f a</code> where <code>a</code> is either the value produced by the generator <code>gen</code> or during the shrinking.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-drop_left"><a href="#val-drop_left" class="anchor"></a><code><span><span class="keyword">val</span> drop_left : <span><span class="type-var">'a</span> <a href="#type-t">t</a></span></span></code></div><div class="spec-doc"><p><code>drop_left</code> is the merging function that drops the values of <code>gen</code>.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-drop_right"><a href="#val-drop_right" class="anchor"></a><code><span><span class="keyword">val</span> drop_right : <span><span class="type-var">'a</span> <a href="#type-t">t</a></span></span></code></div><div class="spec-doc"><p><code>drop_left</code> is the merging function that drops the values produced by <code>f a</code>.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-of_compare"><a href="#val-of_compare" class="anchor"></a><code><span><span class="keyword">val</span> of_compare : <span><span class="label">compare</span>:<span>(<span><span class="type-var">'a</span> <span class="arrow">-></span></span> <span><span class="type-var">'a</span> <span class="arrow">-></span></span> int)</span> <span class="arrow">-></span></span> <span><span class="type-var">'a</span> <a href="#type-t">t</a></span></span></code></div><div class="spec-doc"><p><code>drop_left</code> is the merging function that, with a <code>bind</code>, merges values of <code>gen</code> or <code>f a</code> according to <code>compare</code>.</p></div></div></div></body></html>
0 commit comments