Skip to content

Commit

Permalink
deploy: 273453a
Browse files Browse the repository at this point in the history
  • Loading branch information
favonia committed Oct 31, 2023
1 parent 9ee2d9a commit 0b4d9bd
Show file tree
Hide file tree
Showing 14 changed files with 11 additions and 19 deletions.
2 changes: 1 addition & 1 deletion algaeff/Algaeff/Reader/Make/index.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Make (algaeff.Algaeff.Reader.Make)</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">algaeff</a> &#x00BB; <a href="../../index.html">Algaeff</a> &#x00BB; <a href="../index.html">Reader</a> &#x00BB; Make</nav><header class="odoc-preamble"><h1>Module <code><span>Reader.Make</span></code></h1><p>The implementation of read effects.</p><p>Signatures of read effects.</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-Env"><a href="#argument-1-Env" class="anchor"></a><code><span><span class="keyword">module</span> </span><span><a href="argument-1-Env/index.html">Env</a></span><span> : <a href="../../Sigs/module-type-Type/index.html">Sigs.Type</a></span></code></div></div><h2 id="signature"><a href="#signature" class="anchor"></a>Signature</h2><div class="odoc-spec"><div class="spec value anchored" id="val-read"><a href="#val-read" class="anchor"></a><code><span><span class="keyword">val</span> read : <span>unit <span class="arrow">&#45;&gt;</span></span> <a href="argument-1-Env/index.html#type-t">Env.t</a></span></code></div><div class="spec-doc"><p>Read the environment.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-scope"><a href="#val-scope" class="anchor"></a><code><span><span class="keyword">val</span> scope : <span><span>(<span><a href="argument-1-Env/index.html#type-t">Env.t</a> <span class="arrow">&#45;&gt;</span></span> <a href="argument-1-Env/index.html#type-t">Env.t</a>)</span> <span class="arrow">&#45;&gt;</span></span> <span><span>(<span>unit <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'a</span>)</span> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'a</span></span></code></div><div class="spec-doc"><p><code>scope f t</code> runs the thunk <code>t</code> under the new environment that is the result of applying <code>f</code> to the current environment.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-run"><a href="#val-run" class="anchor"></a><code><span><span class="keyword">val</span> run : <span><span class="label">env</span>:<a href="argument-1-Env/index.html#type-t">Env.t</a> <span class="arrow">&#45;&gt;</span></span> <span><span>(<span>unit <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'a</span>)</span> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'a</span></span></code></div><div class="spec-doc"><p><code>run t</code> runs the thunk <code>t</code> which may perform reading effects.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-register_printer"><a href="#val-register_printer" class="anchor"></a><code><span><span class="keyword">val</span> register_printer : <span><span>(<span><span>[ `Read ]</span> <span class="arrow">&#45;&gt;</span></span> <span>string option</span>)</span> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p><code>register_printer p</code> registers a printer <code>p</code> via <code>Printexc.register_printer</code> to convert the unhandled internal effect into a string for the OCaml runtime system to display. Ideally, the internal effect should have been handled by <a href="#val-run"><code>run</code></a> and there is no need to use this function, but when it is not the case, this function can be helpful for debugging. The functor <a href="#"><code>Reader.Make</code></a> always registers a simple printer to suggest using <a href="#val-run"><code>run</code></a>, but you can register new ones to override it. The return type of the printer <code>p</code> should return <code>Some s</code> where <code>s</code> is the resulting string, or <code>None</code> if it chooses not to convert a particular effect. The registered printers are tried in reverse order until one of them returns <code>Some s</code> for some <code>s</code>; that is, the last registered printer is tried first. Note that this function is a wrapper of <code>Printexc.register_printer</code> and all the registered printers (via this function or <code>Printexc.register_printer</code>) are put into the same list.</p><p>The input type of the printer <code>p</code> is a variant representation of the only internal effect used in this module. It corresponds to the effect trigger by <a href="#val-read"><code>read</code></a>.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 1.1.0</li></ul></div></div></div></body></html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Make (algaeff.Algaeff.Reader.Make)</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">algaeff</a> &#x00BB; <a href="../../index.html">Algaeff</a> &#x00BB; <a href="../index.html">Reader</a> &#x00BB; Make</nav><header class="odoc-preamble"><h1>Module <code><span>Reader.Make</span></code></h1><p>The implementation of read effects.</p><p>Signatures of read effects.</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-Env"><a href="#argument-1-Env" class="anchor"></a><code><span><span class="keyword">module</span> </span><span><a href="argument-1-Env/index.html">Env</a></span><span> : <a href="../../Sigs/module-type-Type/index.html">Sigs.Type</a></span></code></div></div><h2 id="signature"><a href="#signature" class="anchor"></a>Signature</h2><div class="odoc-spec"><div class="spec value anchored" id="val-read"><a href="#val-read" class="anchor"></a><code><span><span class="keyword">val</span> read : <span>unit <span class="arrow">&#45;&gt;</span></span> <a href="argument-1-Env/index.html#type-t">Env.t</a></span></code></div><div class="spec-doc"><p>Read the environment.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-scope"><a href="#val-scope" class="anchor"></a><code><span><span class="keyword">val</span> scope : <span><span>(<span><a href="argument-1-Env/index.html#type-t">Env.t</a> <span class="arrow">&#45;&gt;</span></span> <a href="argument-1-Env/index.html#type-t">Env.t</a>)</span> <span class="arrow">&#45;&gt;</span></span> <span><span>(<span>unit <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'a</span>)</span> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'a</span></span></code></div><div class="spec-doc"><p><code>scope f t</code> runs the thunk <code>t</code> under the new environment that is the result of applying <code>f</code> to the current environment.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-run"><a href="#val-run" class="anchor"></a><code><span><span class="keyword">val</span> run : <span><span class="label">env</span>:<a href="argument-1-Env/index.html#type-t">Env.t</a> <span class="arrow">&#45;&gt;</span></span> <span><span>(<span>unit <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'a</span>)</span> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'a</span></span></code></div><div class="spec-doc"><p><code>run ~env t</code> runs the thunk <code>t</code> which may perform reading effects on the value <code>env</code>.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-register_printer"><a href="#val-register_printer" class="anchor"></a><code><span><span class="keyword">val</span> register_printer : <span><span>(<span><span>[ `Read ]</span> <span class="arrow">&#45;&gt;</span></span> <span>string option</span>)</span> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p><code>register_printer p</code> registers a printer <code>p</code> via <code>Printexc.register_printer</code> to convert the unhandled internal effect into a string for the OCaml runtime system to display. Ideally, the internal effect should have been handled by <a href="#val-run"><code>run</code></a> and there is no need to use this function, but when it is not the case, this function can be helpful for debugging. The functor <a href="#"><code>Reader.Make</code></a> always registers a simple printer to suggest using <a href="#val-run"><code>run</code></a>, but you can register new ones to override it. The return type of the printer <code>p</code> should return <code>Some s</code> where <code>s</code> is the resulting string, or <code>None</code> if it chooses not to convert a particular effect. The registered printers are tried in reverse order until one of them returns <code>Some s</code> for some <code>s</code>; that is, the last registered printer is tried first. Note that this function is a wrapper of <code>Printexc.register_printer</code> and all the registered printers (via this function or <code>Printexc.register_printer</code>) are put into the same list.</p><p>The input type of the printer <code>p</code> is a variant representation of the only internal effect used in this module. It corresponds to the effect trigger by <a href="#val-read"><code>read</code></a>.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 1.1.0</li></ul></div></div></div></body></html>
2 changes: 1 addition & 1 deletion algaeff/Algaeff/Reader/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
R.scope (fun i -&gt; i + 1) (fun () -&gt; print_int (R.read ()));

(* this will print out 42 again *)
print_int (R.read ())</code></pre><p>This should be equivalent to <code>Unmonad</code> applying to the standard reader monad.</p><div class="odoc-spec"><div class="spec module-type anchored" id="module-type-S"><a href="#module-type-S" class="anchor"></a><code><span><span class="keyword">module</span> <span class="keyword">type</span> <a href="module-type-S/index.html">S</a></span><span> = <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div><div class="spec-doc"><p>Signatures of read effects.</p></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-Make"><a href="#module-Make" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Make/index.html">Make</a></span><span> (<a href="Make/argument-1-Env/index.html">Env</a> : <a href="../Sigs/module-type-Type/index.html">Sigs.Type</a>) : <a href="module-type-S/index.html">S</a> <span class="keyword">with</span> <span><span class="keyword">module</span> <a href="module-type-S/Env/index.html">Env</a> := <a href="Make/argument-1-Env/index.html">Env</a></span></span></code></div><div class="spec-doc"><p>The implementation of read effects.</p></div></div></div></body></html>
print_int (R.read ())</code></pre><div class="odoc-spec"><div class="spec module-type anchored" id="module-type-S"><a href="#module-type-S" class="anchor"></a><code><span><span class="keyword">module</span> <span class="keyword">type</span> <a href="module-type-S/index.html">S</a></span><span> = <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div><div class="spec-doc"><p>Signatures of read effects.</p></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-Make"><a href="#module-Make" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Make/index.html">Make</a></span><span> (<a href="Make/argument-1-Env/index.html">Env</a> : <a href="../Sigs/module-type-Type/index.html">Sigs.Type</a>) : <a href="module-type-S/index.html">S</a> <span class="keyword">with</span> <span><span class="keyword">type</span> <a href="module-type-S/index.html#type-env">env</a> := <a href="Make/argument-1-Env/index.html#type-t">Env.t</a></span></span></code></div><div class="spec-doc"><p>The implementation of read effects.</p></div></div></div></body></html>
2 changes: 0 additions & 2 deletions algaeff/Algaeff/Reader/module-type-S/Env/index.html

This file was deleted.

Loading

0 comments on commit 0b4d9bd

Please sign in to comment.