You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
3.9 KiB

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>IStdlib__IOption (infer.IStdlib__IOption)</title><link rel="stylesheet" href="../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 1.5.0"/><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">infer</a> &#x00BB; IStdlib__IOption</nav><h1>Module <code>IStdlib__IOption</code></h1></header><dl><dt class="spec value" id="val-find_value_exn"><a href="#val-find_value_exn" class="anchor"></a><code><span class="keyword">val</span> find_value_exn : <span><span class="type-var">'a</span> option</span> <span>&#45;&gt;</span> <span class="type-var">'a</span></code></dt><dd><p>Like <code>Option.value_exn</code> but raises <code>Caml.Not_found</code> when called with <code>None</code>.</p></dd></dl><dl><dt class="spec value" id="val-value_default_f"><a href="#val-value_default_f" class="anchor"></a><code><span class="keyword">val</span> value_default_f : <span>f:<span>(unit <span>&#45;&gt;</span> <span class="type-var">'a</span>)</span></span> <span>&#45;&gt;</span> <span><span class="type-var">'a</span> option</span> <span>&#45;&gt;</span> <span class="type-var">'a</span></code></dt><dd><p>Like <code>Option.value ~default:(f ())</code> but <code>f</code> is called only if <code>None</code>.</p></dd></dl><dl><dt class="spec value" id="val-if_none_evalopt"><a href="#val-if_none_evalopt" class="anchor"></a><code><span class="keyword">val</span> if_none_evalopt : <span>f:<span>(unit <span>&#45;&gt;</span> <span><span class="type-var">'a</span> option</span>)</span></span> <span>&#45;&gt;</span> <span><span class="type-var">'a</span> option</span> <span>&#45;&gt;</span> <span><span class="type-var">'a</span> option</span></code></dt><dd><p><code>if_none_evalopt ~f x</code> evaluates to <code>f ()</code> if <code>x = None</code>, otherwise returns <code>x</code>. Useful for chaining matchers where the first returning non-<code>None</code> determines the result.</p></dd></dl><dl><dt class="spec value" id="val-if_none_eval"><a href="#val-if_none_eval" class="anchor"></a><code><span class="keyword">val</span> if_none_eval : <span>f:<span>(unit <span>&#45;&gt;</span> <span class="type-var">'a</span>)</span></span> <span>&#45;&gt;</span> <span><span class="type-var">'a</span> option</span> <span>&#45;&gt;</span> <span class="type-var">'a</span></code></dt><dd><p><code>if_none_eval ~f x</code> evaluates to <code>y</code> if <code>x=Some y</code> else to <code>f ()</code>. Useful for terminating chains built with <code>if_none_evalopt</code>. This is exactly the same as <code>value_default_f</code> but with a better name.</p></dd></dl><dl><dt class="spec value" id="val-exists2"><a href="#val-exists2" class="anchor"></a><code><span class="keyword">val</span> exists2 : <span><span class="type-var">'a</span> option</span> <span>&#45;&gt;</span> <span><span class="type-var">'b</span> option</span> <span>&#45;&gt;</span> <span>f:<span>(<span class="type-var">'a</span> <span>&#45;&gt;</span> <span class="type-var">'b</span> <span>&#45;&gt;</span> bool)</span></span> <span>&#45;&gt;</span> bool</code></dt><dd><p>Like <code>Option.exists</code> but gets two parameters.</p></dd></dl><div><div class="spec include"><div class="doc"><details open="open"><summary><span class="def"><code><span class="keyword">include</span> <span class="keyword">sig</span> ... <span class="keyword">end</span></code></span></summary><dl><dt class="spec module" id="module-Let_syntax"><a href="#module-Let_syntax" class="anchor"></a><code><span class="keyword">module</span> <a href="Let_syntax/index.html">Let_syntax</a> : <span class="keyword">sig</span> ... <span class="keyword">end</span></code></dt><dd><p>Provides signatures for OCaml 4.08 binding operators</p></dd></dl></details></div></div></div></div></body></html>