-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
11 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> » <a href="../../index.html">Algaeff</a> » <a href="../index.html">Reader</a> » 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">-></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">-></span></span> <a href="argument-1-Env/index.html#type-t">Env.t</a>)</span> <span class="arrow">-></span></span> <span><span>(<span>unit <span class="arrow">-></span></span> <span class="type-var">'a</span>)</span> <span class="arrow">-></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">-></span></span> <span><span>(<span>unit <span class="arrow">-></span></span> <span class="type-var">'a</span>)</span> <span class="arrow">-></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">-></span></span> <span>string option</span>)</span> <span class="arrow">-></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> » <a href="../../index.html">Algaeff</a> » <a href="../index.html">Reader</a> » 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">-></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">-></span></span> <a href="argument-1-Env/index.html#type-t">Env.t</a>)</span> <span class="arrow">-></span></span> <span><span>(<span>unit <span class="arrow">-></span></span> <span class="type-var">'a</span>)</span> <span class="arrow">-></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">-></span></span> <span><span>(<span>unit <span class="arrow">-></span></span> <span class="type-var">'a</span>)</span> <span class="arrow">-></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">-></span></span> <span>string option</span>)</span> <span class="arrow">-></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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.