Skip to content

Commit

Permalink
deploy: 82d339d
Browse files Browse the repository at this point in the history
  • Loading branch information
favonia committed Sep 28, 2023
1 parent 10dbe04 commit 61c7eeb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions asai/Asai/Logger/Make/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<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> <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>adopt m run f</code> runs the thunk <code>f</code> that uses a different <code>Logger</code> instance, with the help of the runner <code>run</code> from that <code>Logger</code> instance, and then uses <code>m</code> to map the diagnostics generated by <code>f</code> into the ones in the current <code>Logger</code> instance. The backtrace within <code>f</code> will include the backtrace that leads to <code>adopt</code>. The intended use case is to integrate diagnostics from a library into those in the main application.</p><p><code>adopt</code> is a convenience function that can be implemented as follows:</p><pre class="language-ocaml"><code>let adopt m f run =
<span class="type-var">'a</span></span></code></div><div class="spec-doc"><p><code>adopt m run f</code> runs the thunk <code>f</code> that uses a <i>different</i> <code>Logger</code> instance. It takes the runner <code>run</code> from that <code>Logger</code> instance as an argument to handle effects, and will use <code>m</code> to transform diagnostics generated by <code>f</code> into ones in the current <code>Logger</code> instance. The backtrace within <code>f</code> will include the backtrace that leads to <code>adopt</code>, and the innermost specified location will be carried over, too. The intended use case is to integrate diagnostics from a library into those in the main application.</p><p><code>adopt</code> is a convenience function that can be implemented as follows:</p><pre class="language-ocaml"><code>let adopt m f run =
run
?init_loc:(get_loc())
?init_backtrace:(Some (get_backtrace()))
Expand All @@ -77,7 +77,7 @@
f</code></pre><p>Here shows the intended usage, where <code>Lib</code> is the library to be used in the main application:</p><pre class="language-ocaml"><code>module MainLogger = Logger.Make(Code)
module LibLogger = Lib.Logger

let _ = MainLogger.adopt (Diagnostic.map code_mapper) LibLogger.run @@ fun () -&gt; ...</code></pre><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">init_backtrace</span> <p>The initial backtrace to start with. The default value is the empty backtrace.</p></li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-try_with"><a href="#val-try_with" class="anchor"></a><code><span><span class="keyword">val</span> try_with :
let _ = MainLogger.adopt (Diagnostic.map code_mapper) LibLogger.run @@ fun () -&gt; ...</code></pre></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-try_with"><a href="#val-try_with" class="anchor"></a><code><span><span class="keyword">val</span> try_with :
<span>?emit:<span>(<span><span><a href="argument-1-Code/index.html#type-t">Code.t</a> <a href="../../Diagnostic/index.html#type-t">Diagnostic.t</a></span> <span class="arrow">&#45;&gt;</span></span> unit)</span> <span class="arrow">&#45;&gt;</span></span>
<span>?fatal:<span>(<span><span><a href="argument-1-Code/index.html#type-t">Code.t</a> <a href="../../Diagnostic/index.html#type-t">Diagnostic.t</a></span> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'a</span>)</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>
Expand Down
4 changes: 2 additions & 2 deletions asai/Asai/Logger/module-type-S/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<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> <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>adopt m run f</code> runs the thunk <code>f</code> that uses a different <code>Logger</code> instance, with the help of the runner <code>run</code> from that <code>Logger</code> instance, and then uses <code>m</code> to map the diagnostics generated by <code>f</code> into the ones in the current <code>Logger</code> instance. The backtrace within <code>f</code> will include the backtrace that leads to <code>adopt</code>. The intended use case is to integrate diagnostics from a library into those in the main application.</p><p><code>adopt</code> is a convenience function that can be implemented as follows:</p><pre class="language-ocaml"><code>let adopt m f run =
<span class="type-var">'a</span></span></code></div><div class="spec-doc"><p><code>adopt m run f</code> runs the thunk <code>f</code> that uses a <i>different</i> <code>Logger</code> instance. It takes the runner <code>run</code> from that <code>Logger</code> instance as an argument to handle effects, and will use <code>m</code> to transform diagnostics generated by <code>f</code> into ones in the current <code>Logger</code> instance. The backtrace within <code>f</code> will include the backtrace that leads to <code>adopt</code>, and the innermost specified location will be carried over, too. The intended use case is to integrate diagnostics from a library into those in the main application.</p><p><code>adopt</code> is a convenience function that can be implemented as follows:</p><pre class="language-ocaml"><code>let adopt m f run =
run
?init_loc:(get_loc())
?init_backtrace:(Some (get_backtrace()))
Expand All @@ -77,7 +77,7 @@
f</code></pre><p>Here shows the intended usage, where <code>Lib</code> is the library to be used in the main application:</p><pre class="language-ocaml"><code>module MainLogger = Logger.Make(Code)
module LibLogger = Lib.Logger

let _ = MainLogger.adopt (Diagnostic.map code_mapper) LibLogger.run @@ fun () -&gt; ...</code></pre><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">init_backtrace</span> <p>The initial backtrace to start with. The default value is the empty backtrace.</p></li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-try_with"><a href="#val-try_with" class="anchor"></a><code><span><span class="keyword">val</span> try_with :
let _ = MainLogger.adopt (Diagnostic.map code_mapper) LibLogger.run @@ fun () -&gt; ...</code></pre></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-try_with"><a href="#val-try_with" class="anchor"></a><code><span><span class="keyword">val</span> try_with :
<span>?emit:<span>(<span><span><a href="Code/index.html#type-t">Code.t</a> <a href="../../Diagnostic/index.html#type-t">Diagnostic.t</a></span> <span class="arrow">&#45;&gt;</span></span> unit)</span> <span class="arrow">&#45;&gt;</span></span>
<span>?fatal:<span>(<span><span><a href="Code/index.html#type-t">Code.t</a> <a href="../../Diagnostic/index.html#type-t">Diagnostic.t</a></span> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'a</span>)</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>
Expand Down
Loading

0 comments on commit 61c7eeb

Please sign in to comment.