<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta name="robots" content="index,nofollow">



<title>BasisLibrary - MLton Standard ML Compiler (SML Compiler)</title>
<link rel="stylesheet" type="text/css" charset="iso-8859-1" media="all" href="common.css">
<link rel="stylesheet" type="text/css" charset="iso-8859-1" media="screen" href="screen.css">
<link rel="stylesheet" type="text/css" charset="iso-8859-1" media="print" href="print.css">


<link rel="Start" href="Home">


</head>

<body lang="en" dir="ltr">

<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-833377-1";
urchinTracker();
</script>
<table bgcolor = lightblue cellspacing = 0 style = "border: 0px;" width = 100%>
  <tr>
    <td style = "
		border: 0px;
		color: darkblue; 
		font-size: 150%;
		text-align: left;">
      <a class = mltona href="Home">MLton MLTONWIKIVERSION</a>
    <td style = "
		border: 0px;
		font-size: 150%;
		text-align: center;
		width: 50%;">
      BasisLibrary
    <td style = "
		border: 0px;
		text-align: right;">
      <table cellspacing = 0 style = "border: 0px">
        <tr style = "vertical-align: middle;">
      </table>
  <tr style = "background-color: white;">
    <td colspan = 3
	style = "
		border: 0px;
		font-size:70%;
		text-align: right;">
      <a href = "Home">Home</a>
      &nbsp;<a href = "Index">Index</a>
      &nbsp;
</table>
<div id="content" lang="en" dir="ltr">
The <a href="StandardML">Standard ML</a> Basis Library is a collection of modules dealing with basic types, input/output, OS interfaces, and simple datatypes.  It is intended as a portable library usable across all implementations of SML.  The official online version of the Basis Library specification is at <a class="external" href="http://www.standardml.org/Basis/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">http://www.standardml.org/Basis/</a>.  We keep a copy at <a class="external" href="http://mlton.org/basis/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">http://mlton.org/basis/</a>.  There is a  <a href = "References#GansnerReppy04"> book</a> that includes all of the online version and more.  For a reverse chronological list of changes to the specification, see <a class="external" href="http://www.standardml.org/Basis/history.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">http://www.standardml.org/Basis/history.html</a>. <p>
MLton implements all of the required portions of the Basis Library. MLton also implements many of the optional structures.  You can obtain a complete and current list of what's available using  <tt>mlton&nbsp;-show-basis</tt> (see <a href="ShowBasis">ShowBasis</a>).  By default, MLton makes the Basis Library available to user programs.  You can also <a href="MLBasisAvailableLibraries">access the Basis Library</a> from <a href="MLBasis"> ML Basis</a> files. 
</p>
<p>
Below is a complete list of what MLton implements. 
</p>
<p>
<ol>
<li>
<a href="#head-70fc2366a62cb01199100a964219491009c92c85">Top-level types and constructors</a></li>
<li>
<a href="#head-f3c583ffa7ae975564fe862325a230f0750a322b">Top-level exception constructors</a></li>
<li>
<a href="#head-ee76afd3593ec7eebc14e2997b54ea6c04a954e4">Top-level values</a></li>
<li>
<a href="#head-e7c522e93b83af8b25a4e0082f6849c2de12c363">Overloaded identifiers</a></li>
<li>
<a href="#head-82711a51cf5a5c66b9e97529f31b2a608b0d9f96">Top-level signatures</a></li>
<li>
<a href="#head-82cd3eec71dfcc66e035e18592934036165aa125">Top-level structures</a></li>
<li>
<a href="#head-e38fb58e344e0ee67d4aa08c60df9fbd642e8e1c">Top-level functors</a></li>
<li>
<a href="#head-0ac17def4aced0cc961aa5b65385be04cfcf6eb5">Type equivalences</a></li>
<li>
<a href="#head-bc488aeca21efb00463538004d56839b48f23e7d">Real and Math functions</a></li>
</ol>

 
</p>
<h2 id="head-70fc2366a62cb01199100a964219491009c92c85">Top-level types and constructors</h2>
<p>
<tt>eqtype&nbsp;'a&nbsp;array</tt> <br>
<tt>datatype&nbsp;bool&nbsp;=&nbsp;false&nbsp;|&nbsp;true</tt> <br>
<tt>eqtype&nbsp;char</tt> <br>
<tt>type&nbsp;exn</tt> <br>
<tt>eqtype&nbsp;int</tt> <br>
<tt>datatype&nbsp;'a&nbsp;list&nbsp;=&nbsp;nil&nbsp;|&nbsp;::&nbsp;of&nbsp;('a&nbsp;*&nbsp;'a&nbsp;list)</tt> <br>
<tt>datatype&nbsp;'a&nbsp;option&nbsp;=&nbsp;NONE&nbsp;|&nbsp;SOME&nbsp;of&nbsp;'a</tt> <br>
<tt>datatype&nbsp;order&nbsp;=&nbsp;EQUAL&nbsp;|&nbsp;GREATER&nbsp;|&nbsp;LESS</tt> <br>
<tt>type&nbsp;real</tt> <br>
<tt>datatype&nbsp;'a&nbsp;ref&nbsp;=&nbsp;ref&nbsp;of&nbsp;'a</tt> <br>
<tt>eqtype&nbsp;string</tt> <br>
<tt>type&nbsp;substring</tt> <br>
<tt>eqtype&nbsp;unit</tt> <br>
<tt>eqtype&nbsp;'a&nbsp;vector</tt> <br>
<tt>eqtype&nbsp;word</tt> 
</p>
<h2 id="head-f3c583ffa7ae975564fe862325a230f0750a322b">Top-level exception constructors</h2>
<p>
<tt>Bind</tt> <br>
<tt>Chr</tt> <br>
<tt>Div</tt> <br>
<tt>Domain</tt> <br>
<tt>Empty</tt> <br>
<tt>Fail&nbsp;of&nbsp;string</tt> <br>
<tt>Match</tt> <br>
<tt>Option</tt> <br>
<tt>Overflow</tt> <br>
<tt>Size</tt> <br>
<tt>Span</tt> <br>
<tt>Subscript</tt> 
</p>
<h2 id="head-ee76afd3593ec7eebc14e2997b54ea6c04a954e4">Top-level values</h2>
<p>
MLton does not implement the optional top-level value  <tt>use:&nbsp;string&nbsp;-&gt;&nbsp;unit</tt>, which conflicts with whole-program compilation because it allows new code to be loaded dynamically. MLton implements all other top-level values: 
</p>
<p>
<tt>!</tt>, <tt>:=</tt>, <tt>&lt;&gt;</tt>, <tt>=</tt>, <tt>@</tt>, <tt>^</tt>, <tt>app</tt>, <tt>before</tt>, <tt>ceil</tt>, <tt>chr</tt>, <tt>concat</tt>, <tt>exnMessage</tt>, <tt>exnName</tt>, <tt>explode</tt>, <tt>floor</tt>, <tt>foldl</tt>, <tt>foldr</tt>, <tt>getOpt</tt>, <tt>hd</tt>, <tt>ignore</tt>, <tt>implode</tt>, <tt>isSome</tt>, <tt>length</tt>, <tt>map</tt>, <tt>not</tt>, <tt>null</tt>, <tt>o</tt>, <tt>ord</tt>, <tt>print</tt>, <tt>real</tt>, <tt>rev</tt>, <tt>round</tt>, <tt>size</tt>, <tt>str</tt>, <tt>substring</tt>, <tt>tl</tt>, <tt>trunc</tt>, <tt>valOf</tt>, <tt>vector</tt>. 
</p>
<h2 id="head-e7c522e93b83af8b25a4e0082f6849c2de12c363">Overloaded identifiers</h2>
<p>
<tt>*</tt>, <tt>+</tt>, <tt>-</tt>, <tt>/</tt>, <tt>&lt;</tt>, <tt>&lt;=</tt>, <tt>&gt;</tt>, <tt>&gt;=</tt>, <tt>~</tt>, <tt>abs</tt>, <tt>div</tt>, <tt>mod</tt>. 
</p>
<h2 id="head-82711a51cf5a5c66b9e97529f31b2a608b0d9f96">Top-level signatures</h2>
<p>
<tt>ARRAY</tt> <br>
<tt>ARRAY2</tt> <br>
<tt>ARRAY_SLICE</tt> <br>
<tt>BIN_IO</tt> <br>
<tt>BIT_FLAGS</tt> <br>
<tt>BOOL</tt> <br>
<tt>BYTE</tt> <br>
<tt>CHAR</tt> <br>
<tt>COMMAND_LINE</tt> <br>
<tt>DATE</tt> <br>
<tt>GENERAL</tt> <br>
<tt>GENERIC_SOCK</tt> <br>
<tt>IEEE_REAL</tt> <br>
<tt>IMPERATIVE_IO</tt> <br>
<tt>INET_SOCK</tt> <br>
<tt>INTEGER</tt> <br>
<tt>INT_INF</tt> <br>
<tt>IO</tt> <br>
<tt>LIST</tt> <br>
<tt>LIST_PAIR</tt> <br>
<tt>MATH</tt> <br>
<tt>MONO_ARRAY</tt> <br>
<tt>MONO_ARRAY2</tt> <br>
<tt>MONO_ARRAY_SLICE</tt> <br>
<tt>MONO_VECTOR</tt> <br>
<tt>MONO_VECTOR_SLICE</tt> <br>
<tt>NET_HOST_DB</tt> <br>
<tt>NET_PROT_DB</tt> <br>
<tt>NET_SERV_DB</tt> <br>
<tt>OPTION</tt> <br>
<tt>OS</tt> <br>
<tt>OS_FILE_SYS</tt> <br>
<tt>OS_IO</tt> <br>
<tt>OS_PATH</tt> <br>
<tt>OS_PROCESS</tt> <br>
<tt>PACK_REAL</tt> <br>
<tt>PACK_WORD</tt> <br>
<tt>POSIX</tt> <br>
<tt>POSIX_ERROR</tt> <br>
<tt>POSIX_FILE_SYS</tt> <br>
<tt>POSIX_IO</tt> <br>
<tt>POSIX_PROCESS</tt> <br>
<tt>POSIX_PROC_ENV</tt> <br>
<tt>POSIX_SIGNAL</tt> <br>
<tt>POSIX_SYS_DB</tt> <br>
<tt>POSIX_TTY</tt> <br>
<tt>PRIM_IO</tt> <br>
<tt>REAL</tt> <br>
<tt>SOCKET</tt> <br>
<tt>STREAM_IO</tt> <br>
<tt>STRING</tt> <br>
<tt>STRING_CVT</tt> <br>
<tt>SUBSTRING</tt> <br>
<tt>TEXT</tt> <br>
<tt>TEXT_IO</tt> <br>
<tt>TEXT_STREAM_IO</tt> <br>
<tt>TIME</tt> <br>
<tt>TIMER</tt> <br>
<tt>UNIX</tt> <br>
<tt>UNIX_SOCK</tt> <br>
<tt>VECTOR</tt> <br>
<tt>VECTOR_SLICE</tt> <br>
<tt>WORD</tt> 
</p>
<h2 id="head-82cd3eec71dfcc66e035e18592934036165aa125">Top-level structures</h2>
<p>
<tt>structure&nbsp;Array:&nbsp;ARRAY</tt> <br>
<tt>structure&nbsp;Array2:&nbsp;ARRAY2</tt> <br>
<tt>structure&nbsp;ArraySlice:&nbsp;ARRAY_SLICE</tt> <br>
<tt>structure&nbsp;BinIO:&nbsp;BIN_IO</tt> <br>
<tt>structure&nbsp;BinPrimIO:&nbsp;PRIM_IO</tt> <br>
<tt>structure&nbsp;Bool:&nbsp;BOOL</tt> <br>
<tt>structure&nbsp;BoolArray:&nbsp;MONO_ARRAY</tt> <br>
<tt>structure&nbsp;BoolArray2:&nbsp;MONO_ARRAY2</tt> <br>
<tt>structure&nbsp;BoolArraySlice:&nbsp;MONO_ARRAY_SLICE</tt> <br>
<tt>structure&nbsp;BoolVector:&nbsp;MONO_VECTOR</tt> <br>
<tt>structure&nbsp;BoolVectorSlice:&nbsp;MONO_VECTOR_SLICE</tt> <br>
<tt>structure&nbsp;Byte:&nbsp;BYTE</tt> <br>
<tt>structure&nbsp;Char:&nbsp;CHAR</tt> 
</p>

    <ul>

    <li>
<p>
 <tt>Char</tt> characters correspond to ISO-8859-1.  The <tt>Char</tt> functions do not depend on locale. 
</p>
</li>

    </ul>


<p>
<tt>structure&nbsp;CharArray:&nbsp;MONO_ARRAY</tt> <br>
<tt>structure&nbsp;CharArray2:&nbsp;MONO_ARRAY2</tt> <br>
<tt>structure&nbsp;CharArraySlice:&nbsp;MONO_ARRAY_SLICE</tt> <br>
<tt>structure&nbsp;CharVector:&nbsp;MONO_VECTOR</tt> <br>
<tt>structure&nbsp;CharVectorSlice:&nbsp;MONO_VECTOR_SLICE</tt> <br>
<tt>structure&nbsp;CommandLine:&nbsp;COMMAND_LINE</tt> <br>
<tt>structure&nbsp;Date:&nbsp;DATE</tt> 
</p>

    <ul>

    <li>
<p>
 <tt>Date.fromString</tt> and <tt>Date.scan</tt> accept a space in addition to a zero for the first character of the day of the month.  The Basis Library specification only allows a zero. 
</p>
</li>

    </ul>


<p>
<tt>structure&nbsp;FixedInt:&nbsp;INTEGER</tt> <br>
<tt>structure&nbsp;General:&nbsp;GENERAL</tt> <br>
<tt>structure&nbsp;GenericSock:&nbsp;GENERIC_SOCK</tt> <br>
<tt>structure&nbsp;IEEEReal:&nbsp;IEEE_REAL</tt> <br>
<tt>structure&nbsp;INetSock:&nbsp;INET_SOCK</tt> <br>
<tt>structure&nbsp;IO:&nbsp;IO</tt> <br>
<tt>structure&nbsp;Int:&nbsp;INTEGER</tt> <br>
<tt>structure&nbsp;Int1:&nbsp;INTEGER</tt> <br>
<tt>structure&nbsp;Int2:&nbsp;INTEGER</tt> <br>
<tt>structure&nbsp;Int3:&nbsp;INTEGER</tt> <br>
<tt>structure&nbsp;Int4:&nbsp;INTEGER</tt> <br>
... <br>
<tt>structure&nbsp;Int31:&nbsp;INTEGER</tt> <br>
<tt>structure&nbsp;Int32:&nbsp;INTEGER</tt> <br>
<tt>structure&nbsp;Int64:&nbsp;INTEGER</tt> <br>
<tt>structure&nbsp;IntArray:&nbsp;MONO_ARRAY</tt> <br>
<tt>structure&nbsp;IntArray2:&nbsp;MONO_ARRAY2</tt> <br>
<tt>structure&nbsp;IntArraySlice:&nbsp;MONO_ARRAY_SLICE</tt> <br>
<tt>structure&nbsp;IntVector:&nbsp;MONO_VECTOR</tt> <br>
<tt>structure&nbsp;IntVectorSlice:&nbsp;MONO_VECTOR_SLICE</tt> <br>
<tt>structure&nbsp;Int8:&nbsp;INTEGER</tt> <br>
<tt>structure&nbsp;Int8Array:&nbsp;MONO_ARRAY</tt> <br>
<tt>structure&nbsp;Int8Array2:&nbsp;MONO_ARRAY2</tt> <br>
<tt>structure&nbsp;Int8ArraySlice:&nbsp;MONO_ARRAY_SLICE</tt> <br>
<tt>structure&nbsp;Int8Vector:&nbsp;MONO_VECTOR</tt> <br>
<tt>structure&nbsp;Int8VectorSlice:&nbsp;MONO_VECTOR_SLICE</tt> <br>
<tt>structure&nbsp;Int16:&nbsp;INTEGER</tt> <br>
<tt>structure&nbsp;Int16Array:&nbsp;MONO_ARRAY</tt> <br>
<tt>structure&nbsp;Int16Array2:&nbsp;MONO_ARRAY2</tt> <br>
<tt>structure&nbsp;Int16ArraySlice:&nbsp;MONO_ARRAY_SLICE</tt> <br>
<tt>structure&nbsp;Int16Vector:&nbsp;MONO_VECTOR</tt> <br>
<tt>structure&nbsp;Int16VectorSlice:&nbsp;MONO_VECTOR_SLICE</tt> <br>
<tt>structure&nbsp;Int32:&nbsp;INTEGER</tt> <br>
<tt>structure&nbsp;Int32Array:&nbsp;MONO_ARRAY</tt> <br>
<tt>structure&nbsp;Int32Array2:&nbsp;MONO_ARRAY2</tt> <br>
<tt>structure&nbsp;Int32ArraySlice:&nbsp;MONO_ARRAY_SLICE</tt> <br>
<tt>structure&nbsp;Int32Vector:&nbsp;MONO_VECTOR</tt> <br>
<tt>structure&nbsp;Int32VectorSlice:&nbsp;MONO_VECTOR_SLICE</tt> <br>
<tt>structure&nbsp;Int64Array:&nbsp;MONO_ARRAY</tt> <br>
<tt>structure&nbsp;Int64Array2:&nbsp;MONO_ARRAY2</tt> <br>
<tt>structure&nbsp;Int64ArraySlice:&nbsp;MONO_ARRAY_SLICE</tt> <br>
<tt>structure&nbsp;Int64Vector:&nbsp;MONO_VECTOR</tt> <br>
<tt>structure&nbsp;Int64VectorSlice:&nbsp;MONO_VECTOR_SLICE</tt> <br>
<tt>structure&nbsp;IntInf:&nbsp;INT_INF</tt> <br>
<tt>structure&nbsp;LargeInt:&nbsp;INTEGER</tt> <br>
<tt>structure&nbsp;LargeIntArray:&nbsp;MONO_ARRAY</tt> <br>
<tt>structure&nbsp;LargeIntArray2:&nbsp;MONO_ARRAY2</tt> <br>
<tt>structure&nbsp;LargeIntArraySlice:&nbsp;MONO_ARRAY_SLICE</tt> <br>
<tt>structure&nbsp;LargeIntVector:&nbsp;MONO_VECTOR</tt> <br>
<tt>structure&nbsp;LargeIntVectorSlice:&nbsp;MONO_VECTOR_SLICE</tt> <br>
<tt>structure&nbsp;LargeReal:&nbsp;REAL</tt> <br>
<tt>structure&nbsp;LargeRealArray:&nbsp;MONO_ARRAY</tt> <br>
<tt>structure&nbsp;LargeRealArray2:&nbsp;MONO_ARRAY2</tt> <br>
<tt>structure&nbsp;LargeRealArraySlice:&nbsp;MONO_ARRAY_SLICE</tt> <br>
<tt>structure&nbsp;LargeRealVector:&nbsp;MONO_VECTOR</tt> <br>
<tt>structure&nbsp;LargeRealVectorSlice:&nbsp;MONO_VECTOR_SLICE</tt> <br>
<tt>structure&nbsp;LargeWord:&nbsp;WORD</tt> <br>
<tt>structure&nbsp;LargeWordArray:&nbsp;MONO_ARRAY</tt> <br>
<tt>structure&nbsp;LargeWordArray2:&nbsp;MONO_ARRAY2</tt> <br>
<tt>structure&nbsp;LargeWordArraySlice:&nbsp;MONO_ARRAY_SLICE</tt> <br>
<tt>structure&nbsp;LargeWordVector:&nbsp;MONO_VECTOR</tt> <br>
<tt>structure&nbsp;LargeWordVectorSlice:&nbsp;MONO_VECTOR_SLICE</tt> <br>
<tt>structure&nbsp;List:&nbsp;LIST</tt> <br>
<tt>structure&nbsp;ListPair:&nbsp;LIST_PAIR</tt> <br>
<tt>structure&nbsp;Math:&nbsp;MATH</tt> <br>
<tt>structure&nbsp;NetHostDB:&nbsp;NET_HOST_DB</tt> <br>
<tt>structure&nbsp;NetProtDB:&nbsp;NET_PROT_DB</tt> <br>
<tt>structure&nbsp;NetServDB:&nbsp;NET_SERV_DB</tt> <br>
<tt>structure&nbsp;OS:&nbsp;OS</tt> <br>
<tt>structure&nbsp;Option:&nbsp;OPTION</tt> <br>
<tt>structure&nbsp;PackReal32Big:&nbsp;PACK_REAL</tt> <br>
<tt>structure&nbsp;PackReal32Little:&nbsp;PACK_REAL</tt> <br>
<tt>structure&nbsp;PackReal64Big:&nbsp;PACK_REAL</tt> <br>
<tt>structure&nbsp;PackReal64Little:&nbsp;PACK_REAL</tt> <br>
<tt>structure&nbsp;PackRealBig:&nbsp;PACK_REAL</tt> <br>
<tt>structure&nbsp;PackRealLittle:&nbsp;PACK_REAL</tt> <br>
<tt>structure&nbsp;PackWord16Big:&nbsp;PACK_WORD</tt> <br>
<tt>structure&nbsp;PackWord16Little:&nbsp;PACK_WORD</tt> <br>
<tt>structure&nbsp;PackWord32Big:&nbsp;PACK_WORD</tt> <br>
<tt>structure&nbsp;PackWord32Little:&nbsp;PACK_WORD</tt> <br>
<tt>structure&nbsp;PackWord64Big:&nbsp;PACK_WORD</tt> <br>
<tt>structure&nbsp;PackWord64Little:&nbsp;PACK_WORD</tt> <br>
<tt>structure&nbsp;Position:&nbsp;INTEGER</tt> <br>
<tt>structure&nbsp;Posix:&nbsp;POSIX</tt> <br>
<tt>structure&nbsp;Real:&nbsp;REAL</tt> <br>
<tt>structure&nbsp;RealArray:&nbsp;MONO_ARRAY</tt> <br>
<tt>structure&nbsp;RealArray2:&nbsp;MONO_ARRAY2</tt> <br>
<tt>structure&nbsp;RealArraySlice:&nbsp;MONO_ARRAY_SLICE</tt> <br>
<tt>structure&nbsp;RealVector:&nbsp;MONO_VECTOR</tt> <br>
<tt>structure&nbsp;RealVectorSlice:&nbsp;MONO_VECTOR_SLICE</tt> <br>
<tt>structure&nbsp;Real32:&nbsp;REAL</tt> <br>
<tt>structure&nbsp;Real32Array:&nbsp;MONO_ARRAY</tt> <br>
<tt>structure&nbsp;Real32Array2:&nbsp;MONO_ARRAY2</tt> <br>
<tt>structure&nbsp;Real32ArraySlice:&nbsp;MONO_ARRAY_SLICE</tt> <br>
<tt>structure&nbsp;Real32Vector:&nbsp;MONO_VECTOR</tt> <br>
<tt>structure&nbsp;Real32VectorSlice:&nbsp;MONO_VECTOR_SLICE</tt> <br>
<tt>structure&nbsp;Real64:&nbsp;REAL</tt> <br>
<tt>structure&nbsp;Real64Array:&nbsp;MONO_ARRAY</tt> <br>
<tt>structure&nbsp;Real64Array2:&nbsp;MONO_ARRAY2</tt> <br>
<tt>structure&nbsp;Real64ArraySlice:&nbsp;MONO_ARRAY_SLICE</tt> <br>
<tt>structure&nbsp;Real64Vector:&nbsp;MONO_VECTOR</tt> <br>
<tt>structure&nbsp;Real64VectorSlice:&nbsp;MONO_VECTOR_SLICE</tt> <br>
<tt>structure&nbsp;Socket:&nbsp;SOCKET</tt> 
</p>

    <ul>

    <li>
<p>
 The Basis Library specification requires functions like <tt>Socket.sendVec</tt> to  raise an exception if they fail.  However, on some platforms, sending  to a socket that hasn't yet been connected causes a <tt>SIGPIPE</tt> signal,  which invokes the default signal handler for <tt>SIGPIPE</tt> and causes the  program to terminate.  If you want the exception to be raised, you  can ignore <tt>SIGPIPE</tt> by adding the following to your program.  
<pre class=code>
<B><FONT COLOR="#A020F0">let</FONT></B>
   <B><FONT COLOR="#A020F0">open</FONT></B> MLton.Signal
<B><FONT COLOR="#A020F0">in</FONT></B>
   setHandler (Posix.Signal.pipe, Handler.ignore)
<B><FONT COLOR="#A020F0">end</FONT></B>
</PRE>
 
</p>
</li>

    </ul>


<p>
<tt>structure&nbsp;String:&nbsp;STRING</tt> 
</p>

    <ul>

    <li>
<p>
 The <tt>String</tt> functions do not depend on locale. 
</p>
</li>

    </ul>


<p>
<tt>structure&nbsp;StringCvt:&nbsp;STRING_CVT</tt> <br>
<tt>structure&nbsp;Substring:&nbsp;SUBSTRING</tt> <br>
<tt>structure&nbsp;SysWord:&nbsp;WORD</tt> <br>
<tt>structure&nbsp;Text:&nbsp;TEXT</tt> <br>
<tt>structure&nbsp;TextIO:&nbsp;TEXT_IO</tt> <br>
<tt>structure&nbsp;TextPrimIO:&nbsp;PRIM_IO</tt> <br>
<tt>structure&nbsp;Time:&nbsp;TIME</tt> <br>
<tt>structure&nbsp;Timer:&nbsp;TIMER</tt> <br>
<tt>structure&nbsp;Unix:&nbsp;UNIX</tt> <br>
<tt>structure&nbsp;UnixSock:&nbsp;UNIX_SOCK</tt> <br>
<tt>structure&nbsp;Vector:&nbsp;VECTOR</tt> <br>
<tt>structure&nbsp;VectorSlice:&nbsp;VECTOR_SLICE</tt> <br>
<tt>structure&nbsp;Word:&nbsp;WORD</tt> <br>
<tt>structure&nbsp;Word1:&nbsp;WORD</tt> <br>
<tt>structure&nbsp;Word2:&nbsp;WORD</tt> <br>
<tt>structure&nbsp;Word3:&nbsp;WORD</tt> <br>
<tt>structure&nbsp;Word4:&nbsp;WORD</tt> <br>
... <br>
<tt>structure&nbsp;Word31:&nbsp;WORD</tt> <br>
<tt>structure&nbsp;Word32:&nbsp;WORD</tt> <br>
<tt>structure&nbsp;Word64:&nbsp;WORD</tt> <br>
<tt>structure&nbsp;WordArray:&nbsp;MONO_ARRAY</tt> <br>
<tt>structure&nbsp;WordArray2:&nbsp;MONO_ARRAY2</tt> <br>
<tt>structure&nbsp;WordArraySlice:&nbsp;MONO_ARRAY_SLICE</tt> <br>
<tt>structure&nbsp;WordVectorSlice:&nbsp;MONO_VECTOR_SLICE</tt> <br>
<tt>structure&nbsp;WordVector:&nbsp;MONO_VECTOR</tt> <br>
<tt>structure&nbsp;Word8Array:&nbsp;MONO_ARRAY</tt> <br>
<tt>structure&nbsp;Word8Array2:&nbsp;MONO_ARRAY2</tt> <br>
<tt>structure&nbsp;Word8ArraySlice:&nbsp;MONO_ARRAY_SLICE</tt> <br>
<tt>structure&nbsp;Word8Vector:&nbsp;MONO_VECTOR</tt> <br>
<tt>structure&nbsp;Word8VectorSlice:&nbsp;MONO_VECTOR_SLICE</tt> <br>
<tt>structure&nbsp;Word16Array:&nbsp;MONO_ARRAY</tt> <br>
<tt>structure&nbsp;Word16Array2:&nbsp;MONO_ARRAY2</tt> <br>
<tt>structure&nbsp;Word16ArraySlice:&nbsp;MONO_ARRAY_SLICE</tt> <br>
<tt>structure&nbsp;Word16Vector:&nbsp;MONO_VECTOR</tt> <br>
<tt>structure&nbsp;Word16VectorSlice:&nbsp;MONO_VECTOR_SLICE</tt> <br>
<tt>structure&nbsp;Word32Array:&nbsp;MONO_ARRAY</tt> <br>
<tt>structure&nbsp;Word32Array2:&nbsp;MONO_ARRAY2</tt> <br>
<tt>structure&nbsp;Word32ArraySlice:&nbsp;MONO_ARRAY_SLICE</tt> <br>
<tt>structure&nbsp;Word32Vector:&nbsp;MONO_VECTOR</tt> <br>
<tt>structure&nbsp;Word32VectorSlice:&nbsp;MONO_VECTOR_SLICE</tt> <br>
<tt>structure&nbsp;Word64Array:&nbsp;MONO_ARRAY</tt> <br>
<tt>structure&nbsp;Word64Array2:&nbsp;MONO_ARRAY2</tt> <br>
<tt>structure&nbsp;Word64ArraySlice:&nbsp;MONO_ARRAY_SLICE</tt> <br>
<tt>structure&nbsp;Word64Vector:&nbsp;MONO_VECTOR</tt> <br>
<tt>structure&nbsp;Word64VectorSlice:&nbsp;MONO_VECTOR_SLICE</tt> 
</p>
<h2 id="head-e38fb58e344e0ee67d4aa08c60df9fbd642e8e1c">Top-level functors</h2>
<p>
<tt>ImperativeIO</tt> <br>
<tt>PrimIO</tt> <br>
<tt>StreamIO</tt> 
</p>

    <ul>

    <li>
<p>
 MLton's <tt>StreamIO</tt> functor takes structures <tt>ArraySlice</tt>  and <tt>VectorSlice</tt> in addition to the arguments specified in the  Basis Library specification. 
</p>
</li>

    </ul>


<h2 id="head-0ac17def4aced0cc961aa5b65385be04cfcf6eb5">Type equivalences</h2>
<p>
The following types are equivalent. 
<pre>FixedInt = Int64.int
LargeInt = IntInf.int
LargeReal.real = Real64.real
LargeWord = Word64.word
</pre>
</p>
<p>
The default <tt>int</tt>, <tt>real</tt>, and <tt>word</tt> types may be set by the <tt>-default-type&nbsp;</tt><em>type</em> <a href="CompileTimeOptions"> compiler option</a>.  By default, the following types are equivalent: 
<pre>int = Int.int = Int32.int
real = Real.real = Real64.real
word = Word.word = Word32.word
</pre>
</p>
<h2 id="head-bc488aeca21efb00463538004d56839b48f23e7d">Real and Math functions</h2>
<p>
The <tt>Real</tt>, <tt>Real32</tt>, and <tt>Real64</tt> modules are implemented using the <tt>C</tt> math library, so the SML functions will reflect the behavior of the underlying library function.  We have made some effort to unify the differences between the math libraries on different platforms, and in particular to handle exceptional cases according to the Basis Library specification.  However, there will be differences due to different numerical algorithms and cases we may have missed. Please submit a <a href="Bug">bug report</a> if you encounter an error in the handling of an exceptional case. 
</p>
<p>
On x86, real arithmetic is implemented internally using 80 bits of precision.  Using higher precision for intermediate results in computations can lead to different results than if all the computation is done at 32 or 64 bits.  If you require strict IEEE compliance, you can compile with <tt>-ieee-fp&nbsp;true</tt>, which will cause intermediate results to be stored after each operation.  This may cause a substantial performance penalty. 
</p>
</div>



<p>
<hr>
Last edited on 2007-08-23 03:19:17 by <span title="c-71-57-91-146.hsd1.il.comcast.net"><a href="MatthewFluet">MatthewFluet</a></span>.
</body></html>
