mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 11:15:31 -05:00
2 lines
No EOL
2.7 KiB
HTML
2 lines
No EOL
2.7 KiB
HTML
<!DOCTYPE html>
|
||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Infix (containers.CCResult.Infix)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – <a href="../../index.html">containers</a> » <a href="../index.html">CCResult</a> » Infix</nav><h1>Module <code>CCResult.Infix</code></h1></header><dl><dt class="spec value" id="val-(>|=)"><a href="#val-(>|=)" class="anchor"></a><code><span class="keyword">val </span>(>|=) : (<span class="type-var">'a</span>, <span class="type-var">'err</span>) <a href="../index.html#type-t">t</a> <span>-></span> (<span class="type-var">'a</span> <span>-></span> <span class="type-var">'b</span>) <span>-></span> (<span class="type-var">'b</span>, <span class="type-var">'err</span>) <a href="../index.html#type-t">t</a></code></dt><dt class="spec value" id="val-(>>=)"><a href="#val-(>>=)" class="anchor"></a><code><span class="keyword">val </span>(>>=) : (<span class="type-var">'a</span>, <span class="type-var">'err</span>) <a href="../index.html#type-t">t</a> <span>-></span> (<span class="type-var">'a</span> <span>-></span> (<span class="type-var">'b</span>, <span class="type-var">'err</span>) <a href="../index.html#type-t">t</a>) <span>-></span> (<span class="type-var">'b</span>, <span class="type-var">'err</span>) <a href="../index.html#type-t">t</a></code></dt><dd><p>Monadic composition. <code>e >>= f</code> proceeds as <code>f x</code> if <code>e</code> is <code>Ok x</code> or returns <code>e</code> if <code>e</code> is an <code>Error</code>.</p></dd></dl><dl><dt class="spec value" id="val-(<*>)"><a href="#val-(<*>)" class="anchor"></a><code><span class="keyword">val </span>(<*>) : (<span class="type-var">'a</span> <span>-></span> <span class="type-var">'b</span>, <span class="type-var">'err</span>) <a href="../index.html#type-t">t</a> <span>-></span> (<span class="type-var">'a</span>, <span class="type-var">'err</span>) <a href="../index.html#type-t">t</a> <span>-></span> (<span class="type-var">'b</span>, <span class="type-var">'err</span>) <a href="../index.html#type-t">t</a></code></dt><dd><p><code>a <*> b</code> evaluates <code>a</code> and <code>b</code>, and, in case of success, returns <code>Ok (a b)</code>. Otherwise, it fails, and the error of <code>a</code> is chosen over the error of <code>b</code> if both fail.</p></dd></dl></div></body></html> |