You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<span><span>(<spanclass="type-var">'c</span>, exn)</span><spanclass="xref-unresolved">Stdlib</span>.result</span></span></code></div><divclass="spec-doc"><p>A context manager of type <code>('a, 'b, 'c) t</code> takes a continuation, and should feed the continuation a value of type <code>'a</code>. Once the continuation returns with either a <code>Ok of 'b</code> or an exception, the continuation should perform cleanup, and may suppress the exception by producing a suitable result (of type <code>'c</code>) instead. Typically, <code>'b = 'c</code>.</p><p>This representation has the advantage that some existing functions library already implement this type (e.g. <code>In_channel</code>.with_open_text).</p></div></div><divclass="odoc-spec"><divclass="spec value anchored" id="val-with_context"><ahref="#val-with_context" class="anchor"></a><code><span><spanclass="keyword">val</span> with_context : <span><span><span>(<spanclass="type-var">'a</span>, <spanclass="type-var">'b</span>, <spanclass="type-var">'c</span>)</span><ahref="#type-t">t</a></span><spanclass="arrow">-></span></span><span><span>(<span><spanclass="type-var">'d</span><spanclass="arrow">-></span></span><spanclass="type-var">'e</span>)</span><spanclass="arrow">-></span></span><spanclass="type-var">'f</span></span></code></div><divclass="spec-doc"><p><code>with_context cm f</code> runs <code>f</code> in the context manager <code>cm</code></p></div></div><divclass="odoc-spec"><divclass="spec value anchored" id="val-let<"><ahref="#val-let<" class="anchor"></a><code><span><spanclass="keyword">val</span> let< : <span><span><span>(<spanclass="type-var">'a</span>, <spanclass="type-var">'b</span>, <spanclass="type-var">'c</span>)</span><ahref="#type-t">t</a></span><spanclass="arrow">-></span></span><span><span>(<span><spanclass="type-var">'a</span><spanclass="arrow">-></span></span><spanclass="type-var">'b</span>)</span><spanclass="arrow">-></span></span><spanclass="type-var">'c</span></span></code></div><divclass="spec-doc"><p>Let-syntax for <ahref="#val-with_context"><code>with_context</code></a></p></div></div><divclass="odoc-spec"><divclass="spec value anchored" id="val-temp_file"><ahref="#val-temp_file" class="anchor"></a><code><span><spanclass="keyword">val</span> temp_file : <span>?temp_dir:string <spanclass="arrow">-></span></span><span>string <spanclass="arrow">-></span></span><span>string <spanclass="arrow">-></span></span><span><span>(string, <spanclass="type-var">'a</span>, <spanclass="type-var">'b</span>)</span><ahref="#type-t">t</a></span></span></code></div><divclass="spec-doc"><p>As per <code>Filename</code>.temp_file. Removes the temporary file upon completion.</p></div></div><divclass="odoc-spec"><divclass="spec value anchored" id="val-openfile"><ahref="#val-openfile" class="anchor"></a><code><span><spanclass="keyword">val</span> openfile :
<span><span>(<spanclass="xref-unresolved">Unix</span>.file_descr, <spanclass="type-var">'a</span>, <spanclass="type-var">'b</span>)</span><ahref="#type-t">t</a></span></span></code></div><divclass="spec-doc"><p>As per <code>Unix</code>.openfile. Closes the file descriptor upon completion.</p></div></div><divclass="odoc-spec"><divclass="spec value anchored" id="val-set_signal"><ahref="#val-set_signal" class="anchor"></a><code><span><spanclass="keyword">val</span> set_signal : <span>int <spanclass="arrow">-></span></span><span><spanclass="xref-unresolved">Stdlib</span>.Sys.signal_behavior <spanclass="arrow">-></span></span><span><span>(unit, <spanclass="type-var">'a</span>, <spanclass="type-var">'b</span>)</span><ahref="#type-t">t</a></span></span></code></div><divclass="spec-doc"><p>As per <code>Sys</code>.set_signal. Restores the previous signal behavior on completion.</p></div></div><divclass="odoc-spec"><divclass="spec value anchored" id="val-sigprocmask"><ahref="#val-sigprocmask" class="anchor"></a><code><span><spanclass="keyword">val</span> sigprocmask : <span><spanclass="xref-unresolved">Unix</span>.sigprocmask_command <spanclass="arrow">-></span></span><span><span>int list</span><spanclass="arrow">-></span></span><span><span>(unit, <spanclass="type-var">'a</span>, <spanclass="type-var">'b</span>)</span><ahref="#type-t">t</a></span></span></code></div><divclass="spec-doc"><p>As per <code>Unix</code>.sigprocmask. Restores the previous mask on completion.</p></div></div><divclass="odoc-spec"><divclass="spec value anchored" id="val-timeout_unix"><ahref="#val-timeout_unix" class="anchor"></a><code><span><spanclass="keyword">val</span> timeout_unix :
0 commit comments