You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
4.1 KiB

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>InferBase__PolyFields (InferBase.InferBase__PolyFields)</title><link rel="stylesheet" href="../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc %%VERSION%%"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> <a href="../index.html">InferBase</a> &#x00BB; InferBase__PolyFields</nav><h1>Module <code>InferBase__PolyFields</code></h1></header><dl><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type</span> <span>'r t</span></code></dt><dd><p>Datastructure for polymorphic getters of record fields</p></dd></dl><dl><dt class="spec type" id="type-sub"><a href="#type-sub" class="anchor"></a><code><span class="keyword">type</span> <span>'r sub</span></code><code> = </code><table class="variant"><tr id="type-sub.S" class="anchored"><td class="def constructor"><a href="#type-sub.S" class="anchor"></a><code>| </code><code><span class="constructor">S</span> : <span><span>(<span class="type-var">'r</span>, <span class="type-var">'f</span>)</span> <a href="../../InferStdlib/InferStdlib/index.html#module-IStd">InferStdlib.IStd</a>.Field.t</span> * <span><span class="type-var">'f</span> <a href="index.html#type-t">t</a></span> <span>&#45;&gt;</span> <span><span class="type-var">'r</span> <a href="index.html#type-sub">sub</a></span></code></td></tr></table></dt><dt class="spec type" id="type-user"><a href="#type-user" class="anchor"></a><code><span class="keyword">type</span> <span>('r, 'a) user</span></code><code> = </code><code>{</code><table class="record"><tr id="type-user.f" class="anchored"><td class="def field"><a href="#type-user.f" class="anchor"></a><code>f : f. string <span>&#45;&gt;</span> <span>(<span class="type-var">'r</span> <span>&#45;&gt;</span> <span class="type-var">'f</span>)</span> <span>&#45;&gt;</span> <span class="type-var">'a</span>;</code></td></tr></table><code>}</code></dt></dl><dl><dt class="spec value" id="val-make"><a href="#val-make" class="anchor"></a><code><span class="keyword">val</span> make : <span>?&#8288;subfields:<span><span><span class="type-var">'r</span> <a href="index.html#type-sub">sub</a></span> list</span></span> <span>&#45;&gt;</span> <span>(<span><span>(<span class="type-var">_</span>, <span class="type-var">'r</span>, <span><span class="type-var">'r</span> <a href="index.html#type-t">t</a></span>)</span> <a href="../../InferStdlib/InferStdlib/index.html#module-IStd">InferStdlib.IStd</a>.Field.user</span> <span>&#45;&gt;</span> <span><span><span class="type-var">'r</span> <a href="index.html#type-t">t</a></span> list</span>)</span> <span>&#45;&gt;</span> <span><span class="type-var">'r</span> <a href="index.html#type-t">t</a></span></code></dt><dd><p>Pass <code>Fields.map_poly</code> generated by <code>@@deriving fields</code> for the record <code>'r</code> you are interested in to get the polymorphic getters of the fields of <code>'r</code>. A dummy field &quot;ALL&quot; is added too.</p><p>Subfields appearing in <code>subfields</code> will be added too. Each subfield is specified by <code>S (field, poly_fields)</code> where <code>field</code> is the corresponding <code>Field.t</code> value (generated by <code>@@deriving fields</code>) and <code>poly_fields</code> is the result of this function for the field record type.</p></dd></dl><dl><dt class="spec value" id="val-map"><a href="#val-map" class="anchor"></a><code><span class="keyword">val</span> map : <span><span class="type-var">'r</span> <a href="index.html#type-t">t</a></span> <span>&#45;&gt;</span> <span><span>(<span class="type-var">'r</span>, <span class="type-var">'a</span>)</span> <a href="index.html#type-user">user</a></span> <span>&#45;&gt;</span> <span><span class="type-var">'a</span> list</span></code></dt><dd><p><code>map r f</code> maps each field of <code>r</code> with the function <code>f</code>. <code>f</code> is called with two arguments: the name and the getter of the field.</p></dd></dl></div></body></html>