This commit is contained in:
c-cube 2022-10-18 19:38:15 +00:00
parent 5ba1808928
commit bb78f92132
4 changed files with 5 additions and 5 deletions

View file

@ -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.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.1.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../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></header><div class="odoc-content"><div class="odoc-spec"><div class="spec value" id="val-lines_of" class="anchored"><a href="#val-lines_of" class="anchor"></a><code><span><span class="keyword">val</span> lines_of : <span>?mode:int <span class="arrow">&#45;&gt;</span></span> <span>?flags:<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" id="val-chunks_of" class="anchored"><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><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.1.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../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><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><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><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" id="val-lines_of" class="anchored"><a href="#val-lines_of" class="anchor"></a><code><span><span class="keyword">val</span> lines_of : <span>?mode:int <span class="arrow">&#45;&gt;</span></span> <span>?flags:<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" id="val-chunks_of" class="anchored"><a href="#val-chunks_of" class="anchor"></a><code><span><span class="keyword">val</span> chunks_of :
<span>?mode:int <span class="arrow">&#45;&gt;</span></span>
<span>?flags:<span><span class="xref-unresolved">Stdlib</span>.open_flag list</span> <span class="arrow">&#45;&gt;</span></span>
<span>?size:int <span class="arrow">&#45;&gt;</span></span>

File diff suppressed because one or more lines are too long

View file

@ -1,2 +1,2 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>IterBigarray (iter.IterBigarray)</title><link rel="stylesheet" href="../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.1.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../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; IterBigarray</nav><header class="odoc-preamble"><h1>Module <code><span>IterBigarray</span></code></h1></header><nav class="odoc-toc"><ul><li><a href="#interface-and-helpers-for-bigarrays">Interface and Helpers for bigarrays</a></li></ul></nav><div class="odoc-content"><h2 id="interface-and-helpers-for-bigarrays"><a href="#interface-and-helpers-for-bigarrays" class="anchor"></a>Interface and Helpers for bigarrays</h2><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.5.4</li></ul><div class="odoc-spec"><div class="spec value" id="val-of_bigarray" class="anchored"><a href="#val-of_bigarray" class="anchor"></a><code><span><span class="keyword">val</span> of_bigarray : <span><span><span>( <span class="type-var">'a</span>, <span class="type-var">_</span>, <span class="type-var">_</span> )</span> <span class="xref-unresolved">Stdlib</span>.Bigarray.Array1.t</span> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'a</span> <a href="../Iter/index.html#type-t">Iter.t</a></span></span></code></div><div class="spec-doc"><p>Iterate on the elements of a 1-D array</p></div></div><div class="odoc-spec"><div class="spec value" id="val-mmap" class="anchored"><a href="#val-mmap" class="anchor"></a><code><span><span class="keyword">val</span> mmap : <span>string <span class="arrow">&#45;&gt;</span></span> <span>char <a href="../Iter/index.html#type-t">Iter.t</a></span></span></code></div><div class="spec-doc"><p>Map the file into memory, and read the characters.</p></div></div></div></body></html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>IterBigarray (iter.IterBigarray)</title><link rel="stylesheet" href="../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.1.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../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; IterBigarray</nav><header class="odoc-preamble"><h1>Module <code><span>IterBigarray</span></code></h1><p>Interface and Helpers for bigarrays</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.5.4</li></ul></header><div class="odoc-content"><div class="odoc-spec"><div class="spec value" id="val-of_bigarray" class="anchored"><a href="#val-of_bigarray" class="anchor"></a><code><span><span class="keyword">val</span> of_bigarray : <span><span><span>( <span class="type-var">'a</span>, <span class="type-var">_</span>, <span class="type-var">_</span> )</span> <span class="xref-unresolved">Stdlib</span>.Bigarray.Array1.t</span> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'a</span> <a href="../Iter/index.html#type-t">Iter.t</a></span></span></code></div><div class="spec-doc"><p>Iterate on the elements of a 1-D array</p></div></div><div class="odoc-spec"><div class="spec value" id="val-mmap" class="anchored"><a href="#val-mmap" class="anchor"></a><code><span><span class="keyword">val</span> mmap : <span>string <span class="arrow">&#45;&gt;</span></span> <span>char <a href="../Iter/index.html#type-t">Iter.t</a></span></span></code></div><div class="spec-doc"><p>Map the file into memory, and read the characters.</p></div></div></div></body></html>

View file

@ -1,2 +1,2 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>index (iter.index)</title><link rel="stylesheet" href="../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.1.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> iter</nav><header class="odoc-preamble"><h1 id="iter-index"><a href="#iter-index" class="anchor"></a>iter index</h1></header><nav class="odoc-toc"><ul><li><a href="#library-iter">Library iter</a></li><li><a href="#library-iter.bigarray">Library iter.bigarray</a></li></ul></nav><div class="odoc-content"><h2 id="library-iter"><a href="#library-iter" class="anchor"></a>Library iter</h2><p>This library exposes the following toplevel modules:</p><ul class="modules"><li><a href="Iter/index.html"><code>Iter</code></a> </li><li><a href="IterLabels/index.html"><code>IterLabels</code></a> </li><li><a href="Iter_shims_/index.html"><code>Iter_shims_</code></a> </li></ul><h2 id="library-iter.bigarray"><a href="#library-iter.bigarray" class="anchor"></a>Library iter.bigarray</h2><p>This library exposes the following toplevel modules:</p><ul class="modules"><li><a href="IterBigarray/index.html"><code>IterBigarray</code></a> </li><li><a href="IterBigarrayShims_/index.html"><code>IterBigarrayShims_</code></a> </li></ul></div></body></html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>index (iter.index)</title><link rel="stylesheet" href="../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.1.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> iter</nav><header class="odoc-preamble"><h1 id="iter-index"><a href="#iter-index" class="anchor"></a>iter index</h1></header><nav class="odoc-toc"><ul><li><a href="#library-iter">Library iter</a></li><li><a href="#library-iter.bigarray">Library iter.bigarray</a></li></ul></nav><div class="odoc-content"><h2 id="library-iter"><a href="#library-iter" class="anchor"></a>Library iter</h2><p>This library exposes the following toplevel modules:</p><ul class="modules"><li><a href="Iter/index.html"><code>Iter</code></a> <span class="synopsis">Simple and Efficient Iterators</span></li><li><a href="IterLabels/index.html"><code>IterLabels</code></a> </li><li><a href="Iter_shims_/index.html"><code>Iter_shims_</code></a> </li></ul><h2 id="library-iter.bigarray"><a href="#library-iter.bigarray" class="anchor"></a>Library iter.bigarray</h2><p>This library exposes the following toplevel modules:</p><ul class="modules"><li><a href="IterBigarray/index.html"><code>IterBigarray</code></a> <span class="synopsis">Interface and Helpers for bigarrays</span></li><li><a href="IterBigarrayShims_/index.html"><code>IterBigarrayShims_</code></a> </li></ul></div></body></html>