/usr/share/doc/mlton/guide/BasisLibrary is in mlton-doc 20100608-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 | <!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>
<a href = "TitleIndex">Index</a>
</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 -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 'a array</tt> <br>
<tt>datatype bool = false | true</tt> <br>
<tt>eqtype char</tt> <br>
<tt>type exn</tt> <br>
<tt>eqtype int</tt> <br>
<tt>datatype 'a list = nil | :: of ('a * 'a list)</tt> <br>
<tt>datatype 'a option = NONE | SOME of 'a</tt> <br>
<tt>datatype order = EQUAL | GREATER | LESS</tt> <br>
<tt>type real</tt> <br>
<tt>datatype 'a ref = ref of 'a</tt> <br>
<tt>eqtype string</tt> <br>
<tt>type substring</tt> <br>
<tt>eqtype unit</tt> <br>
<tt>eqtype 'a vector</tt> <br>
<tt>eqtype 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 of 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: string -> 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><></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><</tt>, <tt><=</tt>, <tt>></tt>, <tt>>=</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 Array: ARRAY</tt> <br>
<tt>structure Array2: ARRAY2</tt> <br>
<tt>structure ArraySlice: ARRAY_SLICE</tt> <br>
<tt>structure BinIO: BIN_IO</tt> <br>
<tt>structure BinPrimIO: PRIM_IO</tt> <br>
<tt>structure Bool: BOOL</tt> <br>
<tt>structure BoolArray: MONO_ARRAY</tt> <br>
<tt>structure BoolArray2: MONO_ARRAY2</tt> <br>
<tt>structure BoolArraySlice: MONO_ARRAY_SLICE</tt> <br>
<tt>structure BoolVector: MONO_VECTOR</tt> <br>
<tt>structure BoolVectorSlice: MONO_VECTOR_SLICE</tt> <br>
<tt>structure Byte: BYTE</tt> <br>
<tt>structure Char: 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 CharArray: MONO_ARRAY</tt> <br>
<tt>structure CharArray2: MONO_ARRAY2</tt> <br>
<tt>structure CharArraySlice: MONO_ARRAY_SLICE</tt> <br>
<tt>structure CharVector: MONO_VECTOR</tt> <br>
<tt>structure CharVectorSlice: MONO_VECTOR_SLICE</tt> <br>
<tt>structure CommandLine: COMMAND_LINE</tt> <br>
<tt>structure Date: 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 FixedInt: INTEGER</tt> <br>
<tt>structure General: GENERAL</tt> <br>
<tt>structure GenericSock: GENERIC_SOCK</tt> <br>
<tt>structure IEEEReal: IEEE_REAL</tt> <br>
<tt>structure INetSock: INET_SOCK</tt> <br>
<tt>structure IO: IO</tt> <br>
<tt>structure Int: INTEGER</tt> <br>
<tt>structure Int1: INTEGER</tt> <br>
<tt>structure Int2: INTEGER</tt> <br>
<tt>structure Int3: INTEGER</tt> <br>
<tt>structure Int4: INTEGER</tt> <br>
... <br>
<tt>structure Int31: INTEGER</tt> <br>
<tt>structure Int32: INTEGER</tt> <br>
<tt>structure Int64: INTEGER</tt> <br>
<tt>structure IntArray: MONO_ARRAY</tt> <br>
<tt>structure IntArray2: MONO_ARRAY2</tt> <br>
<tt>structure IntArraySlice: MONO_ARRAY_SLICE</tt> <br>
<tt>structure IntVector: MONO_VECTOR</tt> <br>
<tt>structure IntVectorSlice: MONO_VECTOR_SLICE</tt> <br>
<tt>structure Int8: INTEGER</tt> <br>
<tt>structure Int8Array: MONO_ARRAY</tt> <br>
<tt>structure Int8Array2: MONO_ARRAY2</tt> <br>
<tt>structure Int8ArraySlice: MONO_ARRAY_SLICE</tt> <br>
<tt>structure Int8Vector: MONO_VECTOR</tt> <br>
<tt>structure Int8VectorSlice: MONO_VECTOR_SLICE</tt> <br>
<tt>structure Int16: INTEGER</tt> <br>
<tt>structure Int16Array: MONO_ARRAY</tt> <br>
<tt>structure Int16Array2: MONO_ARRAY2</tt> <br>
<tt>structure Int16ArraySlice: MONO_ARRAY_SLICE</tt> <br>
<tt>structure Int16Vector: MONO_VECTOR</tt> <br>
<tt>structure Int16VectorSlice: MONO_VECTOR_SLICE</tt> <br>
<tt>structure Int32: INTEGER</tt> <br>
<tt>structure Int32Array: MONO_ARRAY</tt> <br>
<tt>structure Int32Array2: MONO_ARRAY2</tt> <br>
<tt>structure Int32ArraySlice: MONO_ARRAY_SLICE</tt> <br>
<tt>structure Int32Vector: MONO_VECTOR</tt> <br>
<tt>structure Int32VectorSlice: MONO_VECTOR_SLICE</tt> <br>
<tt>structure Int64Array: MONO_ARRAY</tt> <br>
<tt>structure Int64Array2: MONO_ARRAY2</tt> <br>
<tt>structure Int64ArraySlice: MONO_ARRAY_SLICE</tt> <br>
<tt>structure Int64Vector: MONO_VECTOR</tt> <br>
<tt>structure Int64VectorSlice: MONO_VECTOR_SLICE</tt> <br>
<tt>structure IntInf: INT_INF</tt> <br>
<tt>structure LargeInt: INTEGER</tt> <br>
<tt>structure LargeIntArray: MONO_ARRAY</tt> <br>
<tt>structure LargeIntArray2: MONO_ARRAY2</tt> <br>
<tt>structure LargeIntArraySlice: MONO_ARRAY_SLICE</tt> <br>
<tt>structure LargeIntVector: MONO_VECTOR</tt> <br>
<tt>structure LargeIntVectorSlice: MONO_VECTOR_SLICE</tt> <br>
<tt>structure LargeReal: REAL</tt> <br>
<tt>structure LargeRealArray: MONO_ARRAY</tt> <br>
<tt>structure LargeRealArray2: MONO_ARRAY2</tt> <br>
<tt>structure LargeRealArraySlice: MONO_ARRAY_SLICE</tt> <br>
<tt>structure LargeRealVector: MONO_VECTOR</tt> <br>
<tt>structure LargeRealVectorSlice: MONO_VECTOR_SLICE</tt> <br>
<tt>structure LargeWord: WORD</tt> <br>
<tt>structure LargeWordArray: MONO_ARRAY</tt> <br>
<tt>structure LargeWordArray2: MONO_ARRAY2</tt> <br>
<tt>structure LargeWordArraySlice: MONO_ARRAY_SLICE</tt> <br>
<tt>structure LargeWordVector: MONO_VECTOR</tt> <br>
<tt>structure LargeWordVectorSlice: MONO_VECTOR_SLICE</tt> <br>
<tt>structure List: LIST</tt> <br>
<tt>structure ListPair: LIST_PAIR</tt> <br>
<tt>structure Math: MATH</tt> <br>
<tt>structure NetHostDB: NET_HOST_DB</tt> <br>
<tt>structure NetProtDB: NET_PROT_DB</tt> <br>
<tt>structure NetServDB: NET_SERV_DB</tt> <br>
<tt>structure OS: OS</tt> <br>
<tt>structure Option: OPTION</tt> <br>
<tt>structure PackReal32Big: PACK_REAL</tt> <br>
<tt>structure PackReal32Little: PACK_REAL</tt> <br>
<tt>structure PackReal64Big: PACK_REAL</tt> <br>
<tt>structure PackReal64Little: PACK_REAL</tt> <br>
<tt>structure PackRealBig: PACK_REAL</tt> <br>
<tt>structure PackRealLittle: PACK_REAL</tt> <br>
<tt>structure PackWord16Big: PACK_WORD</tt> <br>
<tt>structure PackWord16Little: PACK_WORD</tt> <br>
<tt>structure PackWord32Big: PACK_WORD</tt> <br>
<tt>structure PackWord32Little: PACK_WORD</tt> <br>
<tt>structure PackWord64Big: PACK_WORD</tt> <br>
<tt>structure PackWord64Little: PACK_WORD</tt> <br>
<tt>structure Position: INTEGER</tt> <br>
<tt>structure Posix: POSIX</tt> <br>
<tt>structure Real: REAL</tt> <br>
<tt>structure RealArray: MONO_ARRAY</tt> <br>
<tt>structure RealArray2: MONO_ARRAY2</tt> <br>
<tt>structure RealArraySlice: MONO_ARRAY_SLICE</tt> <br>
<tt>structure RealVector: MONO_VECTOR</tt> <br>
<tt>structure RealVectorSlice: MONO_VECTOR_SLICE</tt> <br>
<tt>structure Real32: REAL</tt> <br>
<tt>structure Real32Array: MONO_ARRAY</tt> <br>
<tt>structure Real32Array2: MONO_ARRAY2</tt> <br>
<tt>structure Real32ArraySlice: MONO_ARRAY_SLICE</tt> <br>
<tt>structure Real32Vector: MONO_VECTOR</tt> <br>
<tt>structure Real32VectorSlice: MONO_VECTOR_SLICE</tt> <br>
<tt>structure Real64: REAL</tt> <br>
<tt>structure Real64Array: MONO_ARRAY</tt> <br>
<tt>structure Real64Array2: MONO_ARRAY2</tt> <br>
<tt>structure Real64ArraySlice: MONO_ARRAY_SLICE</tt> <br>
<tt>structure Real64Vector: MONO_VECTOR</tt> <br>
<tt>structure Real64VectorSlice: MONO_VECTOR_SLICE</tt> <br>
<tt>structure Socket: 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 String: STRING</tt>
</p>
<ul>
<li>
<p>
The <tt>String</tt> functions do not depend on locale.
</p>
</li>
</ul>
<p>
<tt>structure StringCvt: STRING_CVT</tt> <br>
<tt>structure Substring: SUBSTRING</tt> <br>
<tt>structure SysWord: WORD</tt> <br>
<tt>structure Text: TEXT</tt> <br>
<tt>structure TextIO: TEXT_IO</tt> <br>
<tt>structure TextPrimIO: PRIM_IO</tt> <br>
<tt>structure Time: TIME</tt> <br>
<tt>structure Timer: TIMER</tt> <br>
<tt>structure Unix: UNIX</tt> <br>
<tt>structure UnixSock: UNIX_SOCK</tt> <br>
<tt>structure Vector: VECTOR</tt> <br>
<tt>structure VectorSlice: VECTOR_SLICE</tt> <br>
<tt>structure Word: WORD</tt> <br>
<tt>structure Word1: WORD</tt> <br>
<tt>structure Word2: WORD</tt> <br>
<tt>structure Word3: WORD</tt> <br>
<tt>structure Word4: WORD</tt> <br>
... <br>
<tt>structure Word31: WORD</tt> <br>
<tt>structure Word32: WORD</tt> <br>
<tt>structure Word64: WORD</tt> <br>
<tt>structure WordArray: MONO_ARRAY</tt> <br>
<tt>structure WordArray2: MONO_ARRAY2</tt> <br>
<tt>structure WordArraySlice: MONO_ARRAY_SLICE</tt> <br>
<tt>structure WordVectorSlice: MONO_VECTOR_SLICE</tt> <br>
<tt>structure WordVector: MONO_VECTOR</tt> <br>
<tt>structure Word8Array: MONO_ARRAY</tt> <br>
<tt>structure Word8Array2: MONO_ARRAY2</tt> <br>
<tt>structure Word8ArraySlice: MONO_ARRAY_SLICE</tt> <br>
<tt>structure Word8Vector: MONO_VECTOR</tt> <br>
<tt>structure Word8VectorSlice: MONO_VECTOR_SLICE</tt> <br>
<tt>structure Word16Array: MONO_ARRAY</tt> <br>
<tt>structure Word16Array2: MONO_ARRAY2</tt> <br>
<tt>structure Word16ArraySlice: MONO_ARRAY_SLICE</tt> <br>
<tt>structure Word16Vector: MONO_VECTOR</tt> <br>
<tt>structure Word16VectorSlice: MONO_VECTOR_SLICE</tt> <br>
<tt>structure Word32Array: MONO_ARRAY</tt> <br>
<tt>structure Word32Array2: MONO_ARRAY2</tt> <br>
<tt>structure Word32ArraySlice: MONO_ARRAY_SLICE</tt> <br>
<tt>structure Word32Vector: MONO_VECTOR</tt> <br>
<tt>structure Word32VectorSlice: MONO_VECTOR_SLICE</tt> <br>
<tt>structure Word64Array: MONO_ARRAY</tt> <br>
<tt>structure Word64Array2: MONO_ARRAY2</tt> <br>
<tt>structure Word64ArraySlice: MONO_ARRAY_SLICE</tt> <br>
<tt>structure Word64Vector: MONO_VECTOR</tt> <br>
<tt>structure Word64VectorSlice: 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 </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 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>
|