<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="generator" content="AsciiDoc 8.6.10">
<title>UnsafeStructure</title>
<link rel="stylesheet" href="./asciidoc.css" type="text/css">
<link rel="stylesheet" href="./pygments.css" type="text/css">


<script type="text/javascript" src="./asciidoc.js"></script>
<script type="text/javascript">
/*<![CDATA[*/
asciidoc.install();
/*]]>*/
</script>
<link rel="stylesheet" href="./mlton.css" type="text/css">
</head>
<body class="article">
<div id="banner">
<div id="banner-home">
<a href="./Home">MLton 20201002</a>
</div>
</div>
<div id="header">
<h1>UnsafeStructure</h1>
</div>
<div id="content">
<div id="preamble">
<div class="sectionbody">
<div class="paragraph"><p>This module is a subset of the <span class="monospaced">Unsafe</span> module provided by SML/NJ,
with a few extract operations for <span class="monospaced">PackWord</span> and <span class="monospaced">PackReal</span>.</p></div>
<div class="listingblock">
<div class="content"><div class="highlight"><pre><span></span><span class="k">signature</span><span class="w"> </span><span class="n">UNSAFE_MONO_ARRAY</span><span class="w"> </span><span class="p">=</span><span class="w"></span>
<span class="w">   </span><span class="k">sig</span><span class="w"></span>
<span class="w">      </span><span class="k">type</span><span class="w"> </span><span class="n">array</span><span class="w"></span>
<span class="w">      </span><span class="k">type</span><span class="w"> </span><span class="n">elem</span><span class="w"></span>

<span class="w">      </span><span class="k">val</span><span class="w"> </span><span class="n">create</span><span class="p">:</span><span class="w"> </span><span class="n">int</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">array</span><span class="w"></span>
<span class="w">      </span><span class="k">val</span><span class="w"> </span><span class="n">sub</span><span class="p">:</span><span class="w"> </span><span class="n">array</span><span class="w"> </span><span class="n">*</span><span class="w"> </span><span class="n">int</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">elem</span><span class="w"></span>
<span class="w">      </span><span class="k">val</span><span class="w"> </span><span class="n">update</span><span class="p">:</span><span class="w"> </span><span class="n">array</span><span class="w"> </span><span class="n">*</span><span class="w"> </span><span class="n">int</span><span class="w"> </span><span class="n">*</span><span class="w"> </span><span class="n">elem</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">unit</span><span class="w"></span>
<span class="w">   </span><span class="k">end</span><span class="w"></span>

<span class="k">signature</span><span class="w"> </span><span class="n">UNSAFE_MONO_VECTOR</span><span class="w"> </span><span class="p">=</span><span class="w"></span>
<span class="w">   </span><span class="k">sig</span><span class="w"></span>
<span class="w">      </span><span class="k">type</span><span class="w"> </span><span class="n">elem</span><span class="w"></span>
<span class="w">      </span><span class="k">type</span><span class="w"> </span><span class="n">vector</span><span class="w"></span>

<span class="w">      </span><span class="k">val</span><span class="w"> </span><span class="n">sub</span><span class="p">:</span><span class="w"> </span><span class="n">vector</span><span class="w"> </span><span class="n">*</span><span class="w"> </span><span class="n">int</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">elem</span><span class="w"></span>
<span class="w">   </span><span class="k">end</span><span class="w"></span>

<span class="k">signature</span><span class="w"> </span><span class="n">UNSAFE</span><span class="w"> </span><span class="p">=</span><span class="w"></span>
<span class="w">   </span><span class="k">sig</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">Array</span><span class="p">:</span><span class="w"></span>
<span class="w">         </span><span class="k">sig</span><span class="w"></span>
<span class="w">            </span><span class="k">val</span><span class="w"> </span><span class="n">create</span><span class="p">:</span><span class="w"> </span><span class="n">int</span><span class="w"> </span><span class="n">*</span><span class="w"> </span><span class="n">&#39;a</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">&#39;a</span><span class="w"> </span><span class="n">array</span><span class="w"></span>
<span class="w">            </span><span class="k">val</span><span class="w"> </span><span class="n">sub</span><span class="p">:</span><span class="w"> </span><span class="n">&#39;a</span><span class="w"> </span><span class="n">array</span><span class="w"> </span><span class="n">*</span><span class="w"> </span><span class="n">int</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">&#39;a</span><span class="w"></span>
<span class="w">            </span><span class="k">val</span><span class="w"> </span><span class="n">update</span><span class="p">:</span><span class="w"> </span><span class="n">&#39;a</span><span class="w"> </span><span class="n">array</span><span class="w"> </span><span class="n">*</span><span class="w"> </span><span class="n">int</span><span class="w"> </span><span class="n">*</span><span class="w"> </span><span class="n">&#39;a</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">unit</span><span class="w"></span>
<span class="w">         </span><span class="k">end</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">CharArray</span><span class="p">:</span><span class="w"> </span><span class="n">UNSAFE_MONO_ARRAY</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">CharVector</span><span class="p">:</span><span class="w"> </span><span class="n">UNSAFE_MONO_VECTOR</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">IntArray</span><span class="p">:</span><span class="w"> </span><span class="n">UNSAFE_MONO_ARRAY</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">IntVector</span><span class="p">:</span><span class="w"> </span><span class="n">UNSAFE_MONO_VECTOR</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">Int8Array</span><span class="p">:</span><span class="w"> </span><span class="n">UNSAFE_MONO_ARRAY</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">Int8Vector</span><span class="p">:</span><span class="w"> </span><span class="n">UNSAFE_MONO_VECTOR</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">Int16Array</span><span class="p">:</span><span class="w"> </span><span class="n">UNSAFE_MONO_ARRAY</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">Int16Vector</span><span class="p">:</span><span class="w"> </span><span class="n">UNSAFE_MONO_VECTOR</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">Int32Array</span><span class="p">:</span><span class="w"> </span><span class="n">UNSAFE_MONO_ARRAY</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">Int32Vector</span><span class="p">:</span><span class="w"> </span><span class="n">UNSAFE_MONO_VECTOR</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">Int64Array</span><span class="p">:</span><span class="w"> </span><span class="n">UNSAFE_MONO_ARRAY</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">Int64Vector</span><span class="p">:</span><span class="w"> </span><span class="n">UNSAFE_MONO_VECTOR</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">IntInfArray</span><span class="p">:</span><span class="w"> </span><span class="n">UNSAFE_MONO_ARRAY</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">IntInfVector</span><span class="p">:</span><span class="w"> </span><span class="n">UNSAFE_MONO_VECTOR</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">LargeIntArray</span><span class="p">:</span><span class="w"> </span><span class="n">UNSAFE_MONO_ARRAY</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">LargeIntVector</span><span class="p">:</span><span class="w"> </span><span class="n">UNSAFE_MONO_VECTOR</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">LargeRealArray</span><span class="p">:</span><span class="w"> </span><span class="n">UNSAFE_MONO_ARRAY</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">LargeRealVector</span><span class="p">:</span><span class="w"> </span><span class="n">UNSAFE_MONO_VECTOR</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">LargeWordArray</span><span class="p">:</span><span class="w"> </span><span class="n">UNSAFE_MONO_ARRAY</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">LargeWordVector</span><span class="p">:</span><span class="w"> </span><span class="n">UNSAFE_MONO_VECTOR</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">RealArray</span><span class="p">:</span><span class="w"> </span><span class="n">UNSAFE_MONO_ARRAY</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">RealVector</span><span class="p">:</span><span class="w"> </span><span class="n">UNSAFE_MONO_VECTOR</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">Real32Array</span><span class="p">:</span><span class="w"> </span><span class="n">UNSAFE_MONO_ARRAY</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">Real32Vector</span><span class="p">:</span><span class="w"> </span><span class="n">UNSAFE_MONO_VECTOR</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">Real64Array</span><span class="p">:</span><span class="w"> </span><span class="n">UNSAFE_MONO_ARRAY</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">Vector</span><span class="p">:</span><span class="w"></span>
<span class="w">         </span><span class="k">sig</span><span class="w"></span>
<span class="w">            </span><span class="k">val</span><span class="w"> </span><span class="n">sub</span><span class="p">:</span><span class="w"> </span><span class="n">&#39;a</span><span class="w"> </span><span class="n">vector</span><span class="w"> </span><span class="n">*</span><span class="w"> </span><span class="n">int</span><span class="w"> </span><span class="p">-&gt;</span><span class="w"> </span><span class="n">&#39;a</span><span class="w"></span>
<span class="w">         </span><span class="k">end</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">Word8Array</span><span class="p">:</span><span class="w"> </span><span class="n">UNSAFE_MONO_ARRAY</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">Word8Vector</span><span class="p">:</span><span class="w"> </span><span class="n">UNSAFE_MONO_VECTOR</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">Word16Array</span><span class="p">:</span><span class="w"> </span><span class="n">UNSAFE_MONO_ARRAY</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">Word16Vector</span><span class="p">:</span><span class="w"> </span><span class="n">UNSAFE_MONO_VECTOR</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">Word32Array</span><span class="p">:</span><span class="w"> </span><span class="n">UNSAFE_MONO_ARRAY</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">Word32Vector</span><span class="p">:</span><span class="w"> </span><span class="n">UNSAFE_MONO_VECTOR</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">Word64Array</span><span class="p">:</span><span class="w"> </span><span class="n">UNSAFE_MONO_ARRAY</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">Word64Vector</span><span class="p">:</span><span class="w"> </span><span class="n">UNSAFE_MONO_VECTOR</span><span class="w"></span>

<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">PackReal32Big</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">PACK_REAL</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">PackReal32Little</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">PACK_REAL</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">PackReal64Big</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">PACK_REAL</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">PackReal64Little</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">PACK_REAL</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">PackRealBig</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">PACK_REAL</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">PackRealLittle</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">PACK_REAL</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">PackWord16Big</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">PACK_WORD</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">PackWord16Little</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">PACK_WORD</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">PackWord32Big</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">PACK_WORD</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">PackWord32Little</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">PACK_WORD</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">PackWord64Big</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">PACK_WORD</span><span class="w"></span>
<span class="w">      </span><span class="k">structure</span><span class="w"> </span><span class="n">PackWord64Little</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">PACK_WORD</span><span class="w"></span>
<span class="w">   </span><span class="k">end</span><span class="w"></span>
</pre></div></div></div>
</div>
</div>
</div>
<div id="footnotes"><hr></div>
<div id="footer">
<div id="footer-text">
</div>
<div id="footer-badges">
</div>
</div>
</body>
</html>
