Skip to content

Commit

Permalink
deploy: 92d0022
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Jan 9, 2024
1 parent f83ee4b commit d02b21f
Show file tree
Hide file tree
Showing 26 changed files with 520 additions and 61 deletions.
2 changes: 1 addition & 1 deletion dev/iter/Iter/IO/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>IO (iter.Iter.IO)</title><link rel="stylesheet" href="../../../odoc.support/odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.3.1"/><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">iter</a> &#x00BB; <a href="../index.html">Iter</a> &#x00BB; IO</nav><header class="odoc-preamble"><h1>Module <code><span>Iter.IO</span></code></h1><p>Basic IO</p><p>Very basic interface to manipulate files as iterator of chunks/lines. The iterators take care of opening and closing files properly; every time one iterates over an iterator, the file is opened/closed again.</p><p>Example: copy a file <code>&quot;a&quot;</code> into file <code>&quot;b&quot;</code>, removing blank lines:</p><pre class="language-ocaml"><code>Iterator.(IO.lines_of &quot;a&quot; |&gt; filter (fun l-&gt; l&lt;&gt; &quot;&quot;) |&gt; IO.write_lines &quot;b&quot;);;</code></pre><p>By chunks of <code>4096</code> bytes:</p><pre class="language-ocaml"><code>Iterator.IO.(chunks_of ~size:4096 &quot;a&quot; |&gt; write_to &quot;b&quot;);;</code></pre><p>Read the lines of a file into a list:</p><pre class="language-ocaml"><code>Iterator.IO.lines &quot;a&quot; |&gt; Iterator.to_list</code></pre><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.5.1</li></ul></header><div class="odoc-content"><div class="odoc-spec"><div class="spec value anchored" id="val-lines_of"><a href="#val-lines_of" class="anchor"></a><code><span><span class="keyword">val</span> lines_of : <span><span class="optlabel">?mode</span>:int <span class="arrow">&#45;&gt;</span></span> <span><span class="optlabel">?flags</span>:<span><span class="xref-unresolved">Stdlib</span>.open_flag list</span> <span class="arrow">&#45;&gt;</span></span> <span>string <span class="arrow">&#45;&gt;</span></span> <span>string <a href="../index.html#type-t">t</a></span></span></code></div><div class="spec-doc"><p><code>lines_of filename</code> reads all lines of the given file. It raises the same exception as would opening the file and read from it, except from <code>End_of_file</code> (which is caught). The file is <b>always</b> properly closed. Every time the iterator is iterated on, the file is opened again, so different iterations might return different results</p><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">mode</span> <p>default <code>0o644</code></p></li></ul><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">flags</span> <p>default: <code>[Open_rdonly]</code></p></li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-chunks_of"><a href="#val-chunks_of" class="anchor"></a><code><span><span class="keyword">val</span> chunks_of :
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>IO (iter.Iter.IO)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../odoc.support/odoc.css"/><meta name="generator" content="odoc 2.4.0"/><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">iter</a> &#x00BB; <a href="../index.html">Iter</a> &#x00BB; IO</nav><header class="odoc-preamble"><h1>Module <code><span>Iter.IO</span></code></h1><p>Basic IO</p><p>Very basic interface to manipulate files as iterator of chunks/lines. The iterators take care of opening and closing files properly; every time one iterates over an iterator, the file is opened/closed again.</p><p>Example: copy a file <code>&quot;a&quot;</code> into file <code>&quot;b&quot;</code>, removing blank lines:</p><pre class="language-ocaml"><code>Iterator.(IO.lines_of &quot;a&quot; |&gt; filter (fun l-&gt; l&lt;&gt; &quot;&quot;) |&gt; IO.write_lines &quot;b&quot;);;</code></pre><p>By chunks of <code>4096</code> bytes:</p><pre class="language-ocaml"><code>Iterator.IO.(chunks_of ~size:4096 &quot;a&quot; |&gt; write_to &quot;b&quot;);;</code></pre><p>Read the lines of a file into a list:</p><pre class="language-ocaml"><code>Iterator.IO.lines &quot;a&quot; |&gt; Iterator.to_list</code></pre><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.5.1</li></ul></header><div class="odoc-content"><div class="odoc-spec"><div class="spec value anchored" id="val-lines_of"><a href="#val-lines_of" class="anchor"></a><code><span><span class="keyword">val</span> lines_of : <span><span class="optlabel">?mode</span>:int <span class="arrow">&#45;&gt;</span></span> <span><span class="optlabel">?flags</span>:<span><span class="xref-unresolved">Stdlib</span>.open_flag list</span> <span class="arrow">&#45;&gt;</span></span> <span>string <span class="arrow">&#45;&gt;</span></span> <span>string <a href="../index.html#type-t">t</a></span></span></code></div><div class="spec-doc"><p><code>lines_of filename</code> reads all lines of the given file. It raises the same exception as would opening the file and read from it, except from <code>End_of_file</code> (which is caught). The file is <b>always</b> properly closed. Every time the iterator is iterated on, the file is opened again, so different iterations might return different results</p><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">mode</span> <p>default <code>0o644</code></p></li></ul><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">flags</span> <p>default: <code>[Open_rdonly]</code></p></li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-chunks_of"><a href="#val-chunks_of" class="anchor"></a><code><span><span class="keyword">val</span> chunks_of :
<span><span class="optlabel">?mode</span>:int <span class="arrow">&#45;&gt;</span></span>
<span><span class="optlabel">?flags</span>:<span><span class="xref-unresolved">Stdlib</span>.open_flag list</span> <span class="arrow">&#45;&gt;</span></span>
<span><span class="optlabel">?size</span>:int <span class="arrow">&#45;&gt;</span></span>
Expand Down
2 changes: 1 addition & 1 deletion dev/iter/Iter/Infix/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dev/iter/Iter/Map/Adapt/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Adapt (iter.Iter.Map.Adapt)</title><link rel="stylesheet" href="../../../../odoc.support/odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.3.1"/><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">iter</a> &#x00BB; <a href="../../index.html">Iter</a> &#x00BB; <a href="../index.html">Map</a> &#x00BB; Adapt</nav><header class="odoc-preamble"><h1>Module <code><span>Map.Adapt</span></code></h1><p>Adapt a pre-existing Map module to make it iterator-aware</p></header><nav class="odoc-toc"><ul><li><a href="#parameters">Parameters</a></li><li><a href="#signature">Signature</a></li></ul></nav><div class="odoc-content"><h2 id="parameters"><a href="#parameters" class="anchor"></a>Parameters</h2><div class="odoc-spec"><div class="spec parameter anchored" id="argument-1-M"><a href="#argument-1-M" class="anchor"></a><code><span><span class="keyword">module</span> </span><span>M</span><span> : <span class="xref-unresolved">Stdlib</span>.Map.S</span></code></div></div><h2 id="signature"><a href="#signature" class="anchor"></a>Signature</h2><div class="odoc-include"><details open="open"><summary class="spec include"><code><span><span class="keyword">include</span> <span class="xref-unresolved">Stdlib</span>.Map.S <span class="keyword">with</span> <span><span class="keyword">type</span> <span class="xref-unresolved">key</span> = <span class="xref-unresolved">M</span>.key</span> <span class="keyword">with</span> <span><span class="keyword">type</span> <span>'a <span class="xref-unresolved">t</span></span> = <span><span class="type-var">'a</span> <span class="xref-unresolved">M</span>.t</span></span></span></code></summary><div class="odoc-spec"><div class="spec type anchored" id="type-key"><a href="#type-key" class="anchor"></a><code><span><span class="keyword">type</span> key</span><span> = <span class="xref-unresolved">M</span>.key</span></code></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 t</span></span><span> = <span><span class="type-var">'a</span> <span class="xref-unresolved">M</span>.t</span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-empty"><a href="#val-empty" class="anchor"></a><code><span><span class="keyword">val</span> empty : <span><span class="type-var">'a</span> <a href="#type-t">t</a></span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-is_empty"><a href="#val-is_empty" class="anchor"></a><code><span><span class="keyword">val</span> is_empty : <span><span><span class="type-var">'a</span> <a href="#type-t">t</a></span> <span class="arrow">&#45;&gt;</span></span> bool</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-mem"><a href="#val-mem" class="anchor"></a><code><span><span class="keyword">val</span> mem : <span><a href="#type-key">key</a> <span class="arrow">&#45;&gt;</span></span> <span><span><span class="type-var">'a</span> <a href="#type-t">t</a></span> <span class="arrow">&#45;&gt;</span></span> bool</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-add"><a href="#val-add" class="anchor"></a><code><span><span class="keyword">val</span> add : <span><a href="#type-key">key</a> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'a</span> <span class="arrow">&#45;&gt;</span></span> <span><span><span class="type-var">'a</span> <a href="#type-t">t</a></span> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'a</span> <a href="#type-t">t</a></span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-update"><a href="#val-update" class="anchor"></a><code><span><span class="keyword">val</span> update : <span><a href="#type-key">key</a> <span class="arrow">&#45;&gt;</span></span> <span><span>(<span><span><span class="type-var">'a</span> option</span> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'a</span> option</span>)</span> <span class="arrow">&#45;&gt;</span></span> <span><span><span class="type-var">'a</span> <a href="#type-t">t</a></span> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'a</span> <a href="#type-t">t</a></span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-singleton"><a href="#val-singleton" class="anchor"></a><code><span><span class="keyword">val</span> singleton : <span><a href="#type-key">key</a> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'a</span> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'a</span> <a href="#type-t">t</a></span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-remove"><a href="#val-remove" class="anchor"></a><code><span><span class="keyword">val</span> remove : <span><a href="#type-key">key</a> <span class="arrow">&#45;&gt;</span></span> <span><span><span class="type-var">'a</span> <a href="#type-t">t</a></span> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'a</span> <a href="#type-t">t</a></span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-merge"><a href="#val-merge" class="anchor"></a><code><span><span class="keyword">val</span> merge :
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Adapt (iter.Iter.Map.Adapt)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../../odoc.support/odoc.css"/><meta name="generator" content="odoc 2.4.0"/><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">iter</a> &#x00BB; <a href="../../index.html">Iter</a> &#x00BB; <a href="../index.html">Map</a> &#x00BB; Adapt</nav><header class="odoc-preamble"><h1>Module <code><span>Map.Adapt</span></code></h1><p>Adapt a pre-existing Map module to make it iterator-aware</p></header><nav class="odoc-toc"><ul><li><a href="#parameters">Parameters</a></li><li><a href="#signature">Signature</a></li></ul></nav><div class="odoc-content"><h2 id="parameters"><a href="#parameters" class="anchor"></a>Parameters</h2><div class="odoc-spec"><div class="spec parameter anchored" id="argument-1-M"><a href="#argument-1-M" class="anchor"></a><code><span><span class="keyword">module</span> </span><span>M</span><span> : <span class="xref-unresolved">Stdlib</span>.Map.S</span></code></div></div><h2 id="signature"><a href="#signature" class="anchor"></a>Signature</h2><div class="odoc-include"><details open="open"><summary class="spec include"><code><span><span class="keyword">include</span> <span class="xref-unresolved">Stdlib</span>.Map.S <span class="keyword">with</span> <span><span class="keyword">type</span> <span class="xref-unresolved">key</span> = <span class="xref-unresolved">M</span>.key</span> <span class="keyword">with</span> <span><span class="keyword">type</span> <span>'a <span class="xref-unresolved">t</span></span> = <span><span class="type-var">'a</span> <span class="xref-unresolved">M</span>.t</span></span></span></code></summary><div class="odoc-spec"><div class="spec type anchored" id="type-key"><a href="#type-key" class="anchor"></a><code><span><span class="keyword">type</span> key</span><span> = <span class="xref-unresolved">M</span>.key</span></code></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 t</span></span><span> = <span><span class="type-var">'a</span> <span class="xref-unresolved">M</span>.t</span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-empty"><a href="#val-empty" class="anchor"></a><code><span><span class="keyword">val</span> empty : <span><span class="type-var">'a</span> <a href="#type-t">t</a></span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-is_empty"><a href="#val-is_empty" class="anchor"></a><code><span><span class="keyword">val</span> is_empty : <span><span><span class="type-var">'a</span> <a href="#type-t">t</a></span> <span class="arrow">&#45;&gt;</span></span> bool</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-mem"><a href="#val-mem" class="anchor"></a><code><span><span class="keyword">val</span> mem : <span><a href="#type-key">key</a> <span class="arrow">&#45;&gt;</span></span> <span><span><span class="type-var">'a</span> <a href="#type-t">t</a></span> <span class="arrow">&#45;&gt;</span></span> bool</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-add"><a href="#val-add" class="anchor"></a><code><span><span class="keyword">val</span> add : <span><a href="#type-key">key</a> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'a</span> <span class="arrow">&#45;&gt;</span></span> <span><span><span class="type-var">'a</span> <a href="#type-t">t</a></span> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'a</span> <a href="#type-t">t</a></span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-update"><a href="#val-update" class="anchor"></a><code><span><span class="keyword">val</span> update : <span><a href="#type-key">key</a> <span class="arrow">&#45;&gt;</span></span> <span><span>(<span><span><span class="type-var">'a</span> option</span> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'a</span> option</span>)</span> <span class="arrow">&#45;&gt;</span></span> <span><span><span class="type-var">'a</span> <a href="#type-t">t</a></span> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'a</span> <a href="#type-t">t</a></span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-singleton"><a href="#val-singleton" class="anchor"></a><code><span><span class="keyword">val</span> singleton : <span><a href="#type-key">key</a> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'a</span> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'a</span> <a href="#type-t">t</a></span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-remove"><a href="#val-remove" class="anchor"></a><code><span><span class="keyword">val</span> remove : <span><a href="#type-key">key</a> <span class="arrow">&#45;&gt;</span></span> <span><span><span class="type-var">'a</span> <a href="#type-t">t</a></span> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'a</span> <a href="#type-t">t</a></span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-merge"><a href="#val-merge" class="anchor"></a><code><span><span class="keyword">val</span> merge :
<span><span>(<span><a href="#type-key">key</a> <span class="arrow">&#45;&gt;</span></span> <span><span><span class="type-var">'a</span> option</span> <span class="arrow">&#45;&gt;</span></span> <span><span><span class="type-var">'b</span> option</span> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'c</span> option</span>)</span> <span class="arrow">&#45;&gt;</span></span>
<span><span><span class="type-var">'a</span> <a href="#type-t">t</a></span> <span class="arrow">&#45;&gt;</span></span>
<span><span><span class="type-var">'b</span> <a href="#type-t">t</a></span> <span class="arrow">&#45;&gt;</span></span>
Expand Down
Loading

0 comments on commit d02b21f

Please sign in to comment.