Skip to content

Commit

Permalink
deploy: 8b63646
Browse files Browse the repository at this point in the history
  • Loading branch information
just-max committed Jul 15, 2024
1 parent b33b213 commit 37f8f4c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Syntax (less-power.Common.Ctx_util.Syntax)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../../odoc.support/odoc.css"/><meta name="generator" content="odoc 2.4.2"/><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">less-power</a> &#x00BB; <a href="../../index.html">Common</a> &#x00BB; <a href="../index.html">Ctx_util</a> &#x00BB; Syntax</nav><header class="odoc-preamble"><h1>Module <code><span>Ctx_util.Syntax</span></code></h1></header><div class="odoc-content"><div class="odoc-spec"><div class="spec value anchored" id="val-let&lt;"><a href="#val-let&lt;" class="anchor"></a><code><span><span class="keyword">val</span> let&lt; : <span><span><span>(<span class="type-var">'a</span>, <span class="type-var">'b</span>, <span class="type-var">'c</span>)</span> <a href="../index.html#type-t">t</a></span> <span class="arrow">&#45;&gt;</span></span> <span><span>(<span><span class="type-var">'a</span> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'b</span>)</span> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'c</span></span></code></div><div class="spec-doc"><p>Let-syntax for <a href="../index.html#val-with_context"><code>with_context</code></a></p></div></div></div></body></html>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Ctx_util (less-power.Common.Ctx_util)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../odoc.support/odoc.css"/><meta name="generator" content="odoc 2.4.2"/><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">less-power</a> &#x00BB; <a href="../index.html">Common</a> &#x00BB; Ctx_util</nav><header class="odoc-preamble"><h1>Module <code><span>Common.Ctx_util</span></code></h1><p>Context managers, loosely inspired by Python</p></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type anchored" id="type-exn_info"><a href="#type-exn_info" class="anchor"></a><code><span><span class="keyword">type</span> exn_info</span><span> = </span><span>{</span></code><ol><li id="type-exn_info.exn" class="def record field anchored"><a href="#type-exn_info.exn" class="anchor"></a><code><span>exn : exn;</span></code></li><li id="type-exn_info.backtrace" class="def record field anchored"><a href="#type-exn_info.backtrace" class="anchor"></a><code><span>backtrace : <span class="xref-unresolved">Stdlib</span>.Printexc.raw_backtrace;</span></code></li></ol><code><span>}</span></code></div><div class="spec-doc"><p>Exception and its associated (raw) backtrace.</p></div></div><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, 'b, 'c) t</span></span><span> =
<span><span>(<span><span class="type-var">'a</span> <span class="arrow">&#45;&gt;</span></span> <span><span>(<span class="type-var">'b</span>, <a href="#type-exn_info">exn_info</a>)</span> <span class="xref-unresolved">Stdlib</span>.result</span>)</span> <span class="arrow">&#45;&gt;</span></span>
<span><span>(<span class="type-var">'c</span>, <a href="#type-exn_info">exn_info</a>)</span> <span class="xref-unresolved">Stdlib</span>.result</span></span></code></div><div class="spec-doc"><p>A context manager of type <code>('a, 'b, 'c) t</code> takes a continuation, and should feed the continuation a value of type <code>'a</code>. Once the continuation returns with either a <code>Ok of 'b</code> or an <a href="#type-exn_info"><code>exn_info</code></a>, the continuation should perform cleanup, and may suppress the exception by producing a suitable result (of type <code>'c</code>) instead. Often, <code>'b = 'c</code>.</p><p>This representation has the advantage that some existing functions library already implement this type (e.g. <code>In_channel.with_open_text</code>).</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-with_context"><a href="#val-with_context" class="anchor"></a><code><span><span class="keyword">val</span> with_context : <span><span><span>(<span class="type-var">'a</span>, <span class="type-var">'b</span>, <span class="type-var">'c</span>)</span> <a href="#type-t">t</a></span> <span class="arrow">&#45;&gt;</span></span> <span><span>(<span><span class="type-var">'d</span> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'e</span>)</span> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'f</span></span></code></div><div class="spec-doc"><p><code>with_context cm f</code> runs <code>f</code> in the context manager <code>cm</code></p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-let&lt;"><a href="#val-let&lt;" class="anchor"></a><code><span><span class="keyword">val</span> let&lt; : <span><span><span>(<span class="type-var">'a</span>, <span class="type-var">'b</span>, <span class="type-var">'c</span>)</span> <a href="#type-t">t</a></span> <span class="arrow">&#45;&gt;</span></span> <span><span>(<span><span class="type-var">'a</span> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'b</span>)</span> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'c</span></span></code></div><div class="spec-doc"><p>Let-syntax for <a href="#val-with_context"><code>with_context</code></a></p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-temp_file"><a href="#val-temp_file" class="anchor"></a><code><span><span class="keyword">val</span> temp_file : <span><span class="optlabel">?temp_dir</span>:string <span class="arrow">&#45;&gt;</span></span> <span>string <span class="arrow">&#45;&gt;</span></span> <span>string <span class="arrow">&#45;&gt;</span></span> <span><span>(string, <span class="type-var">'a</span>, <span class="type-var">'b</span>)</span> <a href="#type-t">t</a></span></span></code></div><div class="spec-doc"><p>As per <code>Filename.temp_file</code>. Removes the temporary file upon completion.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-openfile"><a href="#val-openfile" class="anchor"></a><code><span><span class="keyword">val</span> openfile :
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Ctx_util (less-power.Common.Ctx_util)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../odoc.support/odoc.css"/><meta name="generator" content="odoc 2.4.2"/><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">less-power</a> &#x00BB; <a href="../index.html">Common</a> &#x00BB; Ctx_util</nav><header class="odoc-preamble"><h1>Module <code><span>Common.Ctx_util</span></code></h1><p>Context managers, loosely inspired by Python</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, 'b, 'c) t</span></span><span> =
<span><span>(<span><span class="type-var">'a</span> <span class="arrow">&#45;&gt;</span></span> <span><span>(<span class="type-var">'b</span>, <a href="../Util/index.html#type-exn_info">Util.exn_info</a>)</span> <span class="xref-unresolved">Stdlib</span>.result</span>)</span> <span class="arrow">&#45;&gt;</span></span>
<span><span>(<span class="type-var">'c</span>, <a href="../Util/index.html#type-exn_info">Util.exn_info</a>)</span> <span class="xref-unresolved">Stdlib</span>.result</span></span></code></div><div class="spec-doc"><p>A context manager of type <code>('a, 'b, 'c) t</code> takes a continuation, and should feed the continuation a value of type <code>'a</code>. Once the continuation returns with either a <code>Ok of 'b</code> or an <code>exn_info</code>, the continuation should perform cleanup, and may suppress the exception by producing a suitable result (of type <code>'c</code>) instead. Often, <code>'b = 'c</code>.</p><p>This representation has the advantage that some existing functions library already implement this type (e.g. <code>In_channel.with_open_text</code>).</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-with_context"><a href="#val-with_context" class="anchor"></a><code><span><span class="keyword">val</span> with_context : <span><span><span>(<span class="type-var">'a</span>, <span class="type-var">'b</span>, <span class="type-var">'c</span>)</span> <a href="#type-t">t</a></span> <span class="arrow">&#45;&gt;</span></span> <span><span>(<span><span class="type-var">'d</span> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'e</span>)</span> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'f</span></span></code></div><div class="spec-doc"><p><code>with_context cm f</code> runs <code>f</code> in the context manager <code>cm</code></p></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-Syntax"><a href="#module-Syntax" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Syntax/index.html">Syntax</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-temp_file"><a href="#val-temp_file" class="anchor"></a><code><span><span class="keyword">val</span> temp_file : <span><span class="optlabel">?temp_dir</span>:string <span class="arrow">&#45;&gt;</span></span> <span>string <span class="arrow">&#45;&gt;</span></span> <span>string <span class="arrow">&#45;&gt;</span></span> <span><span>(string, <span class="type-var">'a</span>, <span class="type-var">'b</span>)</span> <a href="#type-t">t</a></span></span></code></div><div class="spec-doc"><p>As per <code>Filename.temp_file</code>. Removes the temporary file upon completion.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-openfile"><a href="#val-openfile" class="anchor"></a><code><span><span class="keyword">val</span> openfile :
<span>string <span class="arrow">&#45;&gt;</span></span>
<span><span><span class="xref-unresolved">Unix</span>.open_flag list</span> <span class="arrow">&#45;&gt;</span></span>
<span><span class="xref-unresolved">Unix</span>.file_perm <span class="arrow">&#45;&gt;</span></span>
Expand All @@ -11,7 +11,7 @@
<span><span>(unit, <span class="type-var">'a</span>, <span><span class="type-var">'b</span> option</span>)</span> <a href="#type-t">t</a></span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-timed"><a href="#val-timed" class="anchor"></a><code><span><span class="keyword">val</span> timed : <span><span>(unit, <span class="type-var">'a</span>, <span class="type-var">'b</span> * <span class="xref-unresolved">Mtime</span>.span)</span> <a href="#type-t">t</a></span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-capture_exceptions"><a href="#val-capture_exceptions" class="anchor"></a><code><span><span class="keyword">val</span> capture_exceptions :
<span><span class="optlabel">?filter</span>:<span>(<span>exn <span class="arrow">&#45;&gt;</span></span> bool)</span> <span class="arrow">&#45;&gt;</span></span>
<span>unit <span class="arrow">&#45;&gt;</span></span>
<span><span>(unit, <span class="type-var">'a</span>, <span><span>(<span class="type-var">'b</span>, <a href="#type-exn_info">exn_info</a>)</span> <span class="xref-unresolved">Stdlib</span>.result</span>)</span> <a href="#type-t">t</a></span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-empty_context"><a href="#val-empty_context" class="anchor"></a><code><span><span class="keyword">val</span> empty_context : <span><span class="type-var">'a</span> <span class="arrow">&#45;&gt;</span></span> <span><span>(<span><span class="type-var">'b</span> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'c</span>)</span> <span class="arrow">&#45;&gt;</span></span> <span><span>(<span class="type-var">'d</span>, <span class="type-var">'e</span>, <span class="type-var">'f</span>)</span> <a href="#type-t">t</a></span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-empty_context'"><a href="#val-empty_context'" class="anchor"></a><code><span><span class="keyword">val</span> empty_context' : <span><span class="type-var">'a</span> <span class="arrow">&#45;&gt;</span></span> <span><span>(<span class="type-var">'b</span>, <span class="type-var">'c</span>, <span class="type-var">'d</span>)</span> <a href="#type-t">t</a></span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-optional_context"><a href="#val-optional_context" class="anchor"></a><code><span><span class="keyword">val</span> optional_context :
<span><span>(unit, <span class="type-var">'a</span>, <span><span>(<span class="type-var">'b</span>, <a href="../Util/index.html#type-exn_info">Util.exn_info</a>)</span> <span class="xref-unresolved">Stdlib</span>.result</span>)</span> <a href="#type-t">t</a></span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-empty_context"><a href="#val-empty_context" class="anchor"></a><code><span><span class="keyword">val</span> empty_context : <span><span class="type-var">'a</span> <span class="arrow">&#45;&gt;</span></span> <span><span>(<span><span class="type-var">'b</span> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'c</span>)</span> <span class="arrow">&#45;&gt;</span></span> <span><span>(<span class="type-var">'d</span>, <span class="type-var">'e</span>, <span class="type-var">'f</span>)</span> <a href="#type-t">t</a></span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-empty_context'"><a href="#val-empty_context'" class="anchor"></a><code><span><span class="keyword">val</span> empty_context' : <span><span class="type-var">'a</span> <span class="arrow">&#45;&gt;</span></span> <span><span>(<span class="type-var">'b</span>, <span class="type-var">'c</span>, <span class="type-var">'d</span>)</span> <a href="#type-t">t</a></span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-optional_context"><a href="#val-optional_context" class="anchor"></a><code><span><span class="keyword">val</span> optional_context :
<span><span class="label">some</span>:<span>(<span><span class="type-var">'a</span> <span class="arrow">&#45;&gt;</span></span> <span><span>(<span class="type-var">'b</span>, <span class="type-var">'c</span>, <span class="type-var">'d</span>)</span> <a href="#type-t">t</a></span>)</span> <span class="arrow">&#45;&gt;</span></span>
<span><span class="type-var">'e</span> <span class="arrow">&#45;&gt;</span></span>
<span><span>(<span><span class="type-var">'c</span> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'d</span>)</span> <span class="arrow">&#45;&gt;</span></span>
Expand Down
Loading

0 comments on commit 37f8f4c

Please sign in to comment.