[MLton-commit] r4070

Stephen Weeks MLton@mlton.org
Mon, 5 Sep 2005 21:19:19 -0700


First attempt at running grab-wiki.

----------------------------------------------------------------------

A   mlton/trunk/doc/guide/
A   mlton/trunk/doc/guide/AST
A   mlton/trunk/doc/guide/AccessControl
A   mlton/trunk/doc/guide/AdmitsEquality
A   mlton/trunk/doc/guide/Alice
A   mlton/trunk/doc/guide/AllocateRegisters
A   mlton/trunk/doc/guide/AndreiFormiga
A   mlton/trunk/doc/guide/BasisLibrary
A   mlton/trunk/doc/guide/Bug
A   mlton/trunk/doc/guide/Bugs20041109
A   mlton/trunk/doc/guide/CKitLibrary
A   mlton/trunk/doc/guide/CallGraph
A   mlton/trunk/doc/guide/CallingFromCToSML
A   mlton/trunk/doc/guide/CallingFromSMLToC
A   mlton/trunk/doc/guide/CallingFromSMLToCFunctionPointer
A   mlton/trunk/doc/guide/ChrisClearwater
A   mlton/trunk/doc/guide/Chunkify
A   mlton/trunk/doc/guide/Closure
A   mlton/trunk/doc/guide/ClosureConvert
A   mlton/trunk/doc/guide/CommonArg
A   mlton/trunk/doc/guide/CommonBlock
A   mlton/trunk/doc/guide/CommonSubexp
A   mlton/trunk/doc/guide/CompilationManager
A   mlton/trunk/doc/guide/CompileTimeOptions
A   mlton/trunk/doc/guide/CompilerOverview
A   mlton/trunk/doc/guide/CompilerPassTemplate
A   mlton/trunk/doc/guide/ConcurrentML
A   mlton/trunk/doc/guide/ConcurrentMLImplementation
A   mlton/trunk/doc/guide/ConstantPropagation
A   mlton/trunk/doc/guide/Contact
A   mlton/trunk/doc/guide/Contify
A   mlton/trunk/doc/guide/CoreML
A   mlton/trunk/doc/guide/CoreMLSimplify
A   mlton/trunk/doc/guide/CreatingPages
A   mlton/trunk/doc/guide/Credits
A   mlton/trunk/doc/guide/CrossCompiling
A   mlton/trunk/doc/guide/DeadCode
A   mlton/trunk/doc/guide/DeepFlatten
A   mlton/trunk/doc/guide/DefineTypeBeforeUse
A   mlton/trunk/doc/guide/DefinitionOfStandardML
A   mlton/trunk/doc/guide/Defunctorize
A   mlton/trunk/doc/guide/Developers
A   mlton/trunk/doc/guide/Development
A   mlton/trunk/doc/guide/Documentation
A   mlton/trunk/doc/guide/Drawbacks
A   mlton/trunk/doc/guide/EXene
A   mlton/trunk/doc/guide/Eclipse
A   mlton/trunk/doc/guide/EditingPages
A   mlton/trunk/doc/guide/Elaborate
A   mlton/trunk/doc/guide/Emacs
A   mlton/trunk/doc/guide/Enscript
A   mlton/trunk/doc/guide/EqualityType
A   mlton/trunk/doc/guide/EqualityTypeVariable
A   mlton/trunk/doc/guide/Experimental
A   mlton/trunk/doc/guide/FAQ
A   mlton/trunk/doc/guide/Features
A   mlton/trunk/doc/guide/FirstClassPolymorphism
A   mlton/trunk/doc/guide/Flatten
A   mlton/trunk/doc/guide/ForLoops
A   mlton/trunk/doc/guide/ForeignFunctionInterface
A   mlton/trunk/doc/guide/ForeignFunctionInterfaceSyntax
A   mlton/trunk/doc/guide/ForeignFunctionInterfaceTypes
A   mlton/trunk/doc/guide/FrontEnd
A   mlton/trunk/doc/guide/FunctionalRecordUpdate
A   mlton/trunk/doc/guide/GarbageCollection
A   mlton/trunk/doc/guide/GenerativeDatatype
A   mlton/trunk/doc/guide/GenerativeException
A   mlton/trunk/doc/guide/Globalize
A   mlton/trunk/doc/guide/GnuMP
A   mlton/trunk/doc/guide/HaMLet
A   mlton/trunk/doc/guide/HenryCejtin
A   mlton/trunk/doc/guide/History
A   mlton/trunk/doc/guide/Home
A   mlton/trunk/doc/guide/HowProfilingWorks
A   mlton/trunk/doc/guide/Identifier
A   mlton/trunk/doc/guide/Immutable
A   mlton/trunk/doc/guide/ImperativeTypeVariable
A   mlton/trunk/doc/guide/ImplementExceptions
A   mlton/trunk/doc/guide/ImplementHandlers
A   mlton/trunk/doc/guide/ImplementProfiling
A   mlton/trunk/doc/guide/ImplementSuffix
A   mlton/trunk/doc/guide/Index
A   mlton/trunk/doc/guide/InfixingOperators
A   mlton/trunk/doc/guide/Inline
A   mlton/trunk/doc/guide/InsertLimitChecks
A   mlton/trunk/doc/guide/InsertSignalChecks
A   mlton/trunk/doc/guide/Installation
A   mlton/trunk/doc/guide/IntermediateLanguage
A   mlton/trunk/doc/guide/IntroduceLoops
A   mlton/trunk/doc/guide/JesperLouisAndersen
A   mlton/trunk/doc/guide/JohnnyAndersen
A   mlton/trunk/doc/guide/KnownCase
A   mlton/trunk/doc/guide/LambdaFree
A   mlton/trunk/doc/guide/LanguageChanges
A   mlton/trunk/doc/guide/Lazy
A   mlton/trunk/doc/guide/Libraries
A   mlton/trunk/doc/guide/License
A   mlton/trunk/doc/guide/LineDirective
A   mlton/trunk/doc/guide/LocalFlatten
A   mlton/trunk/doc/guide/LocalRef
A   mlton/trunk/doc/guide/LoopInvariant
A   mlton/trunk/doc/guide/ML
A   mlton/trunk/doc/guide/MLBasis
A   mlton/trunk/doc/guide/MLBasisAnnotationExamples
A   mlton/trunk/doc/guide/MLBasisAnnotations
A   mlton/trunk/doc/guide/MLBasisAvailableLibraries
A   mlton/trunk/doc/guide/MLBasisExamples
A   mlton/trunk/doc/guide/MLBasisPathMap
A   mlton/trunk/doc/guide/MLBasisSyntaxAndSemantics
A   mlton/trunk/doc/guide/MLKit
A   mlton/trunk/doc/guide/MLNLFFI
A   mlton/trunk/doc/guide/MLNLFFIImplementation
A   mlton/trunk/doc/guide/MLj
A   mlton/trunk/doc/guide/MLtonArray
A   mlton/trunk/doc/guide/MLtonBinIO
A   mlton/trunk/doc/guide/MLtonCont
A   mlton/trunk/doc/guide/MLtonExn
A   mlton/trunk/doc/guide/MLtonFinalizable
A   mlton/trunk/doc/guide/MLtonGC
A   mlton/trunk/doc/guide/MLtonIO
A   mlton/trunk/doc/guide/MLtonIntInf
A   mlton/trunk/doc/guide/MLtonItimer
A   mlton/trunk/doc/guide/MLtonPlatform
A   mlton/trunk/doc/guide/MLtonPointer
A   mlton/trunk/doc/guide/MLtonProcEnv
A   mlton/trunk/doc/guide/MLtonProcess
A   mlton/trunk/doc/guide/MLtonProfile
A   mlton/trunk/doc/guide/MLtonRandom
A   mlton/trunk/doc/guide/MLtonRlimit
A   mlton/trunk/doc/guide/MLtonRusage
A   mlton/trunk/doc/guide/MLtonSignal
A   mlton/trunk/doc/guide/MLtonSocket
A   mlton/trunk/doc/guide/MLtonStructure
A   mlton/trunk/doc/guide/MLtonSyslog
A   mlton/trunk/doc/guide/MLtonTextIO
A   mlton/trunk/doc/guide/MLtonThread
A   mlton/trunk/doc/guide/MLtonVector
A   mlton/trunk/doc/guide/MLtonWeak
A   mlton/trunk/doc/guide/MLtonWord
A   mlton/trunk/doc/guide/MLtonWorld
A   mlton/trunk/doc/guide/Machine
A   mlton/trunk/doc/guide/ManualPage
A   mlton/trunk/doc/guide/MatchCompilation
A   mlton/trunk/doc/guide/MatchCompile
A   mlton/trunk/doc/guide/MatthewFluet
A   mlton/trunk/doc/guide/MichaelNorrish
A   mlton/trunk/doc/guide/MikeThomas
A   mlton/trunk/doc/guide/MoinMoin
A   mlton/trunk/doc/guide/Monomorphise
A   mlton/trunk/doc/guide/MoscowML
A   mlton/trunk/doc/guide/Multi
A   mlton/trunk/doc/guide/Mutable
A   mlton/trunk/doc/guide/OCaml
A   mlton/trunk/doc/guide/ObjectOrientedProgramming
A   mlton/trunk/doc/guide/OpenGL
A   mlton/trunk/doc/guide/OperatorPrecedence
A   mlton/trunk/doc/guide/OptionalArguments
A   mlton/trunk/doc/guide/OrphanedPages
A   mlton/trunk/doc/guide/OtherSites
A   mlton/trunk/doc/guide/Overloading
A   mlton/trunk/doc/guide/PackedRepresentation
A   mlton/trunk/doc/guide/PageSize
A   mlton/trunk/doc/guide/Papers
A   mlton/trunk/doc/guide/ParallelMove
A   mlton/trunk/doc/guide/Performance
A   mlton/trunk/doc/guide/PhantomType
A   mlton/trunk/doc/guide/PlatformSpecificNotes
A   mlton/trunk/doc/guide/PolyEqual
A   mlton/trunk/doc/guide/PolyML
A   mlton/trunk/doc/guide/PolymorphicEquality
A   mlton/trunk/doc/guide/Polyvariance
A   mlton/trunk/doc/guide/PortingMLton
A   mlton/trunk/doc/guide/PrecedenceParse
A   mlton/trunk/doc/guide/Printf
A   mlton/trunk/doc/guide/PrintfGentle
A   mlton/trunk/doc/guide/ProductType
A   mlton/trunk/doc/guide/Profiling
A   mlton/trunk/doc/guide/ProfilingAllocation
A   mlton/trunk/doc/guide/ProfilingCounts
A   mlton/trunk/doc/guide/ProfilingTheStack
A   mlton/trunk/doc/guide/ProfilingTime
A   mlton/trunk/doc/guide/Projects
A   mlton/trunk/doc/guide/Pronounce
A   mlton/trunk/doc/guide/PropertyList
A   mlton/trunk/doc/guide/RSSA
A   mlton/trunk/doc/guide/RSSAShrink
A   mlton/trunk/doc/guide/RSSASimplify
A   mlton/trunk/doc/guide/RayRacine
A   mlton/trunk/doc/guide/Redundant
A   mlton/trunk/doc/guide/RedundantTests
A   mlton/trunk/doc/guide/RefFlatten
A   mlton/trunk/doc/guide/References
A   mlton/trunk/doc/guide/Regions
A   mlton/trunk/doc/guide/ReleaseChecklist
A   mlton/trunk/doc/guide/RemoveUnused
A   mlton/trunk/doc/guide/Restore
A   mlton/trunk/doc/guide/RunTimeOptions
A   mlton/trunk/doc/guide/RunningOnCygwin
A   mlton/trunk/doc/guide/RunningOnDarwin
A   mlton/trunk/doc/guide/RunningOnFreeBSD
A   mlton/trunk/doc/guide/RunningOnLinux
A   mlton/trunk/doc/guide/RunningOnMinGW
A   mlton/trunk/doc/guide/RunningOnNetBSD
A   mlton/trunk/doc/guide/RunningOnOpenBSD
A   mlton/trunk/doc/guide/RunningOnPowerPC
A   mlton/trunk/doc/guide/RunningOnSolaris
A   mlton/trunk/doc/guide/RunningOnSparc
A   mlton/trunk/doc/guide/SMLNET
A   mlton/trunk/doc/guide/SMLNJ
A   mlton/trunk/doc/guide/SMLNJDeviations
A   mlton/trunk/doc/guide/SMLNJLibrary
A   mlton/trunk/doc/guide/SMLofNJStructure
A   mlton/trunk/doc/guide/SSA
A   mlton/trunk/doc/guide/SSA2
A   mlton/trunk/doc/guide/SSA2Simplify
A   mlton/trunk/doc/guide/SSASimplify
A   mlton/trunk/doc/guide/SXML
A   mlton/trunk/doc/guide/SXMLShrink
A   mlton/trunk/doc/guide/SXMLSimplify
A   mlton/trunk/doc/guide/ScopeInference
A   mlton/trunk/doc/guide/SelfCompiling
A   mlton/trunk/doc/guide/Serialization
A   mlton/trunk/doc/guide/ShowBasis
A   mlton/trunk/doc/guide/Shrink
A   mlton/trunk/doc/guide/SimplifyTypes
A   mlton/trunk/doc/guide/Sources
A   mlton/trunk/doc/guide/SpaceSafety
A   mlton/trunk/doc/guide/StandardML
A   mlton/trunk/doc/guide/StandardMLBooks
A   mlton/trunk/doc/guide/StandardMLHistory
A   mlton/trunk/doc/guide/StandardMLImplementations
A   mlton/trunk/doc/guide/StandardMLPortability
A   mlton/trunk/doc/guide/StandardMLTutorials
A   mlton/trunk/doc/guide/StephenWeeks
A   mlton/trunk/doc/guide/StyleGuide
A   mlton/trunk/doc/guide/Subversion
A   mlton/trunk/doc/guide/SureshJagannathan
A   mlton/trunk/doc/guide/Survey
A   mlton/trunk/doc/guide/SurveyDone
A   mlton/trunk/doc/guide/Swerve
A   mlton/trunk/doc/guide/SyntacticConventions
A   mlton/trunk/doc/guide/SystemInfo
A   mlton/trunk/doc/guide/TILT
A   mlton/trunk/doc/guide/Talk
A   mlton/trunk/doc/guide/TalkDiveIn
A   mlton/trunk/doc/guide/TalkFolkLore
A   mlton/trunk/doc/guide/TalkFromSMLTo
A   mlton/trunk/doc/guide/TalkHowHigherOrder
A   mlton/trunk/doc/guide/TalkHowModules
A   mlton/trunk/doc/guide/TalkHowPolymorphism
A   mlton/trunk/doc/guide/TalkMLtonApproach
A   mlton/trunk/doc/guide/TalkMLtonFeatures
A   mlton/trunk/doc/guide/TalkMLtonHistory
A   mlton/trunk/doc/guide/TalkStandardML
A   mlton/trunk/doc/guide/TalkTemplate
A   mlton/trunk/doc/guide/TalkWholeProgram
A   mlton/trunk/doc/guide/ToMachine
A   mlton/trunk/doc/guide/ToRSSA
A   mlton/trunk/doc/guide/ToSSA2
A   mlton/trunk/doc/guide/TrustedGroup
A   mlton/trunk/doc/guide/TypeChecking
A   mlton/trunk/doc/guide/TypeConstructor
A   mlton/trunk/doc/guide/TypeVariableScope
A   mlton/trunk/doc/guide/Unicode
A   mlton/trunk/doc/guide/UniversalType
A   mlton/trunk/doc/guide/UnresolvedBugs
A   mlton/trunk/doc/guide/UnsafeStructure
A   mlton/trunk/doc/guide/Useless
A   mlton/trunk/doc/guide/UserGuide
A   mlton/trunk/doc/guide/Users
A   mlton/trunk/doc/guide/ValueRestriction
A   mlton/trunk/doc/guide/Variant
A   mlton/trunk/doc/guide/VesaKarvonen
A   mlton/trunk/doc/guide/WantedPages
A   mlton/trunk/doc/guide/WebSite
A   mlton/trunk/doc/guide/WesleyTerpstra
A   mlton/trunk/doc/guide/WholeProgramOptimization
A   mlton/trunk/doc/guide/WikiMacros
A   mlton/trunk/doc/guide/WikiName
A   mlton/trunk/doc/guide/WikiTool
A   mlton/trunk/doc/guide/XML
A   mlton/trunk/doc/guide/XMLShrink
A   mlton/trunk/doc/guide/XMLSimplify
A   mlton/trunk/doc/guide/XMLSimplifyTypes
A   mlton/trunk/doc/guide/ZZZOrphanedPages
A   mlton/trunk/doc/guide/Zone
A   mlton/trunk/doc/guide/common.css
A   mlton/trunk/doc/guide/index.html
A   mlton/trunk/doc/guide/mGTK
A   mlton/trunk/doc/guide/moin-bottom.png
A   mlton/trunk/doc/guide/moin-email.png
A   mlton/trunk/doc/guide/moin-ftp.png
A   mlton/trunk/doc/guide/moin-top.png
A   mlton/trunk/doc/guide/moin-www.png
A   mlton/trunk/doc/guide/print.css
A   mlton/trunk/doc/guide/screen.css

----------------------------------------------------------------------

Added: mlton/trunk/doc/guide/AST
===================================================================
--- mlton/trunk/doc/guide/AST	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/AST	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,86 @@
+<!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>AST - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      AST
+    <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">
+An <a href="IntermediateLanguage">IntermediateLanguage</a>,  produced by the <a href="FrontEnd">FrontEnd</a> and  translated by <a href="Elaborate">Elaborate</a> to <a href="CoreML">CoreML</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+The abstract syntax tree produced by the <a href="FrontEnd">FrontEnd</a>. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ast/ast-programs.sig?view=markup">ast-programs.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ast/ast-programs.fun?view=markup">ast-programs.fun</a>
+<br>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ast/ast-modules.sig?view=markup">ast-modules.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ast/ast-modules.fun?view=markup">ast-modules.fun</a>
+<br>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ast/ast-core.sig?view=markup">ast-core.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ast/ast-core.fun?view=markup">ast-core.fun</a>
+<br>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ast">ast</a>
+ <h2 id="head-a6de4b535fedeaa8890bd890b60fe09f87b5f96a">Type Checking</h2>
+<p>
+The AST <a href="IntermediateLanguage">IntermediateLanguage</a> has no independent type checker. Type inference is performed on an AST program as part of <a href="Elaborate">Elaborate</a>. 
+</p>
+<h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:43:32 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/AccessControl
===================================================================
--- mlton/trunk/doc/guide/AccessControl	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/AccessControl	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,65 @@
+<!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>AccessControl - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      AccessControl
+    <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">
+<a href="MoinMoin">MoinMoin</a> supports a lot of  <a class="external" href="http://moinmaster.wikiwikiweb.de/HelpOnAccessControlLists"><img src="moin-www.png" alt="[WWW]" height="11" width="11">access control features</a>.   <p>
+Because people download binaries from the MLton web site, and we are worried about malicious users either changing those binaries, or changing the links that should point at those binaries, we only allow editing of some pages (in particular, <a href="http://mlton.org/Download">Download</a>, <a href="Home">Home</a>, and <a href="Experimental">Experimental</a>) by <a href="TrustedGroup">TrustedGroup</a> members. 
+</p>
+<p>
+All other pages are freely editable by any user with an account. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-10-29 22:30:46 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/AdmitsEquality
===================================================================
--- mlton/trunk/doc/guide/AdmitsEquality	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/AdmitsEquality	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,289 @@
+<!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>AdmitsEquality - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      AdmitsEquality
+    <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">
+A <a href="TypeConstructor">TypeConstructor</a> admits equality if whenever it is applied to equality types, the result is an <a href="EqualityType">EqualityType</a>.  This notion enables one to determine whether a type constructor application yields an equality type solely from the application, without looking at the definition of the type constructor.  It helps to ensure that <a href="PolymorphicEquality">PolymorphicEquality</a> is only applied to sensible values. <p>
+The definition of admits equality depends on whether the type constructor was declared by a <tt>type</tt> definition or a <tt>datatype</tt> declaration. 
+</p>
+<h2 id="head-67921ac307a0edfd915b53407b84c8c0457981a2">Type definitions</h2>
+<p>
+For type definition  
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> ('a1, ..., 'an) t </FONT></B>=<FONT COLOR="#228B22"><B> </FONT></B>...
+</PRE>
+<p>
+ 
+</p>
+<p>
+type constructor <tt>t</tt> admits equality if the right-hand side of the definition is an equality type after replacing <tt>'a1</tt>, ..., <tt>'an</tt> by equality types (it doesn't matter which equality types are chosen). 
+</p>
+<p>
+For a nullary type definition, this amounts to the right-hand side being an equality type.  For example, after the definition 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> bool * int
+</FONT></B></PRE>
+<p>
+ 
+</p>
+<p>
+type constructor <tt>t</tt> admits equality because <tt>bool&nbsp;*&nbsp;int</tt> is an equality type.   On the other hand, after the definition 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> bool * int * real
+</FONT></B></PRE>
+<p>
+ 
+</p>
+<p>
+type constructor <tt>t</tt> does not admit equality, because <tt>real</tt> is not an equality type. 
+</p>
+<p>
+For another example, after the definition 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> 'a t </FONT></B>=<FONT COLOR="#228B22"><B> bool * 'a
+</FONT></B></PRE>
+<p>
+ 
+</p>
+<p>
+type constructor <tt>t</tt> admits equality because <tt>bool&nbsp;*&nbsp;int</tt> is an equality type (we could have chosen any equality type other than <tt>int</tt>). 
+</p>
+<p>
+On the other hand, after the definition 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> 'a t </FONT></B>=<FONT COLOR="#228B22"><B> real * 'a
+</FONT></B></PRE>
+<p>
+ 
+</p>
+<p>
+type constructor <tt>t</tt> does not admit equality becuase  <tt>real&nbsp;*&nbsp;int</tt> is not equality type. 
+</p>
+<p>
+We can check that a type constructor admits equality using an <tt>eqtype</tt> specification. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">structure</FONT></B> Ok: <B><FONT COLOR="#0000FF">sig</FONT></B> <B><FONT COLOR="#A020F0">eqtype</FONT></B><FONT COLOR="#228B22"><B> 'a t </FONT></B><B><FONT COLOR="#0000FF">end</FONT></B> = 
+   <B><FONT COLOR="#0000FF">struct</FONT></B> 
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> 'a t </FONT></B>=<FONT COLOR="#228B22"><B> bool * 'a
+   </FONT></B><B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">structure</FONT></B> Bad: <B><FONT COLOR="#0000FF">sig</FONT></B> <B><FONT COLOR="#A020F0">eqtype</FONT></B><FONT COLOR="#228B22"><B> 'a t </FONT></B><B><FONT COLOR="#0000FF">end</FONT></B> = 
+   <B><FONT COLOR="#0000FF">struct</FONT></B> 
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> 'a t </FONT></B>=<FONT COLOR="#228B22"><B> real * int * 'a
+   </FONT></B><B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<p>
+On <tt>structure&nbsp;Bad</tt>, MLton reports the following error. 
+<pre>Type t admits equality in signature but not in structure.
+  not equality: real * _ * _
+</pre>The <tt>not&nbsp;equality</tt> section provides an explanation of why the type did not admit equality, highlighting the problematic component (<tt>real</tt>). 
+</p>
+<h2 id="head-c494234542affd2943bc7247d524477b03bc18bc">Datatype declarations</h2>
+<p>
+For a type constructor declared by a datatype declaration to admit equality, every variant of the datatype must admit equality.  For example, the following datatype admits equality because <tt>bool</tt> and <tt>char&nbsp;*&nbsp;int</tt> are equality types. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">A</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> bool </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">B</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> char * int
+</FONT></B></PRE>
+<p>
+ 
+</p>
+<p>
+Nullary constructors trivially admit equality, so that the following datatype admits equality. 
+<pre class=code>
+<B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">A</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">B</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">C</FONT>
+</FONT></B></PRE>
+ 
+</p>
+<p>
+For a parameterized datatype constructor to admit equality, we consider each variant as a type definition, and require that the definition admit equality.  For example, for the datatype  
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> 'a t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">A</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> bool * 'a </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">B</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> 'a
+</FONT></B></PRE>
+<p>
+ 
+</p>
+<p>
+the type definitions 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> 'a tA </FONT></B>=<FONT COLOR="#228B22"><B> bool * 'a
+</FONT></B><B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> 'a tB </FONT></B>=<FONT COLOR="#228B22"><B> 'a 
+</FONT></B></PRE>
+<p>
+ 
+</p>
+<p>
+both admit equality.  Thus, type constructor <tt>t</tt> admits equality. 
+</p>
+<p>
+On the other hand, the following datatype does not admit equality. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> 'a t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">A</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> bool * 'a </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">B</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> real * 'a
+</FONT></B></PRE>
+<p>
+ 
+</p>
+<p>
+As with type definitions, we can check using an <tt>eqtype</tt> specification. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">structure</FONT></B> Bad: <B><FONT COLOR="#0000FF">sig</FONT></B> <B><FONT COLOR="#A020F0">eqtype</FONT></B><FONT COLOR="#228B22"><B> 'a t </FONT></B><B><FONT COLOR="#0000FF">end</FONT></B> =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> 'a t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">A</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> bool * 'a </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">B</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> real * 'a
+   </FONT></B><B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<p>
+MLton reports the following error. 
+</p>
+
+<pre>Type t admits equality in signature but not in structure.
+  not equality: B of real * _
+</pre><p>
+MLton indicates the problematic constructor (<tt>B</tt>), as well as the problematic component of the constructor's argument. 
+</p>
+<h3 id="head-c549e40c38aec54d5abd4cedb1559a45a15f6a81">Recursive datatypes</h3>
+<p>
+A recursive datatype like 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">A</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">B</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> int * t
+</FONT></B></PRE>
+<p>
+ 
+</p>
+<p>
+introduces a new problem, since in order to decide whether <tt>t</tt> admits equality, we need to know for the <tt>B</tt> variant whether <tt>t</tt> admits equality.  The <a href="DefinitionOfStandardML">Definition</a> answers this question by requiring a type constructor to admit equality if it is consistent to do so.  So, in our above example, if we assume that <tt>t</tt> admits equality, then the variant  <tt>B&nbsp;of&nbsp;int&nbsp;*&nbsp;t</tt> admits equality.  Then, since the <tt>A</tt> variant trivially admits equality, so does the type constructor <tt>t</tt>. Thus, it was consistent to assume that <tt>t</tt> admits equality, and so, <tt>t</tt> does admit equality. 
+</p>
+<p>
+On the other hand, in the following declaration 
+<pre class=code>
+<B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">A</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">B</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> real * t
+</FONT></B></PRE>
+ if we assume that <tt>t</tt> admits equality, then the <tt>B</tt> variant does not admit equality.  Hence, the type constructor <tt>t</tt> does not admit equality, and our assumption was inconsistent.  Hence, <tt>t</tt> does not admit equality. 
+</p>
+<p>
+The same kind of reasoning applies to mutually recursive datatypes as well.  For example, the following defines both <tt>t</tt> and <tt>u</tt> to admit equality. 
+<pre class=code>
+<B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">A</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">B</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> u
+</FONT></B><B><FONT COLOR="#A020F0">and</FONT></B><FONT COLOR="#228B22"><B> u </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">C</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">D</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> t
+</FONT></B></PRE>
+ 
+</p>
+<p>
+But the following defines neither <tt>t</tt> nor <tt>u</tt> to admit equality. 
+<pre class=code>
+<B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">A</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">B</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> u * real
+</FONT></B><B><FONT COLOR="#A020F0">and</FONT></B><FONT COLOR="#228B22"><B> u </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">C</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">D</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> t
+</FONT></B></PRE>
+ 
+</p>
+<p>
+As always, we can check whether a type admits equality using an <tt>eqtype</tt> specification. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">structure</FONT></B> Bad: <B><FONT COLOR="#0000FF">sig</FONT></B> <B><FONT COLOR="#A020F0">eqtype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B><B><FONT COLOR="#A020F0">eqtype</FONT></B><FONT COLOR="#228B22"><B> u </FONT></B><B><FONT COLOR="#0000FF">end</FONT></B> =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">A</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">B</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> u * real
+      </FONT></B><B><FONT COLOR="#A020F0">and</FONT></B><FONT COLOR="#228B22"><B> u </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">C</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">D</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> t
+   </FONT></B><B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<p>
+Unfortunately, due to a bug in error reporting, MLton 20041109 prints an obscure internal bug message (<tt>Type.deArrow</tt>) and exits.  The problem has been fixed, and MLton now reports 
+</p>
+
+<pre>Error: z.sml 1.16.
+  Type t admits equality in signature but not in structure.
+    not equality: B of u * real
+Error: z.sml 1.16.
+  Type u admits equality in signature but not in structure.
+    not equality: D of t
+</pre></div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-26 20:48:53 by <span title="cfs36.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Alice
===================================================================
--- mlton/trunk/doc/guide/Alice	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Alice	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,59 @@
+<!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>Alice - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Alice
+    <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">
+<a class="external" href="http://www.ps.uni-sb.de/alice/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Alice</a> is an extension of SML with concurrency, distribution, and constraint solving. </div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-28 19:46:32 by <span title="adsl-64-166-225-13.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/AllocateRegisters
===================================================================
--- mlton/trunk/doc/guide/AllocateRegisters	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/AllocateRegisters	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,69 @@
+<!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>AllocateRegisters - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      AllocateRegisters
+    <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">
+An analysis pass for the <a href="RSSA">RSSA</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="ToMachine">ToMachine</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Computes an allocation of <a href="RSSA">RSSA</a> variables as <a href="Machine">Machine</a> register or stack operands. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ZZZ.sig?view=markup">ZZZ.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ZZZ.fun?view=markup">ZZZ.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:43:18 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/AndreiFormiga
===================================================================
--- mlton/trunk/doc/guide/AndreiFormiga	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/AndreiFormiga	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,62 @@
+<!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>AndreiFormiga - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      AndreiFormiga
+    <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">
+I'm a graduate student just back in academia. I study concurrent and parallel systems, with a great deal of interest in programming languages (theory, design, implementation). I happen to like functional languages.  <p>
+I use the nickname tautologico on #sml and my email is andrei DOT formiga AT gmail DOT com. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-20 18:17:19 by <span title="PW5.neoline.com.br"><a href="AndreiFormiga">AndreiFormiga</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/BasisLibrary
===================================================================
--- mlton/trunk/doc/guide/BasisLibrary	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/BasisLibrary	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,429 @@
+<!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">
+
+<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 20050905</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 href="http://www.standardml.org/Basis/">http://www.standardml.org/Basis/</a>.  We keep a copy at <a href="http://mlton.org/basis/">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 href="http://www.standardml.org/Basis/history.html">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-0ac17def4aced0cc961aa5b65385be04cfcf6eb5">Type equivalences</a></li>
+<li>
+<a href="#head-bc488aeca21efb00463538004d56839b48f23e7d">Real and Math functions</a></li>
+<li>
+<a href="#head-e38fb58e344e0ee67d4aa08c60df9fbd642e8e1c">Top-level functors</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>, <tt>Chr</tt>, <tt>Div</tt>, <tt>Domain</tt>, <tt>Empty</tt>, <tt>Fail</tt>, <tt>Match</tt>, <tt>Option</tt>, <tt>Overflow</tt>, <tt>Size</tt>, <tt>Span</tt>, <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>
+
+  <tt>Char</tt> characters correspond to ISO-8859-1.   The <tt>Char</tt> functions do not depend on locale. 
+        </ul>
+
+
+<p>
+<br>
+<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>
+
+  <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. 
+        </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;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;PackWord32Big:&nbsp;PACK_WORD</tt> <br>
+<tt>structure&nbsp;PackWord32Little:&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>
+
+ 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>
+ 
+</p>
+
+    </ul>
+
+
+<p>
+<br>
+<tt>structure&nbsp;String:&nbsp;STRING</tt> 
+</p>
+
+        <ul>
+
+  The <tt>String</tt> functions do not depend on locale. 
+        </ul>
+
+
+<p>
+<br>
+<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;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-0ac17def4aced0cc961aa5b65385be04cfcf6eb5">Type equivalences</h2>
+The following types are equivalent. 
+<pre>Int.int = Int32.int
+Int64.int = FixedInt.int = Position.int
+IntInf.int = LargeInt.int
+Real.real = Real64.real = LargeReal.real
+Word.word = Word32.word = SysWord.word
+Word64.word = LargeWord.word
+</pre><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>
+<h2 id="head-e38fb58e344e0ee67d4aa08c60df9fbd642e8e1c">Top-level functors</h2>
+<p>
+<tt>ImperativeIO</tt> <br>
+<tt>PrimIO</tt> <br>
+<tt>StreamIO</tt> 
+</p>
+<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>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-28 21:49:35 by <span title="cfs36.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Bug
===================================================================
--- mlton/trunk/doc/guide/Bug	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Bug	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,75 @@
+<!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>Bug - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Bug
+    <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">
+To report a bug, please send mail to  <a class="external" href="mailto:MLton@mlton.org"><img src="moin-email.png" alt="[MAILTO]" height="10" width="14">MLton@mlton.org</a>. Please include the complete SML program that caused the problem and a log of a compile of the program with <tt>-verbose&nbsp;2</tt>.  For large messages (over 512K), please send an email containing the discussion text and a link to any large files.  You may use our <a href="http://mlton.org/TemporaryUpload">TemporaryUpload</a> page for uploading large files. <p>
+There are some <a href="UnresolvedBugs">UnresolvedBugs</a> that we don't plan to fix. 
+</p>
+<p>
+We also maintain a list of bugs found with each release. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="Bugs20041109">Bugs20041109</a> 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-31 23:32:42 by <span title="adsl-64-166-226-67.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Bugs20041109
===================================================================
--- mlton/trunk/doc/guide/Bugs20041109	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Bugs20041109	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,352 @@
+<!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>Bugs20041109 - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Bugs20041109
+    <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">
+Here are the known bugs in MLton 20041109, listed in reverse chronological order of date reported. <p>
+<a id="16"></a> 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ A bug in an optimization pass may incorrectly transform a program  to flatten ref cells into their containing data structure, yielding a  type-error in the transformed program.  Our CVS has a  <a class="external" href="http://mlton.org/cgi-bin/viewcvs.cgi/mlton/mlton/mlton/ssa/ref-flatten.fun.diff?r1=1.35&amp;r2=1.37"><img src="moin-www.png" alt="[WWW]" height="11" width="11">patch</a>   to the compiler.  You must rebuild the compiler in order for the  patch to take effect. 
+</p>
+<p>
+ Thanks to Vesa Karvonen for reporting this bug. 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+<a id="15"></a> 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ A bug in the front end mistakenly allows unary constructors to be  used without an argument in patterns.  For example, the following  program is accepted, and triggers a large internal error. 
+<pre> fun f x = case x of SOME =&gt; true | _ =&gt; false</pre> We have fixed the problem in our CVS. 
+</p>
+<p>
+ Thanks to William Lovas for reporting this bug. 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+<a id="14"></a> 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ A bug in Posix.IO.{getlk,setlk,setlkw} causes a link-time error:  <tt>undefined&nbsp;reference&nbsp;to&nbsp;Posix_IO_FLock_typ</tt>  Our CVS has a  <a class="external" href="http://mlton.org/cgi-bin/viewcvs.cgi/mlton/mlton/basis-library/posix/primitive.sml.diff?r1=1.34&amp;r2=1.35"><img src="moin-www.png" alt="[WWW]" height="11" width="11">patch</a>  to the Basis Library implementation. 
+</p>
+<p>
+ Thanks to Adam Chlipala for reporting this bug. 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+<a id="13"></a> 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ A bug can cause programs compiled with <tt>-profile&nbsp;alloc</tt> to  segfault.  Our CVS has a   <a class="external" href="http://mlton.org/cgi-bin/viewcvs.cgi/mlton/mlton/mlton/backend/ssa-to-rssa.fun.diff?r1=1.106&amp;r2=1.107"><img src="moin-www.png" alt="[WWW]" height="11" width="11">patch</a>  to the compiler.  You must rebuild the compiler in order for the  patch to take effect. 
+</p>
+<p>
+ Thanks to John Reppy for reporting this bug. 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+<a id="12"></a> 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ A bug in an optimization pass may incorrectly flatten ref cells  into their containing data structure, breaking the sharing between  the cells.  Our CVS has a  <a class="external" href="http://mlton.org/cgi-bin/viewcvs.cgi/mlton/mlton/mlton/ssa/ref-flatten.fun.diff?r1=1.32&amp;r2=1.33"><img src="moin-www.png" alt="[WWW]" height="11" width="11">patch</a>   to the compiler.  You must rebuild the compiler in order for the  patch to take effect. 
+</p>
+<p>
+ Thanks to Paul Govereau for reporting this bug. 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+<a id="11"></a> 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ Some arrays or vectors, such as <tt>(char&nbsp;*&nbsp;char)&nbsp;vector</tt>, are  incorrectly implemented, and will conflate the first and second  components of each element.  Our CVS has a   <a class="external" href="http://mlton.org/cgi-bin/viewcvs.cgi/mlton/mlton/mlton/backend/packed-representation.fun.diff?r1=1.32&amp;r2=1.33"><img src="moin-www.png" alt="[WWW]" height="11" width="11">patch</a>  to the compiler.  You must rebuild the compiler in order for the  patch to take effect. 
+</p>
+<p>
+ Thanks to Scott Cruzen for reporting this bug. 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+<a id="10"></a> 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>Socket.Ctl.getLINGER</tt> and <tt>Socket.Ctl.setLINGER</tt>  mistakenly raise <tt>Subscript</tt>.    Our CVS has a   <a class="external" href="http://mlton.org/cgi-bin/viewcvs.cgi/mlton/mlton/basis-library/net/socket.sml.diff?r1=1.14&amp;r2=1.15"><img src="moin-www.png" alt="[WWW]" height="11" width="11">patch</a>  to the Basis Library implementation. 
+</p>
+<p>
+ Thanks to Ray Racine for reporting the bug. 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+<a id="9"></a> 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="ConcurrentML"> CML</a> <tt>Mailbox.send</tt> makes a call in the wrong atomic context.  Our CVS has a <a class="external" href="http://mlton.org/cgi-bin/viewcvs.cgi/mlton/mlton/lib/cml/core-cml/mailbox.sml.diff?r1=1.3&amp;r2=1.4"><img src="moin-www.png" alt="[WWW]" height="11" width="11">patch</a>  to the CML implementation. 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+<a id="8"></a> 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>OS.Path.joinDirFile</tt> and <tt>OS.Path.toString</tt> did not  raise <tt>InvalidArc</tt> when they were supposed to.  They now do.  Our CVS has a <a class="external" href="http://mlton.org/cgi-bin/viewcvs.cgi/mlton/mlton/basis-library/system/path.sml.diff?r1=1.8&amp;r2=1.11"><img src="moin-www.png" alt="[WWW]" height="11" width="11">patch</a>  to the Basis Library implementation. 
+</p>
+<p>
+ Thanks to Andreas Rossberg for reporting the bug. 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+<a id="7"></a> 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ The front end incorrectly disallows sequences of expressions  (separated by semicolons) after a topdec has already been processed.  For example, the following is incorrectly rejected.  
+<pre> val x = 0;
+ ignore x;
+ ignore x;</pre> We have fixed the problem in our CVS. 
+</p>
+<p>
+ Thanks to Andreas Rossberg for reporting the bug. 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+<a id="6"></a> 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ The front end incorrectly disallows expansive <tt>val</tt>  declarations that bind a type variable that doesn't occur in the  type of the value being bound.   For example, the following is  incorrectly rejected.  
+<pre> val 'a x = let exception E of 'a in () end</pre> We have fixed the problem in our CVS. 
+</p>
+<p>
+ Thanks to Andreas Rossberg for reporting this bug. 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+<a id="5"></a> 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ The x86 codegen fails to account for the possibility that a 64-bit  move could interfere with itself (as simulated by 32-bit moves).  We  have fixed the problem in our CVS.   
+</p>
+<p>
+ Thanks to Scott Cruzen for reporting this bug. 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+<a id="4"></a> 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>NetHostDB.scan</tt> and <tt>NetHostDB.fromString</tt> incorrectly  raise an exception on internet addresses whose last component is a  zero, e.g <tt>0.0.0.0</tt>.  Our CVS has a   <a class="external" href="http://mlton.org/cgi-bin/viewcvs.cgi/mlton/mlton/basis-library/net/net-host-db.sml.diff?r1=1.12&amp;r2=1.13"><img src="moin-www.png" alt="[WWW]" height="11" width="11">patch</a> to the Basis Library implementation. 
+</p>
+<p>
+ Thanks to Scott Cruzen for reporting this bug. 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+<a id="3"></a> 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>StreamIO.inputLine</tt> has an off-by-one error causing it to drop  the first character after a newline in some situations.  Our CVS has a   <a class="external" href="http://mlton.org/cgi-bin/viewcvs.cgi/mlton/mlton/basis-library/io/stream-io.fun.diff?r1=text&amp;tr1=1.29&amp;r2=text&amp;tr2=1.30&amp;diff_format=h"><img src="moin-www.png" alt="[WWW]" height="11" width="11">patch</a>.  to the Basis Library implementation. 
+</p>
+<p>
+ Thanks to Scott Cruzen for reporting this bug. 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+<a id="2"></a> 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>BinIO.getInstream</tt> and <tt>TextIO.getInstream</tt> are  implemented incorrectly.  This also impacts the behavior of  <tt>BinIO.scanStream</tt> and <tt>TextIO.scanStream</tt>.  If you (directly  or indirectly) realize a <tt>TextIO.StreamIO.instream</tt> and do not  (directly or indirectly) call <tt>TextIO.setInstream</tt> with a derived  stream, you may lose input data.  We have fixed the problem in our  CVS.  
+</p>
+<p>
+ Thanks to <a href="WesleyTerpstra">WesleyTerpstra</a> for reporting this bug. 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+<a id="1"></a> 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>Posix.ProcEnv.setpgid</tt> doesn't work.  If you compile a program  that uses it, you will get a link time error 
+<pre>undefined reference to `Posix_ProcEnv_setpgid'</pre> The bug is due to <tt>Posix_ProcEnv_setpgid</tt> being omitted from the  MLton runtime.  We fixed the problem in our CVS by adding the  following definition to <tt>runtime/Posix/ProcEnv/ProcEnv.c</tt> 
+<pre> Int Posix_ProcEnv_setpgid (Pid p, Gid g) {
+        return setpgid (p, g);
+}
+</pre>
+</p>
+<p>
+ Thanks to Tom Murphy for reporting this bug. 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-07-28 16:28:29 by <span title="adsl-64-166-225-145.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/CKitLibrary
===================================================================
--- mlton/trunk/doc/guide/CKitLibrary	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/CKitLibrary	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,183 @@
+<!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>CKitLibrary - 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">
+
+
+<link rel="Appendix" title="ckit-lib.patch" href="http://mlton.org/pages/CKitLibrary/attachments/ckit-lib.patch">
+<link rel="Appendix" title="ckit-lib.tgz" href="http://mlton.org/pages/CKitLibrary/attachments/ckit-lib.tgz">
+</head>
+
+<body lang="en" dir="ltr">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      CKitLibrary
+    <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 class="external" href="http://www.smlnj.org/doc/ckit"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ckit Library</a> is a C front end written in SML that translates C source code (after preprocessing) into abstract syntax represented as a set of SML datatypes and is distributed with SML/NJ.  Due to differences between SML/NJ and MLton, this library will not work out-of-the box with MLton.   <p>
+MLton ???????? includes a port of the ckit Library (from SML/NJ version 110.55). 
+</p>
+<h2 id="head-0bb18642b70b9f8a9c12ccf39487328f306b8e19">Usage</h2>
+
+    <ul>
+
+    <li>
+<p>
+ You can import the ckit Library by referencing the appropriate <tt>.mlb</tt> file: 
+</p>
+</li>
+
+        <ul>
+
+
+<div>
+<table>
+  <tr>
+<td align="center">
+MLB file</td>
+</tr>
+  <tr>
+<td>
+<tt>$(SML_LIB)/ckit-lib/src/ckit-lib.mlb</tt></td>
+</tr>
+</table>
+</div>
+
+        </ul>
+
+
+    <li>
+<p>
+ If you are porting a project from SML/NJ's <a href="CompilationManager">CompilationManager</a> to MLton's <a href="MLBasis"> ML Basis system</a> using <tt>cm2mlb</tt>, you will find it helpful to add the following to your <tt>.mlton/cm2mlb-map</tt>: 
+<pre>ckit-lib   $(SML_LIB)/ckit-lib/src
+</pre> This will automatically convert a <tt>$/ckit-lib.cm</tt> import in an input <tt>.cm</tt> file into a <tt>$(SML_LIB)/ckit-lib/src/ckit-lib.mlb</tt> import in the output <tt>.mlb</tt> file.
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-dc3decbb93847518f1a049dcf49d0d7c6560bcc6">Details</h2>
+<p>
+The following changes were made to the ckit Library, in addition to deriving the <tt>.mlb</tt> file from the <tt>.cm</tt> files: 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>parser/parse-tree-sig.sml</tt> (modified): Rewrote use of (sequential) <tt>withtype</tt> in signature. 
+</p>
+</li>
+    <li>
+<p>
+ <tt>parser/parse-tree.sml</tt> (modified): Rewrote use of (sequential) <tt>withtype</tt>. 
+</p>
+</li>
+    <li>
+<p>
+ <tt>ast/ast-sig.sml</tt> (modified): Rewrote use of <tt>withtype</tt> in signature. 
+</p>
+</li>
+    <li>
+<p>
+ <tt>ast/pp/pp-lib.sml</tt> (modified): Rewrote use of <em>or-patterns</em>. 
+</p>
+</li>
+    <li>
+<p>
+ <tt>ast/pp/pp-ast-ext-sig.sml</tt> (modified): Rewrote use of <tt>signature</tt> in <tt>local</tt>. 
+</p>
+</li>
+    <li>
+<p>
+ <tt>ast/pp/pp-ast-adornment-sig.sml</tt> (modified): Rewrote use of <tt>signature</tt> in <tt>local</tt>. 
+</p>
+</li>
+    <li>
+<p>
+ <tt>ast/type-util-sig.sml</tt> (modified): Rewrote use of <tt>signature</tt> in <tt>local</tt>. 
+</p>
+</li>
+    <li>
+<p>
+ <tt>ast/type-util.sml</tt> (modified): Rewrote use of <em>or-patterns</em>. 
+</p>
+</li>
+    <li>
+<p>
+ <tt>ast/sizeof.sml</tt> (modified): Rewrote use of <em>or-patterns</em>. 
+</p>
+</li>
+    <li>
+<p>
+ <tt>ast/initializer-normalizer.sml</tt> (modified): Rewrote use of <em>or-patterns</em>. 
+</p>
+</li>
+    <li>
+<p>
+ <tt>ast/build-ast.sml</tt> (modified): Rewrote use of <em>or-patterns</em>. 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-190aa842474f4bfcec9c8cde305af27b7d07764d">Patch</h2>
+
+    <ul>
+
+    <li>
+<p>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/lib/ckit-lib/ckit.patch?view=markup">ckit.patch</a>
+ 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:56:56 by <span title="net-79206.roam.fas.harvard.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/CallGraph
===================================================================
--- mlton/trunk/doc/guide/CallGraph	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/CallGraph	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,151 @@
+<!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>CallGraph - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      CallGraph
+    <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">
+For easier visualization of profiling data, <tt>mlprof</tt> can create a call graph of the program in dot format, from which you can use the <a class="external" href="http://www.research.att.com/sw/tools/graphviz/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">graphviz</a> software package to create a postscript graph.  For example,  
+<pre>mlprof -call-graph foo.dot foo mlmon.out</pre> will create <tt>foo.dot</tt> with a complete call graph.  For each source function, there will be one node in the graph that contains the function name (and source position with <tt>-show-line&nbsp;true</tt>), as well as the percentage of ticks.  If you want to create a call graph for your program without any profiling data, you can simply call <tt>mlprof</tt> without any <tt>mlmon.out</tt> files, as in 
+<pre>mlprof -call-graph foo.dot foo</pre><p>
+Because SML has higher-order functions, the call graph is is dependent on MLton's analysis of which functions call each other.  This analysis depends on many implementation details and might display spurious edges that a human could conclude are impossible.  However, in practice, the call graphs tend to be very accurate. 
+</p>
+<p>
+Because call graphs can get big, <tt>mlprof</tt> provides the <tt>-keep</tt> option to specify the nodes that you would like to see.  This option also controls which functions appear in the table that <tt>mlprof</tt> prints.  The argument to <tt>-keep</tt> is an expression describing a set of source functions (i.e. graph nodes).  The expression <em>e</em> should be of the following form. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>all</tt> 
+</p>
+</li>
+    <li>
+<p>
+ "<em>s</em>"  
+</p>
+</li>
+    <li>
+<p>
+ <tt>(and&nbsp;</tt><em>e ...</em><tt>)</tt> 
+</p>
+</li>
+    <li>
+<p>
+ <tt>(from&nbsp;</tt><em>e</em><tt>)</tt> 
+</p>
+</li>
+    <li>
+<p>
+ <tt>(not&nbsp;</tt><em>e</em><tt>)</tt> 
+</p>
+</li>
+    <li>
+<p>
+ <tt>(or&nbsp;</tt><em>e</em><tt>)</tt> 
+</p>
+</li>
+    <li>
+<p>
+ <tt>(pred&nbsp;</tt><em>e</em><tt>)</tt> 
+</p>
+</li>
+    <li>
+<p>
+ <tt>(succ&nbsp;</tt><em>e</em><tt>)</tt> 
+</p>
+</li>
+    <li>
+<p>
+ <tt>(thresh&nbsp;</tt><em>x</em><tt>)</tt> 
+</p>
+</li>
+    <li>
+<p>
+ <tt>(thresh-gc&nbsp;</tt><em>x</em><tt>)</tt> 
+</p>
+</li>
+    <li>
+<p>
+ <tt>(thresh-stack&nbsp;</tt><em>x</em><tt>)</tt> 
+</p>
+</li>
+    <li>
+<p>
+ <tt>(to&nbsp;</tt><em>e</em><tt>)</tt> 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+In the grammar, <tt>all</tt> denotes the set of all nodes. <tt>"</tt><em>s</em><tt>"</tt> is a regular expression denoting the set of functions whose name (followed by a space and the source position) has a prefix matching the regexp.  The <tt>and</tt>, <tt>not</tt>, and <tt>or</tt> expressions denote intersection, complement, and union, respectively. The <tt>pred</tt> and <tt>succ</tt> expressions add the set of immediate predecessors or successors to their argument, respectively.  The <tt>from</tt> and <tt>to</tt> expressions denote the set of nodes that have paths from or to the set of nodes denoted by their arguments, respectively.  Finally, <tt>thresh</tt>, <tt>thresh-gc</tt>, and <tt>thresh-stack</tt> denote the set of nodes whose percentage of ticks, gc ticks, or stack ticks, respectively, is greater than or equal to the real number <em>x</em>. 
+</p>
+<p>
+For example, if you want to see the entire call graph for a program, you can use <tt>-keep&nbsp;all</tt> (this is the default).  If you want to see all nodes reachable from function <tt>foo</tt> in your program, you would use <tt>-keep&nbsp;'(from&nbsp;"foo")'</tt>.  Or, if you want to see all the functions defined in subdirectory <tt>bar</tt> of your project that used at least 1% of the ticks, you would use  
+<pre>-keep '(and ".*/bar/" (thresh 1.0))'</pre>To see all functions with ticks above a threshold, you can also use <tt>-thresh&nbsp;x</tt>, which is an abbreviation for  <tt>-keep&nbsp;'(thresh&nbsp;x)'</tt>.  You can not use multiple <tt>-keep</tt> arguments or both <tt>-keep</tt> and <tt>-thresh</tt>.  When you use <tt>-keep</tt> to display a subset of the functions, <tt>mlprof</tt> will add dashed edges to the call graph to indicate a path in the original call graph from one function to another. 
+</p>
+<p>
+When compiling with <tt>-profile-stack&nbsp;true</tt>, you can use  <tt>mlprof&nbsp;-gray&nbsp;true</tt> to make the nodes darker or lighter depending on whether their stack percentage is higher or lower. 
+</p>
+<p>
+MLton's optimizer may duplicate source functions for any of a number of reasons (functor duplication, monomorphisation, polyvariance, inlining).  By default, all duplicates of a function are treated as one.  If you would like to treat the duplicates separately, you can use <tt>mlprof&nbsp;-split</tt> <em>regexp</em>, which will cause all duplicates of functions whose name has a prefix matching the regular expression to be treated separately.  This can be especially useful for higher-order utility functions like <tt>General.o</tt>. 
+</p>
+<h2 id="head-bcaa33a7ae44bd5042c37a9cdbea7f843b1cf7c8">Caveats</h2>
+<p>
+Technically speaking, <tt>mlprof</tt> produces a call-stack graph rather than a call graph, because it describes the set of possible call stacks.  The difference is in how tail calls are displayed.  For example if <tt>f</tt> nontail calls <tt>g</tt> and <tt>g</tt> tail calls <tt>h</tt>, then the call-stack graph has edges from <tt>f</tt> to <tt>g</tt> and <tt>f</tt> to <tt>h</tt>, while the call graph has edges from <tt>f</tt> to <tt>g</tt> and <tt>g</tt> to <tt>h</tt>.  That is, a tail call from <tt>g</tt> to <tt>h</tt> removes <tt>g</tt> from the call stack and replaces it with <tt>h</tt>. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-01 18:47:41 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/CallingFromCToSML
===================================================================
--- mlton/trunk/doc/guide/CallingFromCToSML	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/CallingFromCToSML	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,218 @@
+<!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>CallingFromCToSML - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      CallingFromCToSML
+    <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">
+MLton's <a href="ForeignFunctionInterface">ForeignFunctionInterface</a> allows programs to <em>export</em> SML functions to be called from C. Suppose you would like export from SML a function of type  <tt>real&nbsp;*&nbsp;char&nbsp;-&gt;&nbsp;int</tt> as the C function <tt>foo</tt>.  MLton extends the syntax of SML to allow expressions like the following: 
+<pre>_export "foo": (real * char -&gt; int) -&gt; unit;
+</pre>The above expression exports a C function named <tt>foo</tt>, with prototype  
+<pre>Int32 foo (Real64 x0, Char x1);
+</pre>The <tt>_export</tt> expression denotes a function of type  <tt>(real&nbsp;*&nbsp;char&nbsp;-&gt;&nbsp;int)&nbsp;-&gt;&nbsp;unit</tt> that when called with a function <tt>f</tt> arranges for the exported <tt>foo</tt> function to call <tt>f</tt> when <tt>foo</tt> is called.  So, for example, the following exports and defines <tt>foo</tt>. 
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> e = _export <FONT COLOR="#BC8F8F"><B>&quot;foo&quot;</FONT></B>: real * char -&gt; int;
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = e (<B><FONT COLOR="#A020F0">fn</FONT></B> (x, c) =&gt; <B><FONT COLOR="#5F9EA0">13</FONT></B> + Real.floor x + Char.ord c)
+</PRE>
+<p>
+ 
+</p>
+<p>
+The general form of an <tt>_export</tt> expression is 
+</p>
+
+<pre>_export "C function name" attr... : cFuncTy -&gt; unit;
+</pre><p>
+The type and the semicolon are not optional.  As with <tt>_import</tt>, a sequence of attributes may follow the function name. 
+</p>
+<p>
+MLton's <tt>-export-header</tt> option generates a C header file with prototypes for all of the functions exported from SML.  Include this header file in your C files to type check calls to functions exported from SML.  This header file includes <tt>typedef</tt>s for the types that can be passed between SML and C, as described in the next section.  
+</p>
+<h2 id="head-0f01ed56a1e32a05e5ef96e4d779f34784af9a96">Example</h2>
+<p>
+Suppose that <tt>export.sml</tt> is  
+</p>
+<p>
+<pre class=code><B><FONT COLOR="#A020F0">val</FONT></B> e = _export <FONT COLOR="#BC8F8F"><B>&quot;f&quot;</FONT></B>: (int * real * char -&gt; char) -&gt; unit;
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = e (<B><FONT COLOR="#A020F0">fn</FONT></B> (i, r, _) =&gt;
+           (print (concat [<FONT COLOR="#BC8F8F"><B>&quot;i = &quot;</FONT></B>, Int.toString i,
+                           <FONT COLOR="#BC8F8F"><B>&quot;  r = &quot;</FONT></B>, Real.toString r, <FONT COLOR="#BC8F8F"><B>&quot;\n&quot;</FONT></B>])
+            ; #<FONT COLOR="#BC8F8F"><B>&quot;g&quot;</FONT></B>))
+<B><FONT COLOR="#A020F0">val</FONT></B> g = _import <FONT COLOR="#BC8F8F"><B>&quot;g&quot;</FONT></B>: unit -&gt; unit;
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = g ()
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = g ()
+   
+<B><FONT COLOR="#A020F0">val</FONT></B> e = _export <FONT COLOR="#BC8F8F"><B>&quot;f2&quot;</FONT></B>: (Word8.word -&gt; word array) -&gt; unit;
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = e (<B><FONT COLOR="#A020F0">fn</FONT></B> w =&gt;
+           Array.tabulate (<B><FONT COLOR="#5F9EA0">10</FONT></B>, <B><FONT COLOR="#A020F0">fn</FONT></B> _ =&gt; Word.fromLargeWord (Word8.toLargeWord w)))
+<B><FONT COLOR="#A020F0">val</FONT></B> g2 = _import <FONT COLOR="#BC8F8F"><B>&quot;g2&quot;</FONT></B>: unit -&gt; word array;
+<B><FONT COLOR="#A020F0">val</FONT></B> a = g2 ()
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = print (concat [<FONT COLOR="#BC8F8F"><B>&quot;0wx&quot;</FONT></B>, Word.toString (Array.sub (a, <B><FONT COLOR="#5F9EA0">0</FONT></B>)), <FONT COLOR="#BC8F8F"><B>&quot;\n&quot;</FONT></B>])
+
+<B><FONT COLOR="#A020F0">val</FONT></B> e = _export <FONT COLOR="#BC8F8F"><B>&quot;f3&quot;</FONT></B>: (unit -&gt; unit) -&gt; unit;
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = e (<B><FONT COLOR="#A020F0">fn</FONT></B> () =&gt; print <FONT COLOR="#BC8F8F"><B>&quot;hello\n&quot;</FONT></B>);
+<B><FONT COLOR="#A020F0">val</FONT></B> g3 = _import <FONT COLOR="#BC8F8F"><B>&quot;g3&quot;</FONT></B>: unit -&gt; unit;
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = g3 ()
+
+<I><FONT COLOR="#B22222">(* This example demonstrates mutual recursion between C and SML. *)</FONT></I>
+<B><FONT COLOR="#A020F0">val</FONT></B> e = _export <FONT COLOR="#BC8F8F"><B>&quot;f4&quot;</FONT></B>: (int -&gt; unit) -&gt; unit;
+<B><FONT COLOR="#A020F0">val</FONT></B> g4 = _import <FONT COLOR="#BC8F8F"><B>&quot;g4&quot;</FONT></B>: int -&gt; unit;
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = e (<B><FONT COLOR="#A020F0">fn</FONT></B> i =&gt; <B><FONT COLOR="#A020F0">if</FONT></B> i = <B><FONT COLOR="#5F9EA0">0</FONT></B> <B><FONT COLOR="#A020F0">then</FONT></B> () <B><FONT COLOR="#A020F0">else</FONT></B> g4 (i - <B><FONT COLOR="#5F9EA0">1</FONT></B>))
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = g4 <B><FONT COLOR="#5F9EA0">13</FONT></B>
+
+<B><FONT COLOR="#A020F0">val</FONT></B> (_, zzzSet) = _symbol <FONT COLOR="#BC8F8F"><B>&quot;zzz&quot;</FONT></B> alloc: (unit -&gt; int) * (int -&gt; unit);
+<B><FONT COLOR="#A020F0">val</FONT></B> () = zzzSet <B><FONT COLOR="#5F9EA0">42</FONT></B>
+<B><FONT COLOR="#A020F0">val</FONT></B> g5 = _import <FONT COLOR="#BC8F8F"><B>&quot;g5&quot;</FONT></B>: unit -&gt; unit;
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = g5 ()
+   
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = print <FONT COLOR="#BC8F8F"><B>&quot;success\n&quot;</FONT></B>
+
+</PRE>
+ 
+</p>
+<p>
+Create the header file with <tt>-export-header</tt>. 
+</p>
+
+<pre>% mlton -default-ann 'allowExport true' \
+        -default-ann 'allowImport true' \
+        -export-header export.h         \
+        -stop tc                        \
+        export.sml
+</pre><p>
+<tt>export.h</tt> now contains the following C prototypes. 
+</p>
+
+<pre>Word8 f (Word32 x0, Real64 x1, Word8 x2);
+Pointer f2 (Word8 x0);
+void f3 ();
+void f4 (Word32 x0);
+</pre><p>
+Use <tt>export.h</tt> in a C program, <tt>ffi-export.c</tt>, as follows. 
+</p>
+<p>
+<pre class=code>#<B><FONT COLOR="#5F9EA0">include</FONT></B> <FONT COLOR="#BC8F8F"><B>&lt;stdio.h&gt;</FONT></B>
+#<B><FONT COLOR="#5F9EA0">include</FONT></B> <FONT COLOR="#BC8F8F"><B>&quot;export.h&quot;</FONT></B>
+
+<FONT COLOR="#228B22"><B>void</FONT></B> <B><FONT COLOR="#0000FF">g</FONT></B> () {
+        Char c;
+
+        fprintf (stderr, <FONT COLOR="#BC8F8F"><B>&quot;g starting\n&quot;</FONT></B>);
+        c = f (13, 17.15, <FONT COLOR="#BC8F8F"><B>'a'</FONT></B>);
+        fprintf (stderr, <FONT COLOR="#BC8F8F"><B>&quot;g done  char = %c\n&quot;</FONT></B>, c);
+}
+
+Pointer <B><FONT COLOR="#0000FF">g2</FONT></B> () {
+        Pointer res;
+        fprintf (stderr, <FONT COLOR="#BC8F8F"><B>&quot;g2 starting\n&quot;</FONT></B>);
+        res = f2 (0xFF);
+        fprintf (stderr, <FONT COLOR="#BC8F8F"><B>&quot;g2 done\n&quot;</FONT></B>);
+        <B><FONT COLOR="#A020F0">return</FONT></B> res;
+}
+
+<FONT COLOR="#228B22"><B>void</FONT></B> <B><FONT COLOR="#0000FF">g3</FONT></B> () {
+        fprintf (stderr, <FONT COLOR="#BC8F8F"><B>&quot;g3 starting\n&quot;</FONT></B>);
+        f3 ();
+        fprintf (stderr, <FONT COLOR="#BC8F8F"><B>&quot;g3 done\n&quot;</FONT></B>);
+}
+
+<FONT COLOR="#228B22"><B>void</FONT></B> <B><FONT COLOR="#0000FF">g4</FONT></B> (Int i) {
+        fprintf (stderr, <FONT COLOR="#BC8F8F"><B>&quot;g4 (%d)\n&quot;</FONT></B>, i);
+        f4 (i);
+}
+
+<FONT COLOR="#228B22"><B>void</FONT></B> <B><FONT COLOR="#0000FF">g5</FONT></B> () {
+        fprintf (stderr, <FONT COLOR="#BC8F8F"><B>&quot;g5 ()\n&quot;</FONT></B>);
+        fprintf (stderr, <FONT COLOR="#BC8F8F"><B>&quot;zzz = %i\n&quot;</FONT></B>, zzz);
+        fprintf (stderr, <FONT COLOR="#BC8F8F"><B>&quot;g5 done\n&quot;</FONT></B>);
+}
+</PRE>
+ 
+</p>
+<p>
+Compile <tt>ffi-export.c</tt> and <tt>export.sml</tt>. 
+<pre>% gcc -c ffi-export.c
+% mlton -default-ann 'allowExport true' -default-ann 'allowImport true' export.sml ffi-export.o
+</pre>
+</p>
+<p>
+Finally, run <tt>export</tt>. 
+<pre>% ./export
+g starting
+...
+g4 (0)
+success
+</pre>
+</p>
+<h2 id="head-a479c9c34e878d07b4d67a73a48f432ad7dc53c8">Download</h2>
+
+    <ul>
+
+    <li>
+<p>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/*checkout*/mlton/trunk/doc/examples/ffi/export.sml">export.sml</a>
+ 
+</p>
+</li>
+    <li>
+<p>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/*checkout*/mlton/trunk/doc/examples/ffi/ffi-export.c">ffi-export.c</a>
+ 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-09 07:31:39 by <span title="pool-71-243-2-249.bos.east.verizon.net"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/CallingFromSMLToC
===================================================================
--- mlton/trunk/doc/guide/CallingFromSMLToC	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/CallingFromSMLToC	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,170 @@
+<!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>CallingFromSMLToC - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      CallingFromSMLToC
+    <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">
+MLton's <a href="ForeignFunctionInterface">ForeignFunctionInterface</a> allows an SML program to <em>import</em> C functions.  Suppose you would like to import from C a function with the following prototype: 
+<pre>int foo (double d, unsigned char c);
+</pre>MLton extends the syntax of SML to allow expressions like the following: 
+<pre>_import "foo": real * char -&gt; int;
+</pre>This expression denotes a function of type <tt>real&nbsp;*&nbsp;char&nbsp;-&gt;&nbsp;int</tt> whose behavior is implemented by calling the C function whose name is <tt>foo</tt>.  Thinking in terms of C, imagine that there are C variables <tt>d</tt> of type <tt>double</tt>, <tt>c</tt> of type <tt>unsigned&nbsp;char</tt>,  and <tt>i</tt> of type <tt>int</tt>.  Then, the C statement <tt>i&nbsp;=&nbsp;foo&nbsp;(d,&nbsp;c)</tt> is executed and <tt>i</tt> is returned. <p>
+The general form of an <tt>_import</tt> expresion is: 
+<pre>_import "C function name" attr... : cFuncTy;
+</pre>The type and the semicolon are not optional. 
+</p>
+<p>
+The function name is followed by a (possibly empty) sequence of attributes, analogous to C <tt>_attribute__</tt> specifiers.  For now, the only attributes supported are <tt>cdecl</tt> and <tt>stdcall</tt>. These specify the calling convention of the C function on Cygwin/Windows, and are ignored on all other platforms.  The default is <tt>cdecl</tt>.  You must use <tt>stdcall</tt> in order to correctly call Windows API functions. 
+</p>
+<h2 id="head-0f01ed56a1e32a05e5ef96e4d779f34784af9a96">Example</h2>
+<p>
+<tt>import.sml</tt> imports the C function <tt>ffi</tt> and the C variable <tt>FFI_INT</tt> as follows. 
+</p>
+<p>
+<pre class=code><I><FONT COLOR="#B22222">(* main.sml *)</FONT></I>
+
+<I><FONT COLOR="#B22222">(* Declare ffi to be implemented by calling the C function ffi. *)</FONT></I>
+<B><FONT COLOR="#A020F0">val</FONT></B> ffi = _import <FONT COLOR="#BC8F8F"><B>&quot;ffi&quot;</FONT></B>: real array * int ref * int -&gt; char;
+<B><FONT COLOR="#0000FF">open</FONT></B> Array
+
+<B><FONT COLOR="#A020F0">val</FONT></B> size = <B><FONT COLOR="#5F9EA0">10</FONT></B>
+<B><FONT COLOR="#A020F0">val</FONT></B> a = tabulate (size, <B><FONT COLOR="#A020F0">fn</FONT></B> i =&gt; real i)
+<B><FONT COLOR="#A020F0">val</FONT></B> r = ref <B><FONT COLOR="#5F9EA0">0</FONT></B>
+<B><FONT COLOR="#A020F0">val</FONT></B> n = <B><FONT COLOR="#5F9EA0">17</FONT></B>
+
+<I><FONT COLOR="#B22222">(* Call the C function *)</FONT></I>
+<B><FONT COLOR="#A020F0">val</FONT></B> c = ffi (a, r, n)
+
+<B><FONT COLOR="#A020F0">val</FONT></B> (nGet, nSet) = _symbol <FONT COLOR="#BC8F8F"><B>&quot;FFI_INT&quot;</FONT></B>: (unit -&gt; int) * (int -&gt; unit);
+
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = print (concat [Int.toString (nGet ()), <FONT COLOR="#BC8F8F"><B>&quot;\n&quot;</FONT></B>])
+
+<B><FONT COLOR="#A020F0">val</FONT></B> _ =
+   print (<B><FONT COLOR="#A020F0">if</FONT></B> c = #<FONT COLOR="#BC8F8F"><B>&quot;c&quot;</FONT></B> <B><FONT COLOR="#A020F0">andalso</FONT></B> !r = <B><FONT COLOR="#5F9EA0">45</FONT></B>
+             <B><FONT COLOR="#A020F0">then</FONT></B> <FONT COLOR="#BC8F8F"><B>&quot;success\n&quot;</FONT></B>
+          <B><FONT COLOR="#A020F0">else</FONT></B> <FONT COLOR="#BC8F8F"><B>&quot;fail\n&quot;</FONT></B>)
+</PRE>
+ 
+</p>
+<p>
+<tt>ffi-import.c</tt> is 
+</p>
+<p>
+<pre class=code>#<B><FONT COLOR="#5F9EA0">include</FONT></B> <FONT COLOR="#BC8F8F"><B>&quot;platform.h&quot;</FONT></B>
+
+Int FFI_INT = 13;
+Word FFI_WORD = 0xFF;
+Bool FFI_BOOL = TRUE;
+Real FFI_REAL = 3.14159;
+
+Char <B><FONT COLOR="#0000FF">ffi</FONT></B> (Pointer a1, Pointer a2, Int n) {
+        <FONT COLOR="#228B22"><B>double</FONT></B> *ds = (<FONT COLOR="#228B22"><B>double</FONT></B>*)a1;
+        <FONT COLOR="#228B22"><B>int</FONT></B> *p = (<FONT COLOR="#228B22"><B>int</FONT></B>*)a2;
+        <FONT COLOR="#228B22"><B>int</FONT></B> i;
+        <FONT COLOR="#228B22"><B>double</FONT></B> sum;
+
+        sum = 0.0;
+        <B><FONT COLOR="#A020F0">for</FONT></B> (i = 0; i &lt; GC_arrayNumElements (a1); ++i) {
+                sum += ds[i];
+                ds[i] += n;
+        }
+        *p = (<FONT COLOR="#228B22"><B>int</FONT></B>)sum;
+        <B><FONT COLOR="#A020F0">return</FONT></B> <FONT COLOR="#BC8F8F"><B>'c'</FONT></B>;
+}
+</PRE>
+ 
+</p>
+<p>
+Compile and run the program. 
+<pre>% mlton -default-ann 'allowImport true' import.sml ffi-import.c
+% ./import
+13
+success
+</pre>
+</p>
+<h2 id="head-a479c9c34e878d07b4d67a73a48f432ad7dc53c8">Download</h2>
+
+    <ul>
+
+    <li>
+<p>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/*checkout*/mlton/trunk/doc/examples/ffi/import.sml">import.sml</a>
+ 
+</p>
+</li>
+    <li>
+<p>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/*checkout*/mlton/trunk/doc/examples/ffi/ffi-import.c">ffi-import.c</a>
+ 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-3f170caead65df254d786032a409a6f6d204bca6">Next Steps</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="CallingFromSMLToCFunctionPointer">CallingFromSMLToCFunctionPointer</a> 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-09 07:33:27 by <span title="pool-71-243-2-249.bos.east.verizon.net"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/CallingFromSMLToCFunctionPointer
===================================================================
--- mlton/trunk/doc/guide/CallingFromSMLToCFunctionPointer	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/CallingFromSMLToCFunctionPointer	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,226 @@
+<!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>CallingFromSMLToCFunctionPointer - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      CallingFromSMLToCFunctionPointer
+    <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">
+Just as MLton can <a href="CallingFromSMLToC">directly call C functions</a>, it is possible to make indirect function calls; that is, function calls through a function pointer.  MLton extends the syntax of SML to allow expressions like the following: 
+<pre>_import * : MLton.Pointer.t -&gt; real * char -&gt; int;
+</pre><p>
+This expression denotes a function of type 
+<pre>MLton.Pointer.t -&gt; real * char -&gt; int</pre>whose behavior is implemented by calling the C function at the address denoted by the <tt>MLton.Pointer.t</tt> argument, and supplying the C function two arguments, a <tt>double</tt> and an <tt>int</tt>.  The C function pointer may be obtained, for example, by the dynamic linking loader (<tt>dlopen</tt>, <tt>dlsym</tt>, ...). 
+</p>
+<p>
+The general form of an indirect <tt>_import</tt> expression is: 
+</p>
+
+<pre>_import * attr... : cPtrTy -&gt; cFuncTy;
+</pre><p>
+The type and the semicolon are not optional. 
+</p>
+<h2 id="head-0f01ed56a1e32a05e5ef96e4d779f34784af9a96">Example</h2>
+<p>
+This example uses <tt>dlopen</tt> and friends (imported using normal <tt>_import</tt>) to dynamically load the math library (<tt>libm</tt>) and call the <tt>cos</tt> function. Suppose <tt>iimport.sml</tt> contains the following. 
+</p>
+<p>
+<pre class=code><B><FONT COLOR="#0000FF">signature</FONT></B> DYN_LINK =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> hndl
+      </FONT></B><B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> mode
+      </FONT></B><B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> fptr
+
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> dlopen : string * mode -&gt; hndl
+      <B><FONT COLOR="#A020F0">val</FONT></B> dlsym : hndl * string -&gt; fptr
+      <B><FONT COLOR="#A020F0">val</FONT></B> dlclose : hndl -&gt; unit
+
+      <B><FONT COLOR="#A020F0">val</FONT></B> RTLD_LAZY : mode
+      <B><FONT COLOR="#A020F0">val</FONT></B> RTLD_NOW : mode
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+
+<B><FONT COLOR="#0000FF">structure</FONT></B> DynLink :&gt; DYN_LINK =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> hndl </FONT></B>=<FONT COLOR="#228B22"><B> MLton.Pointer.t
+      </FONT></B><B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> mode </FONT></B>=<FONT COLOR="#228B22"><B> Word32.word
+      </FONT></B><B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> fptr </FONT></B>=<FONT COLOR="#228B22"><B> MLton.Pointer.t
+
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> dlopen =
+         _import <FONT COLOR="#BC8F8F"><B>&quot;dlopen&quot;</FONT></B> : string * mode -&gt; hndl;
+      <B><FONT COLOR="#A020F0">val</FONT></B> dlerror =
+         _import <FONT COLOR="#BC8F8F"><B>&quot;dlerror&quot;</FONT></B>: unit -&gt; MLton.Pointer.t;
+      <B><FONT COLOR="#A020F0">val</FONT></B> dlsym =
+         _import <FONT COLOR="#BC8F8F"><B>&quot;dlsym&quot;</FONT></B> : hndl * string -&gt; fptr;
+      <B><FONT COLOR="#A020F0">val</FONT></B> dlclose =
+         _import <FONT COLOR="#BC8F8F"><B>&quot;dlclose&quot;</FONT></B> : hndl -&gt; Int32.int;
+
+      <B><FONT COLOR="#A020F0">val</FONT></B> RTLD_LAZY = <B><FONT COLOR="#5F9EA0">0wx00001</FONT></B> <I><FONT COLOR="#B22222">(* Lazy function call binding.  *)</FONT></I>
+      <B><FONT COLOR="#A020F0">val</FONT></B> RTLD_NOW  = <B><FONT COLOR="#5F9EA0">0wx00002</FONT></B> <I><FONT COLOR="#B22222">(* Immediate function call binding.  *)</FONT></I>
+
+      <B><FONT COLOR="#A020F0">val</FONT></B> dlerror = <B><FONT COLOR="#A020F0">fn</FONT></B> () =&gt;
+         <B><FONT COLOR="#A020F0">let</FONT></B>
+            <B><FONT COLOR="#A020F0">val</FONT></B> addr = dlerror ()
+         <B><FONT COLOR="#A020F0">in</FONT></B>
+            <B><FONT COLOR="#A020F0">if</FONT></B> addr = MLton.Pointer.null
+               <B><FONT COLOR="#A020F0">then</FONT></B> NONE
+               <B><FONT COLOR="#A020F0">else</FONT></B> <B><FONT COLOR="#A020F0">let</FONT></B>
+                       <B><FONT COLOR="#A020F0">fun</FONT></B> loop (index, cs) =
+                          <B><FONT COLOR="#A020F0">let</FONT></B>
+                             <B><FONT COLOR="#A020F0">val</FONT></B> w = MLton.Pointer.getWord8 (addr, index)
+                             <B><FONT COLOR="#A020F0">val</FONT></B> c = Byte.byteToChar w
+                          <B><FONT COLOR="#A020F0">in</FONT></B>
+                             <B><FONT COLOR="#A020F0">if</FONT></B> c = #<FONT COLOR="#BC8F8F"><B>&quot;\000&quot;</FONT></B>
+                                <B><FONT COLOR="#A020F0">then</FONT></B> SOME (implode (rev cs))
+                                <B><FONT COLOR="#A020F0">else</FONT></B> loop (index + <B><FONT COLOR="#5F9EA0">1</FONT></B>, c::cs)
+                          <B><FONT COLOR="#A020F0">end</FONT></B>
+                    <B><FONT COLOR="#A020F0">in</FONT></B>
+                       loop (<B><FONT COLOR="#5F9EA0">0</FONT></B>, [])
+                    <B><FONT COLOR="#A020F0">end</FONT></B>
+         <B><FONT COLOR="#A020F0">end</FONT></B>
+
+      <B><FONT COLOR="#A020F0">val</FONT></B> dlopen = <B><FONT COLOR="#A020F0">fn</FONT></B> (filename, mode) =&gt;
+         <B><FONT COLOR="#A020F0">let</FONT></B>
+            <B><FONT COLOR="#A020F0">val</FONT></B> filename = filename ^ <FONT COLOR="#BC8F8F"><B>&quot;\000&quot;</FONT></B>
+            <B><FONT COLOR="#A020F0">val</FONT></B> hndl = dlopen (filename, mode)
+         <B><FONT COLOR="#A020F0">in</FONT></B>
+            <B><FONT COLOR="#A020F0">if</FONT></B> hndl = MLton.Pointer.null
+               <B><FONT COLOR="#A020F0">then</FONT></B> <B><FONT COLOR="#A020F0">raise</FONT></B> Fail (<B><FONT COLOR="#A020F0">case</FONT></B> dlerror () <B><FONT COLOR="#A020F0">of</FONT></B>
+                                   NONE =&gt; <FONT COLOR="#BC8F8F"><B>&quot;???&quot;</FONT></B>
+                                 | SOME s =&gt; s)
+               <B><FONT COLOR="#A020F0">else</FONT></B> hndl
+         <B><FONT COLOR="#A020F0">end</FONT></B>
+
+      <B><FONT COLOR="#A020F0">val</FONT></B> dlsym = <B><FONT COLOR="#A020F0">fn</FONT></B> (hndl, symbol) =&gt;
+         <B><FONT COLOR="#A020F0">let</FONT></B>
+            <B><FONT COLOR="#A020F0">val</FONT></B> symbol = symbol ^ <FONT COLOR="#BC8F8F"><B>&quot;\000&quot;</FONT></B>
+            <B><FONT COLOR="#A020F0">val</FONT></B> fptr = dlsym (hndl, symbol)
+         <B><FONT COLOR="#A020F0">in</FONT></B>
+            <B><FONT COLOR="#A020F0">case</FONT></B> dlerror () <B><FONT COLOR="#A020F0">of</FONT></B>
+               NONE =&gt; fptr
+             | SOME s =&gt; <B><FONT COLOR="#A020F0">raise</FONT></B> Fail s
+         <B><FONT COLOR="#A020F0">end</FONT></B>
+
+      <B><FONT COLOR="#A020F0">val</FONT></B> dlclose = <B><FONT COLOR="#A020F0">fn</FONT></B> hndl =&gt;
+         <B><FONT COLOR="#A020F0">if</FONT></B> MLton.Platform.OS.host = MLton.Platform.OS.Darwin
+            <B><FONT COLOR="#A020F0">then</FONT></B> ()  <I><FONT COLOR="#B22222">(* Darwin reports the following error message if you
+                      * try to close a dynamic library.
+                      *   &quot;dynamic libraries cannot be closed&quot;
+                      * So, we disable dlclose on Darwin.
+                      *)</FONT></I>
+         <B><FONT COLOR="#A020F0">else</FONT></B>
+            <B><FONT COLOR="#A020F0">let</FONT></B>
+               <B><FONT COLOR="#A020F0">val</FONT></B> res = dlclose hndl
+            <B><FONT COLOR="#A020F0">in</FONT></B>
+               <B><FONT COLOR="#A020F0">if</FONT></B> res = <B><FONT COLOR="#5F9EA0">0</FONT></B>
+                  <B><FONT COLOR="#A020F0">then</FONT></B> ()
+               <B><FONT COLOR="#A020F0">else</FONT></B> <B><FONT COLOR="#A020F0">raise</FONT></B> Fail (<B><FONT COLOR="#A020F0">case</FONT></B> dlerror () <B><FONT COLOR="#A020F0">of</FONT></B>
+                                   NONE =&gt; <FONT COLOR="#BC8F8F"><B>&quot;???&quot;</FONT></B>
+                                 | SOME s =&gt; s)
+            <B><FONT COLOR="#A020F0">end</FONT></B>
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+
+<B><FONT COLOR="#A020F0">val</FONT></B> dll =
+   <B><FONT COLOR="#A020F0">let</FONT></B>
+      <B><FONT COLOR="#0000FF">open</FONT></B> MLton.Platform.OS
+   <B><FONT COLOR="#A020F0">in</FONT></B>
+      <B><FONT COLOR="#A020F0">case</FONT></B> host <B><FONT COLOR="#A020F0">of</FONT></B>
+         Cygwin =&gt; <FONT COLOR="#BC8F8F"><B>&quot;cygwin1.dll&quot;</FONT></B>
+       | Darwin =&gt; <FONT COLOR="#BC8F8F"><B>&quot;libm.dylib&quot;</FONT></B>
+       | _ =&gt; <FONT COLOR="#BC8F8F"><B>&quot;libm.so&quot;</FONT></B>
+   <B><FONT COLOR="#A020F0">end</FONT></B>
+
+<B><FONT COLOR="#A020F0">val</FONT></B> hndl = DynLink.dlopen (dll, DynLink.RTLD_LAZY)
+
+<B><FONT COLOR="#0000FF">local</FONT></B>
+   <B><FONT COLOR="#A020F0">val</FONT></B> double_to_double =
+      _import * : DynLink.fptr -&gt; real -&gt; real;
+   <B><FONT COLOR="#A020F0">val</FONT></B> cos_fptr = DynLink.dlsym (hndl, <FONT COLOR="#BC8F8F"><B>&quot;cos&quot;</FONT></B>)
+<B><FONT COLOR="#0000FF">in</FONT></B>
+   <B><FONT COLOR="#A020F0">val</FONT></B> cos = double_to_double cos_fptr
+<B><FONT COLOR="#0000FF">end</FONT></B>
+
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = print (concat [<FONT COLOR="#BC8F8F"><B>&quot;    Math.cos(2.0) = &quot;</FONT></B>, Real.toString (Math.cos <B><FONT COLOR="#5F9EA0">2.0</FONT></B>), <FONT COLOR="#BC8F8F"><B>&quot;\n&quot;</FONT></B>,
+                       <FONT COLOR="#BC8F8F"><B>&quot;libm.so::cos(2.0) = &quot;</FONT></B>, Real.toString (cos <B><FONT COLOR="#5F9EA0">2.0</FONT></B>), <FONT COLOR="#BC8F8F"><B>&quot;\n&quot;</FONT></B>])
+
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = DynLink.dlclose hndl
+</PRE>
+ 
+</p>
+<p>
+Compile and run <tt>iimport.sml</tt>. 
+<pre>% mlton -default-ann 'allowImport true' \
+        -target-link-opt linux -ldl     \
+        -target-link-opt solaris -ldl   \
+         iimport.sml
+% iimport
+    Math.cos(2.0) = ~0.416146836547
+libm.so::cos(2.0) = ~0.416146836547
+</pre>
+</p>
+<p>
+This example also shows the <tt>-target-link-opt</tt> option, which uses the switch when linking only when on the specified platform.  Compile with <tt>-verbose&nbsp;1</tt> to see in more detail what's being passed to <tt>gcc</tt>. 
+</p>
+<h2 id="head-a479c9c34e878d07b4d67a73a48f432ad7dc53c8">Download</h2>
+
+    <ul>
+
+    <li>
+<p>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/*checkout*/mlton/trunk/doc/examples/ffi/iimport.sml">iimport.sml</a>
+ 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-09 07:34:19 by <span title="pool-71-243-2-249.bos.east.verizon.net"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/ChrisClearwater
===================================================================
--- mlton/trunk/doc/guide/ChrisClearwater	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/ChrisClearwater	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,59 @@
+<!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>ChrisClearwater - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      ChrisClearwater
+    <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">
+Describe ChrisClearwater here. </div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-16 03:14:21 by <span title="ip68-108-35-167.lv.lv.cox.net"><a href="ChrisClearwater">ChrisClearwater</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Chunkify
===================================================================
--- mlton/trunk/doc/guide/Chunkify	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Chunkify	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,72 @@
+<!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>Chunkify - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Chunkify
+    <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">
+An analysis pass for the <a href="RSSA">RSSA</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="ToMachine">ToMachine</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Partitions all the labels (function and block) in a <a href="RSSA">RSSA</a> program into disjoint sets, referred to as chunks. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/backend/chunkify.sig?view=markup">chunkify.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/backend/chunkify.fun?view=markup">chunkify.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+<p>
+Breaking large <a href="RSSA">RSSA</a> functions into chunks is necessary for reasonable <tt>gcc</tt> compile times with the <a class="nonexistent" href="CCodegen">CCodegen</a>. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:43:04 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Closure
===================================================================
--- mlton/trunk/doc/guide/Closure	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Closure	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,84 @@
+<!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>Closure - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Closure
+    <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">
+A closure is a data structure that is the run-time representation of a function. <h2 id="head-c89ca68e44beb2aeaa7fa392ca452792f302e18c">Typical Implementation</h2>
+<p>
+In a typical implementation, a closure consists of a <em>code pointer</em> (indicating what the function does) and an <em>environment</em> containing the values of the free variables of the function.  For example, in the expression 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">let</FONT></B>
+   <B><FONT COLOR="#A020F0">val</FONT></B> x = <B><FONT COLOR="#5F9EA0">5</FONT></B>
+<B><FONT COLOR="#A020F0">in</FONT></B>
+   <B><FONT COLOR="#A020F0">fn</FONT></B> y =&gt; x + y
+<B><FONT COLOR="#A020F0">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<p>
+the closure for <tt>fn&nbsp;y&nbsp;=&gt;&nbsp;x&nbsp;+&nbsp;y</tt> contains a pointer to a piece of code that knows to take its argument and add the value of <tt>x</tt> to it, plus the environment recording the value of <tt>x</tt> as<tt>5</tt>. 
+</p>
+<p>
+To call a function, the code pointer is extracted and jumped to, passing in some agreed upon location the environment and the argument. 
+</p>
+<h2 id="head-ca4b0e2ce966921179ffc843f53997c622b12c20">MLton's Implementation</h2>
+<p>
+MLton does not implement closures traditionally.  Instead, based on whole-program higher-order control-flow analysis, MLton represents a function as an element of a sum type, where the variant indicates which function it is and carries the free variables as arguments.  See <a href="ClosureConvert">ClosureConvert</a> and <a href = "References#CejtinEtAl00">CejtinEtAl00</a> for details. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-26 20:36:54 by <span title="cfs36.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/ClosureConvert
===================================================================
--- mlton/trunk/doc/guide/ClosureConvert	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/ClosureConvert	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,75 @@
+<!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>ClosureConvert - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      ClosureConvert
+    <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">
+An translation pass from the <a href="SXML">SXML</a> <a href="IntermediateLanguage">IntermediateLanguage</a> to the <a href="SSA">SSA</a> <a href="IntermediateLanguage">IntermediateLanguage</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Converts a <a href="SXML">SXML</a> program into a <a href="SSA">SSA</a> program.   
+</p>
+<p>
+<a class="nonexistent" href="Defunctionalization">Defunctionalization</a> is the technique used to eliminate <a href="Closure">Closure</a>s (see <a href = "References#CejtinEtAl00">CejtinEtAl00</a>). 
+</p>
+<p>
+Uses <a href="Globalize">Globalize</a> and <a href="LambdaFree">LambdaFree</a> analyses. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/closure-convert/closure-convert.sig?view=markup">closure-convert.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/closure-convert/closure-convert.fun?view=markup">closure-convert.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:42:48 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/CommonArg
===================================================================
--- mlton/trunk/doc/guide/CommonArg	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/CommonArg	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,258 @@
+<!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>CommonArg - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      CommonArg
+    <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">
+An optimization pass for the <a href="SSA">SSA</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="SSASimplify">SSASimplify</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Optimizes instances of <tt>Goto</tt> transfers that pass the same arguments to the same label; e.g.  
+<pre>L_1 ()
+  ... 
+  z1 = ? 
+  ... 
+  L_3 (x, y, z1)
+L_2 ()
+  ... 
+  z2 = ? 
+  ...
+  L_3 (x, y, z2)
+L_3 (a, b, c)
+  ...
+</pre> This code can be simplified to:  
+<pre>L_1 ()
+  ... 
+  z1 = ? 
+  ... 
+  L_3 (z1)
+L_2 ()
+  ... 
+  z2 = ? 
+  ...
+  L_3 (z2)
+L_3 (c)
+  a = x
+  b = y
+</pre>which saves a number of resources: time of setting up the arguments for the jump to <tt>L_3</tt>, space (either stack or pseudo-registers) for the arguments of <tt>L_3</tt>, etc.  It may also expose some other optimizations, if more information is known about <tt>x</tt> or <tt>y</tt>. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/common-arg.sig?view=markup">common-arg.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/common-arg.fun?view=markup">common-arg.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+<p>
+Three analyses were originally proposed to drive the optimization transformation.  Only the <em>Dominator Analysis</em> is currently implemented.  (Implementations of the other analyses are available in the Subversion repository.) 
+</p>
+<h4 id="head-9658a3d16f7d3e0a09ce9f0001035a0a0733c771">Syntactic Analysis</h4>
+<p>
+The simplest analysis I could think of maintains  
+<pre>varInfo: Var.t -&gt; Var.t option list ref
+</pre> initialized to <tt>[]</tt>. 
+</p>
+<p>
+For each variable <tt>v</tt> bound in a <tt>Statement.t</tt> or in the <tt>Function.t</tt> args, then <tt>List.push(varInfo&nbsp;v,&nbsp;NONE)</tt>. For each  <tt>L&nbsp;(x1,&nbsp;...,&nbsp;xn)</tt> transfer where <tt>(a1,&nbsp;...,&nbsp;an)</tt> are the formals of <tt>L</tt>, then <tt>List.push(varInfo&nbsp;ai,&nbsp;SOME&nbsp;xi)</tt>. For each block argument a used in an unknown context (e.g., arguments of blocks used as continuations, handlers, arith success, runtime return, or case switch labels), then <tt>List.push(varInfo&nbsp;a,&nbsp;NONE)</tt>. 
+</p>
+<p>
+Now, any block argument <tt>a</tt> such that <tt>varInfo&nbsp;a&nbsp;=&nbsp;xs</tt>, where all of the elements of <tt>xs</tt> are equal to <tt>SOME&nbsp;x</tt>, can be optimized by setting  <tt>a&nbsp;=&nbsp;x</tt> at the beginning of the block and dropping the argument from <tt>{Goto</tt> transfers. 
+</p>
+<p>
+That takes care of the example above.  We can clearly do slightly better, by changing the transformation criteria to the following: any block argument a such that <tt>varInfo&nbsp;a&nbsp;=&nbsp;xs</tt>, where all of the elements of <tt>xs</tt> are equal to <tt>SOME&nbsp;x</tt> <em>or</em> are equal to <tt>SOME&nbsp;a</tt>, can be optimized by setting  <tt>a&nbsp;=&nbsp;x</tt>  at the beginning of the block and dropping the argument from <tt>Goto</tt> transfers.  This optimizes a case like:  
+<pre>L_1 () 
+  ... z1 = ? ... 
+  L_3 (x, y, z1)
+L_2 () 
+  ... z2 = ? ...
+  L_3(x, y, z2)
+L_3 (a, b, c)
+  ... w = ? ...
+  case w of 
+    true =&gt; L_4 | false =&gt; L_5
+L_4 ()
+   ...
+   L_3 (a, b, w)
+L_5 () 
+   ...
+</pre>where a common argument is passed to a loop (and is invariant through the loop).  Of course, the <a href="LoopInvariant">LoopInvariant</a> optimization pass would normally introduce a local loop and essentially reduce this to the first example, but I have seen this in practice, which suggests that some optimizations after <a href="LoopInvariant">LoopInvariant</a> do enough simplifications to introduce (new) loop invariant arguments. 
+</p>
+<h4 id="head-391c452724ec2ff821c0c2798ad26914f131f018">Fixpoint Analysis</h4>
+<p>
+However, the above analysis and transformation doesn't cover the cases where eliminating one common argument exposes the opportunity to eliminate other common arguments.  For example:  
+<pre>L_1 () 
+  ...
+  L_3 (x)
+L_2 ()
+  ...
+  L_3 (x)
+L_3 (a) 
+  ...
+  L_5 (a)
+L_4 () 
+  ...
+  L_5 (x)
+L_5 (b)
+  ...
+</pre>One pass of analysis and transformation would eliminate the argument to <tt>L_3</tt> and rewrite the <tt>L_5(a)</tt> transfer to <tt>L_5&nbsp;(x)</tt>, thereby exposing the opportunity to eliminate the common argument to <tt>L_5</tt>. 
+</p>
+<p>
+The interdependency the arguments to <tt>L_3</tt> and <tt>L_5</tt> suggest performing some sort of fixed-point analysis.  This analysis is relatively simple; maintain  
+<pre>varInfo: Var.t -&gt; VarLattice.t
+</pre> where  
+<pre>VarLattice.t ~=~ Bot | Point of Var.t | Top
+</pre> (but as implemented by the <a class="nonexistent" href="FlatLattice">FlatLattice</a> functor with a <tt>lessThan</tt> list and <tt>value&nbsp;ref</tt> under the hood), initialized to <tt>Bot</tt>. 
+</p>
+<p>
+For each variable <tt>v</tt> bound in a <tt>Statement.t</tt> or in the <tt>Function.t</tt> args, then <tt>VarLattice.&lt;=&nbsp;(Point&nbsp;v,&nbsp;varInfo&nbsp;v)</tt> For each  <tt>L&nbsp;(x1,&nbsp;...,&nbsp;xn)</tt> transfer where <tt>(a1,&nbsp;...,&nbsp;an)</tt> are the formals of <tt>L</tt>}, then <tt>VarLattice.&lt;=&nbsp;(varInfo&nbsp;xi,&nbsp;varInfo&nbsp;ai)</tt>. For each block argument a used in an unknown context, then <tt>VarLattice.&lt;=&nbsp;(Point&nbsp;a,&nbsp;varInfo&nbsp;a)</tt>. 
+</p>
+<p>
+Now, any block argument a such that <tt>varInfo&nbsp;a&nbsp;=&nbsp;Point&nbsp;x</tt> can be optimized by setting <tt>a&nbsp;=&nbsp;x</tt> at the beginning of the block and dropping the argument from <tt>Goto</tt> transfers. 
+</p>
+<p>
+Now, with the last example, we introduce the ordering constraints:  
+</p>
+
+    <ul>
+
+ 
+<pre>varInfo x &lt;= varInfo a
+varInfo a &lt;= varInfo b
+varInfo x &lt;= varInfo b
+</pre>
+    </ul>
+
+
+<p>
+Assuming that <tt>varInfo&nbsp;x&nbsp;=&nbsp;Point&nbsp;x</tt>, then we get <tt>varInfo&nbsp;a&nbsp;=&nbsp;Point&nbsp;x</tt> and <tt>varInfo&nbsp;b&nbsp;=&nbsp;Point&nbsp;x</tt>, and we optimize the example as desired. 
+</p>
+<p>
+But, that is a rather weak assumption.  It's quite possible for <tt>varInfo&nbsp;x&nbsp;=&nbsp;Top</tt>.  For example, consider: 
+<pre>G_1 () 
+  ... n = 1 ...
+  L_0 (n)
+G_2 () 
+  ... m = 2 ...
+  L_0 (m)
+L_0 (x) 
+  ...
+L_1 () 
+  ...
+  L_3 (x)
+L_2 ()
+  ...
+  L_3 (x)
+L_3 (a)
+  ...
+  L_5(a)
+L_4 ()
+  ...
+  L_5(x)
+L_5 (b) 
+   ...
+</pre>Now <tt>varInfo&nbsp;x&nbsp;=&nbsp;varInfo&nbsp;a&nbsp;=&nbsp;varInfo&nbsp;b&nbsp;=&nbsp;Top</tt>.  What went wrong here? When <tt>varInfo&nbsp;x</tt> went to <tt>Top</tt>, it got propagated all the way through to <tt>a</tt> and <tt>b</tt>, and prevented the elimination of any common arguments.  What we'd like to do instead is when <tt>varInfo&nbsp;x</tt> goes to <tt>Top</tt>, propagate on <tt>Point&nbsp;x</tt> -- we have no hope of eliminating <tt>x</tt>, but if we hold <tt>x</tt> constant, then we have a chance of eliminating arguments for which <tt>x</tt> is passed as an actual. 
+</p>
+<h4 id="head-31d2f75a6c210512fa42401e00d0b609716ec3b5">Dominator Analysis</h4>
+<p>
+Does anyone see where this is going yet?  Pausing for a little thought, <a href="MatthewFluet">MatthewFluet</a> realized that he had once before tried proposing this kind of "fix" to a fixed-point analysis -- when we were first investigating the <a href="Contify">Contify</a> optimization in light of John Reppy's CWS paper.  Of course, that "fix" failed because it defined a non-monotonic function and one couldn't take the fixed point.  But, <a href="StephenWeeks">StephenWeeks</a> suggested a dominator based approach, and we were able to show that, indeed, the dominator analysis subsumed both the previous call based analysis and the cont based analysis.  And, a moment's reflection reveals further parallels:  when <tt>varInfo:&nbsp;Var.t&nbsp;-&gt;&nbsp;Var.t&nbsp;option&nbsp;list&nbsp;ref</tt>, we have something analogous to the call analysis, and when <tt>varInfo:&nbsp;Var.t&nbsp;-&gt;&nbsp;VarLattice.t</tt>, we have something analogous to the cont analysis.  Maybe there is something analogous to the dominator approach (and therefore superior to the previous analyses). 
+</p>
+<p>
+And this turns out to be the case.  Construct the graph <tt>G</tt> as follows:  
+</p>
+
+    <ul>
+
+ 
+<pre>nodes(G) = {Root} U Var.t
+edges(G) = {Root -&gt; v | v bound in a Statement.t or
+                                in the Function.t args} U
+           {xi -&gt; ai | L(x1, ..., xn) transfer where (a1, ..., an) are the formals of L} U
+           {Root -&gt; a | a is a block argument used in an unknown context}
+</pre>
+    </ul>
+
+
+<p>
+Let <tt>idom(x)</tt> be the immediate dominator of <tt>x</tt> in <tt>G</tt> with root <tt>Root</tt>. Now, any block argument a such that <tt>idom(a)&nbsp;=&nbsp;x&nbsp;&lt;&gt;&nbsp;Root</tt> can be optimized by setting <tt>a&nbsp;=&nbsp;x</tt> at the beginning of the block and dropping the argument from <tt>Goto</tt> transfers. 
+</p>
+<p>
+Furthermore, experimental evidence suggests (and we are confident that a formal presentation could prove) that the dominator analysis subsumes the "syntactic" and "fixpoint" based analyses in this context as well and that the dominator analysis gets "everything" in one go. 
+</p>
+<h4 id="head-e163a6e8bdc0e8e8e2cb41c825525e3f18b2eec0">Final Thoughts</h4>
+<p>
+I must admit, I was rather suprised at this progression and final result.  At the outset, I never would have thought of a connection between <a href="Contify">Contify</a> and CommonArg optimizations.  They would seem to be two completely different optimizations.  Although, this may not really be the case.  As one of the reviewers of the ICFP paper said: 
+</p>
+
+        <ul>
+
+  I understand that such a form of CPS might be convenient in some   cases, but when we're talking about analyzing code to detect that   some continuation is constant, I think it makes a lot more sense to   make all the continuation arguments completely explicit. <p>
+  I believe that making all the continuation arguments explicit will   show that the optimization can be generalized to eliminating   constant arguments, whether continuations or not. 
+</p>
+
+        </ul>
+
+
+<p>
+What I think the common argument optimization shows is that the dominator analysis does slightly better than the reviewer puts it: we find more than just constant continuations, we find common continuations.  And I think this is further justified by the fact that I have observed common argument eliminate some <tt>env_X</tt> arguments which would appear to correspond to determining that while the closure being executed isn't constant it is at least the same as the closure being passed elsewhere. 
+</p>
+<p>
+At first, I was curious whether or not we had missed a bigger picture with the dominator analysis.  When we wrote the contification paper, I assumed that the dominator analysis was a specialized solution to a specialized problem; we never suggested that it was a technique suited to a larger class of analyses.  After initially finding a connection between <a href="Contify">Contify</a> and CommonArg (and thinking that the only connection was the technique), I wondered if the dominator technique really was applicable to a larger class of analyses.  That is still a question, but after writing up the above, I'm suspecting that the "real story" is that the dominator analysis is a solution to the common argument optimization, and that the <a href="Contify">Contify</a> optimization is specializing CommonArg to the case of continuation arguments (with a different transformation at the end).  (Note, a whole-program, inter-procedural common argument analysis doesn't really make sense (in our <a href="SSA">SSA</a> <a href="IntermediateLanguage">IntermediateLanguage</a>), because the only way of passing values between functions is as arguments.  (Unless of course in the case that the common argument is also a constant argument, in which case <a href="ConstantPropagation">ConstantPropagation</a> could lift it to a global.)  The inter-procedural <a href="Contify">Contify</a> optimization works out because there we move the function to the argument.) 
+</p>
+<p>
+Anyways, it's still unclear to me whether or not the dominator based approach solves other kinds of problems.   
+</p>
+<h4 id="head-281b6a33f8767214a7090e6db6c27c9e979c50b9">Phase Ordering</h4>
+<p>
+On the downside, the optimization doesn't have a huge impact on runtime, although it does predictably saved some code size.  I stuck it in the optimization sequence after <a href="Flatten">Flatten</a> and (the third round of) <a href="LocalFlatten">LocalFlatten</a>, since it seems to me that we could have cases where some components of a tuple used as an argument are common, but the whole tuple isn't.  I think it makes sense to add it after <a href="IntroduceLoops">IntroduceLoops</a> and <a href="LoopInvariant">LoopInvariant</a> (even though CommonArg get some things that <a href="LoopInvariant">LoopInvariant</a> gets, it doesn't get all of them).  I also think that it makes sense to add it before <a href="CommonSubexp">CommonSubexp</a>, since identifying variables could expose more common subexpressions.  I would think a similar thought applies to <a href="RedundantTests">RedundantTests</a>. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:42:33 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/CommonBlock
===================================================================
--- mlton/trunk/doc/guide/CommonBlock	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/CommonBlock	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,127 @@
+<!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>CommonBlock - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      CommonBlock
+    <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">
+<p>
+An optimization pass for the <a href="SSA">SSA</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="SSASimplify">SSASimplify</a>. 
+</p>
+<h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Eliminate equivalent blocks in a <a href="SSA">SSA</a> function.  The equivalence criteria requires blocks to have no arguments or statements and transfer via <tt>Raise</tt>, <tt>Return</tt>, or <tt>Goto</tt> of a single global variable. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/common-block.sig?view=markup">common-block.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/common-block.fun?view=markup">common-block.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+
+    <ul>
+
+    <li>
+<p>
+ Rewrites 
+<pre> L_X ()
+   raise (global_Y)
+</pre> to 
+<pre> L_X ()
+   L_Y' ()
+</pre> and adds 
+<pre> L_Y' ()
+   raise (global_Y)
+</pre> to the <a href="SSA">SSA</a> function.
+</p>
+</li>
+    <li>
+<p>
+ Rewrites 
+<pre> L_X ()
+   return (global_Y)
+</pre> to 
+<pre> L_X ()
+   L_Y' ()
+</pre> and adds 
+<pre> L_Y' ()
+   return (global_Y)
+</pre> to the <a href="SSA">SSA</a> function.
+</p>
+</li>
+    <li>
+<p>
+ Rewrites 
+<pre> L_X ()
+   L_Z (global_Y)
+</pre> to 
+<pre> L_X ()
+   L_Y' ()
+</pre> and adds 
+<pre> L_Y' ()
+   L_Z (global_Y)
+</pre> to the <a href="SSA">SSA</a> function.
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+The <a href="Shrink">Shrink</a> pass rewrites all uses of <tt>L_X</tt> to <tt>L_Y'</tt> and drops <tt>L_X</tt>. 
+</p>
+<p>
+For example, all uncaught <tt>Overflow</tt> exceptions in a <a href="SSA">SSA</a> function share the same raising block. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:42:07 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/CommonSubexp
===================================================================
--- mlton/trunk/doc/guide/CommonSubexp	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/CommonSubexp	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,134 @@
+<!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>CommonSubexp - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      CommonSubexp
+    <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">
+<p>
+An optimization pass for the <a href="SSA">SSA</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="SSASimplify">SSASimplify</a>. 
+</p>
+<h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Eliminate instances of common subexpressions. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/common-subexp.sig?view=markup">common-subexp.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/common-subexp.fun?view=markup">common-subexp.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+<p>
+In addition to getting the usual sorts of things like  
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ 
+<pre> (w + 0wx1) + (w + 0wx1)
+</pre> rewritten to 
+<pre> let val w' = w + 0wx1 in w' + w' end
+</pre>
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+it also gets things like 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ 
+<pre> val a = Array_array n
+ val b = Array_length a
+</pre> rewritten to 
+<pre> val a = Array_array n
+ val b = n
+</pre>
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+<tt>Arith</tt> transfers are handled specially.  The <em>result</em> of an <tt>Arith</tt> transfer can be used in <em>common</em> <tt>Arith</tt> transfers that it dominates: 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ 
+<pre>  val l = (n + m) + (n + m)
+
+  val k = (l + n) + ((l + m) handle Overflow =&gt; ((l + m) handle Overflow =&gt; l + n)) 
+</pre> is rewritten so that <tt>(n&nbsp;+&nbsp;m)</tt> is computed exactly once, as
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+are <tt>(l&nbsp;+&nbsp;n)</tt> and <tt>(l&nbsp;+&nbsp;m)</tt>. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:41:48 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/CompilationManager
===================================================================
--- mlton/trunk/doc/guide/CompilationManager	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/CompilationManager	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,111 @@
+<!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>CompilationManager - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      CompilationManager
+    <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">
+For porting code from SML/NJ and for developing code for MLton under SML/NJ, MLton supports a very limited subset of SML/NJ's <a class="external" href="http://www.smlnj.org/doc/CM/index.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Compilation Manager</a> (CM) files.  From MLton's point of view, a CM file <tt>foo.cm</tt> defines a list of SML source files.  The call <tt>mlton&nbsp;foo.cm</tt> is equivalent to compiling an SML program consisting of the concatenation of these files.  As always with MLton, the concatenation must be the whole program you wish to compile. <p>
+In its simplest form, a CM file contains the keywords <tt>Group&nbsp;is</tt> followed by an explicit list of sml files. For example, if <tt>foo.cm</tt> contains  
+<pre>Group is
+bar.sig
+bar.fun
+main.sml
+</pre>then a call <tt>mlton&nbsp;foo.cm</tt> is equivalent to concatenating the three files together and calling MLton on that SML file.  The list of files defined by a CM file is the same as the order in which the filenames appear in the CM file.  Thus, order in a CM file matters. In the above example, if <tt>main.sml</tt> refers to a structure defined in <tt>bar.fun</tt>, then <tt>main.sml</tt> must appear after <tt>bar.fun</tt> in the file list. 
+</p>
+<p>
+CM files can also refer to other CM files.  A reference to <tt>bar.cm</tt> from within <tt>foo.cm</tt> means to include all of the SML files defined by <tt>bar.cm</tt> before any of the subsequent files in <tt>foo.cm</tt>.  For example if <tt>foo.cm</tt> contains 
+<pre>Group is
+bar.cm
+main.sml
+</pre>and <tt>bar.cm</tt> contains 
+<pre>Group is
+bar.sig
+bar.fun
+</pre>then a call to <tt>mlton&nbsp;foo.cm</tt> is equivalent to compiling the concatenation of <tt>bar.sig</tt>, <tt>bar.fun</tt>, and <tt>main.sml</tt>. 
+</p>
+<p>
+CM also has a preprocessor mechanism that allows files to be conditionally included.  This can be useful when developing code with SML/NJ and MLton.  In SML/NJ, the preprocessor defines the symbol <tt>SMLNJ_VERSION</tt>.  In MLton, no symbols are defined. So, to conditionally include <tt>foo.sml</tt> when compiling under SML/NJ, one can use the following pattern. 
+<pre># if (defined(SMLNJ_VERSION))
+foo.sml
+# endif
+</pre>To conditionally include <tt>foo.sml</tt> when compiling under MLton, one can negate the test. 
+<pre># if (! defined(SMLNJ_VERSION))
+foo.sml
+# endif
+</pre>
+</p>
+<p>
+The filenames listed in a CM file can be either absolute paths or relative paths, in which case they are interpreted relative to the directory containing the CM file.  If a CM file refers either directly or indirectly to an SML source file in more than one way, only the first occurrence of the file is included.  Finally, the only valid file suffixes in a CM file are <tt>.cm</tt>, <tt>.fun</tt>, <tt>.sig</tt>, and <tt>.sml</tt>. 
+</p>
+<h2 id="head-ca00d604dc703957fefda79998b469d29c782097">Comparison with CM</h2>
+<p>
+If you are unfamiliar with CM under SML/NJ, then you can skip this section. 
+</p>
+<p>
+MLton supports the full syntax of CM as of SML/NJ version 110.9.1.  Extensions since then are unsupported.  Also, many of the syntactic constructs are ignored.  The most important difference between the two is that order in CM files matters to MLton but not to CM, which performs automatic dependency analysis.  Also, CM supports export filters, which restricts the visibility of modules. MLton ignores export filters.  As a consequence, it is possible that a program that is accepted by SML/NJ's CM might not be accepted by MLton's CM.  In this case, you will have to manually reorder the files and possibly rename modules so that the concatenation of the files is the program you intend. 
+</p>
+<p>
+CM performs cutoff recompilation to avoid recompiling the entire program, while MLton always compiles the entire program.  CM makes a distinction between groups and libraries, which MLton does not. CM supports other tools like lex and yacc, while MLton does not. MLton relies on traditional makefiles to use other tools. 
+</p>
+<h2 id="head-193cb628868edba7572702dfc2473d103eecc836">Porting SML/NJ CM files to MLton</h2>
+<p>
+If you have already created large projects using SML/NJ and CM, there may be a large number of file dependencies implicit in your sources that are not reflected in your CM files.  Because MLton relies on ordering in CM files, your CM files probably will not work with MLton.  To help in porting CM files to MLton, the MLton distribution includes the sources for a utility, <tt>cmcat</tt>, that will print an ordered list of files corresponding to a CM file.  See <tt>doc/cmcat/cmcat.sml</tt> for details.  Building <tt>cmcat</tt> requires that you have already installed SML/NJ version 110.44. 
+</p>
+<p>
+Alternatively, you may convert your CM files to <tt>.mlb</tt> files.  The MLton distribution includes the sources for a utility, <tt>cm2mlb</tt>, that will print a <a href="MLBasis"> ML Basis</a> file with essentially the same semantics as the CM file -- handling the full syntax of CM supported by your installed SML/NJ version and correctly handling export filters.  When <tt>cm2mlb</tt> encounters a <tt>.cm</tt> import, it attempts to convert it to a corresponding <tt>.mlb</tt> import.  CM anchors are translated to paths according to a configuration file in <tt>.mlton/cm2mlb-map</tt> in the user's home directory (which must be given by the <tt>HOME</tt> environment variable.  For example, adding 
+<pre>basis  $(SML_LIB)/basis
+</pre>to your <tt>cm2mlb-map</tt> file will ensure that a <tt>$/basis.cm</tt> import is translated to a <tt>$(MLTON_ROOT)/basis/basis.mlb</tt> import. See <tt>doc/cmcat/cm2mlb</tt> for details.  Building <tt>cm2mlb</tt> requires that you have already installed SML/NJ version 110.44. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-18 21:31:49 by <span title="net-79206.roam.fas.harvard.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/CompileTimeOptions
===================================================================
--- mlton/trunk/doc/guide/CompileTimeOptions	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/CompileTimeOptions	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,491 @@
+<!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>CompileTimeOptions - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      CompileTimeOptions
+    <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">
+MLton's options allow you to control the name of the output file, the verbosity of compile-time messages, and whether or not certain optimizations are performed.  They also allow you to specify which intermediate files are saved and to stop the compilation process early, at some intermediate pass, in which case compilation can be resumed by passing the generated files to MLton.  MLton uses the input file suffix to determine the type of input program.  The possibilities are <tt>.c</tt>, <tt>.cm</tt>, <tt>.o</tt>, and <tt>.sml</tt>. <p>
+With no arguments, MLton prints the version number and exits.  For a usage message, run MLton with an invalid switch, e.g.  <tt>mlton&nbsp;-z</tt>.  In the explanation below and in the usage message, for flags that take a boolean argument <tt>{true|false}&nbsp;</tt>, the first value listed is the default. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>-align&nbsp;{4|8}&nbsp;</tt> 
+</p>
+</li>
+
+            <ul>
+
+   Aligns object sizes and doubles in memory by the specified    alignment. On X86, the default is <tt>4</tt> and on Sparc the default    is <tt>8</tt>.  
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>-as-opt</tt> <em>option</em> 
+</p>
+</li>
+
+            <ul>
+
+   Pass <em>option</em> to <tt>gcc</tt> when assembling. 
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>-cc-opt</tt> <em>option</em> 
+</p>
+</li>
+
+            <ul>
+
+   Pass <em>option</em> to <tt>gcc</tt> when compiling C code. 
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>-codegen&nbsp;{native|bytecode|c}&nbsp;</tt> 
+</p>
+</li>
+
+            <ul>
+
+   Generate native code, byte code, or C code.  With    <tt>-codegen&nbsp;native</tt>, MLton typically compiles more quickly and    generates better code. 
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>-const&nbsp;'</tt><em>name</em><tt>&nbsp;</tt><em>value</em><tt>'</tt> 
+</p>
+</li>
+
+            <ul>
+
+   Set the value of a compile-time constant.  Here is a list of    available constants, their default values, and what they control. 
+            </ul>
+
+
+
+        <ul>
+
+        <li>
+<p>
+ <tt>Exn.keepHistory&nbsp;{false|true}&nbsp;</tt> 
+</p>
+</li>
+
+                <ul>
+
+    Enable <tt>Exn.history</tt>.  See <a href="MLtonExn">MLtonExn</a> for details.  There is     a performance cost to setting this to <tt>true</tt>, both in memory     usage of exceptions and in run time, because of additional work     that must be performed at each exception construction, raise, and     handle. 
+                </ul>
+
+
+
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>-default-ann&nbsp;</tt><em>anns</em> 
+</p>
+</li>
+
+            <ul>
+
+   Specify the default annotation values for <a href="MLBasis"> ML Basis</a>    files.  For example, <tt>-default-ann&nbsp;'warnUnused&nbsp;true'</tt> causes    unused variable warnings to be enabled by default.  A default is    overridden by the corresponding annotation in an ML basis file. 
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>-disable-ann&nbsp;</tt><em>anns</em> 
+</p>
+</li>
+
+            <ul>
+
+   Ignore the specified annotations in every ML basis file.  For    example, to see <em>all</em> match and unused warnings, compile with 
+<pre>-default-ann 'warnUnused true'
+-disable-ann forceUsed 
+-disable-ann warnMatch 
+-disable-ann warnUnused 
+</pre>
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>-export-header&nbsp;</tt><em>file</em> 
+</p>
+</li>
+
+            <ul>
+
+   Write to <em>file</em> C prototypes for all of the functions exported    from SML to C.  This flag is useful for programs that use    <tt>_export</tt> (see <a href="ForeignFunctionInterface">ForeignFunctionInterface</a>). 
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>-ieee-fp&nbsp;{false|true}&nbsp;</tt> 
+</p>
+</li>
+
+            <ul>
+
+   Cause the native code generator to be pedantic about following the    IEEE floating point standard.  By default, it is not, because of    the performance cost.  This has no effect with <tt>-native&nbsp;false</tt>. 
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>-inline&nbsp;</tt><em>n</em> 
+</p>
+</li>
+
+            <ul>
+
+   Set the inlining threshold used in the optimizer.  The threshold is    an approximate measure of code size of a procedure.  The default is    <tt>320</tt>. 
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>-keep&nbsp;{g|o|sml}&nbsp;</tt> 
+</p>
+</li>
+
+            <ul>
+
+   Save intermediate files.  If no <tt>-keep</tt> argument is given, then    only the output file is saved. 
+<div>
+<table>
+   <tr>
+<td>
+ <tt>g</tt> </td>
+<td>
+ generated <tt>.S</tt> and <tt>.c</tt> files passed to gcc and the assembler </td>
+</tr>
+   <tr>
+<td>
+ <tt>o</tt> </td>
+<td>
+ object (<tt>.o</tt>) files </td>
+</tr>
+   <tr>
+<td>
+ <tt>sml</tt> </td>
+<td>
+ SML file </td>
+</tr>
+</table>
+</div>
+
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>-link-opt&nbsp;</tt><em>opt</em> 
+</p>
+</li>
+
+            <ul>
+
+   Pass the option to <tt>gcc</tt> when linking.  You can use this to    specify library search paths, e.g. <tt>-link-opt&nbsp;-Lpath</tt>, and    libraries to link with, e.g. <tt>-link-opt&nbsp;-lfoo</tt>, or even both at    the same time, e.g. <tt>-link-opt&nbsp;'-Lpath&nbsp;-lfoo'</tt>.  If you wish to    pash an option to the linker, you must use <tt>gcc</tt>'s <tt>-Wl,</tt>    syntax, e.g., <tt>-link-opt&nbsp;'-Wl,--export-dynamic'</tt>. 
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>-mlb-path-map&nbsp;</tt><em>file</em> 
+</p>
+</li>
+
+            <ul>
+
+   Use <em>file</em> as an <a href="MLBasisPathMap">MLBasisPathMap</a> to define additional MLB path    variables.  Multiple uses of <tt>-mlb-path-map</tt> are allowed, with    variable definitions in later path maps taking precendence over    earlier ones. 
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>-output&nbsp;</tt><em>file</em> 
+</p>
+</li>
+
+            <ul>
+
+   Specify the name of the final output file. The default name is the    input file name with its suffix removed and an appropriate,    possibly empty, suffix added. 
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>-profile&nbsp;{no|alloc|count|time}&nbsp;</tt> 
+</p>
+</li>
+
+            <ul>
+
+   Produce an executable that gathers <a href="Profiling">Profiling</a> data.  When    such an executable is run, it produces an <tt>mlmon.out</tt> file. 
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>-profile-branch&nbsp;{false|true}&nbsp;</tt> 
+</p>
+</li>
+
+            <ul>
+
+   If true, the profiler will separately gather profiling data for     each branch of a function definition, <tt>case</tt> expression, and    <tt>if</tt> expression.  
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>-profile-stack&nbsp;{false|true}&nbsp;</tt> 
+</p>
+</li>
+
+            <ul>
+
+   If <tt>true</tt>, the executable will gather profiling data for each    function on the stack. 
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>-runtime&nbsp;</tt><em>arg</em> 
+</p>
+</li>
+
+            <ul>
+
+   Pass argument to the runtime system via <tt>@MLton</tt>.  The argument    will be processed before other <tt>@MLton</tt> command line switches.    Multiple uses of <tt>-runtime</tt> are allowed, and will pass all the    arguments in order.  If the same runtime switch occurs more than    once, then the last setting will take effect. 
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>-show-basis&nbsp;</tt><em>file</em> 
+</p>
+</li>
+
+            <ul>
+
+   Pretty print to <em>file</em> the basis defined by the input program.    See <a href="ShowBasis">ShowBasis</a>. 
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>-show-def-use&nbsp;</tt><em>file</em> 
+</p>
+</li>
+
+            <ul>
+
+   Output def-use information to <em>file</em>.  Each identifier that is    defined appears on a line, followed on subsequent lines by the    position of each use. 
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>-stop&nbsp;{f|g|o|sml|tc}&nbsp;</tt> 
+</p>
+</li>
+
+            <ul>
+
+   Secify pass to stop at. 
+<div>
+<table>
+   <tr>
+<td>
+ <tt>f</tt> </td>
+<td>
+ list of files on stdout (only makes sense when input is <tt>foo.cm</tt> or <tt>foo.mlb</tt>) </td>
+</tr>
+   <tr>
+<td>
+ <tt>g</tt> </td>
+<td>
+ generated <tt>.S</tt> and <tt>.c</tt> files </td>
+</tr>
+   <tr>
+<td>
+ <tt>o</tt> </td>
+<td>
+ object file </td>
+</tr>
+   <tr>
+<td>
+ <tt>sml</tt> </td>
+<td>
+ SML file (only makes sense when input is <tt>foo.cm</tt> or <tt>foo.mlb</tt>) </td>
+</tr>
+   <tr>
+<td>
+ <tt>tc</tt> </td>
+<td>
+after type checking </td>
+</tr>
+</table>
+</div>
+<p>
+   If you compile <tt>-stop&nbsp;g</tt> or <tt>-stop&nbsp;o</tt>, you can resume    compilation by running MLton on the generated <tt>.c</tt> and <tt>.S</tt>    or <tt>.o</tt> files.  
+</p>
+
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>-target&nbsp;{self|</tt>...<tt>}&nbsp;</tt> 
+</p>
+</li>
+
+            <ul>
+
+   Generate an executable that runs on the specified platform.  The    default is <tt>self</tt>, which means to compile for the machine that    MLton is running on.  To use any other target, you must first    install a <a href="CrossCompiling"> cross compiler</a>. 
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>-target-as-opt&nbsp;</tt><em>target</em><tt>&nbsp;</tt><em>opt</em> 
+</p>
+</li>
+
+            <ul>
+
+   Like <tt>-as-opt</tt>, this passes <em>target</em> to <tt>gcc</tt> when    assembling, except it only passes <em>opt</em> when the target architecture    or operating system is <em>arch</em>.  Valid values for <em>target</em> are    as for <tt>-target-cc-opt</tt>. 
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>-target-cc-opt&nbsp;</tt><em>target</em><tt>&nbsp;</tt><em>opt</em> 
+</p>
+</li>
+
+            <ul>
+
+   Like <tt>-cc-opt</tt>, this passes <em>opt</em> to <tt>gcc</tt> when compiling    C code, except it only passes <em>opt</em> when the target architecture    or operating system is <em>target</em>.  Valid values for <em>target</em>    are: <tt>powerpc</tt>, <tt>sparc</tt>, <tt>x86</tt>, <tt>cygwin</tt>,    <tt>darwin</tt>, <tt>freebsd</tt>, <tt>linux</tt>, <tt>mingw</tt>,    <tt>netbsd</tt>, <tt>openbsd</tt>, <tt>solaris</tt>. 
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>-target-link-opt&nbsp;</tt><em>target</em><tt>&nbsp;</tt><em>opt</em> 
+</p>
+</li>
+
+            <ul>
+
+   Like <tt>-link-opt</tt>, this passes <em>target</em> to <tt>gcc</tt> when    linking, except it only passes <em>opt</em> when the target architecture    or operating system is <em>arch</em>.  Valid values for <em>target</em> are    as for <tt>-target-cc-opt</tt>. 
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>-verbose&nbsp;{0|1|2|3}&nbsp;</tt> 
+</p>
+</li>
+
+            <ul>
+
+   How verbose to be about what passes are running.  The default is    <tt>0</tt>. 
+<div>
+<table>
+   <tr>
+<td>
+ <tt>0</tt> </td>
+<td>
+ silent </td>
+</tr>
+   <tr>
+<td>
+ <tt>1</tt> </td>
+<td>
+ calls to compiler, assembler, and linker </td>
+</tr>
+   <tr>
+<td>
+ <tt>2</tt> </td>
+<td>
+ 1 + intermediate compiler passes </td>
+</tr>
+   <tr>
+<td>
+ <tt>3</tt> </td>
+<td>
+ 2 + some data structure sizes </td>
+</tr>
+</table>
+</div>
+</ul>
+
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-09-05 21:54:58 by <span title="adsl-64-166-225-193.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/CompilerOverview
===================================================================
--- mlton/trunk/doc/guide/CompilerOverview	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/CompilerOverview	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,274 @@
+<!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>CompilerOverview - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      CompilerOverview
+    <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 following table shows the overall structure of the compiler.  <a href="IntermediateLanguage">IntermediateLanguage</a>s are shown in the center column.  The names of compiler passes  are listed in the left and right columns.  
+    <ul>
+
+
+<div>
+<table>
+ <tr>
+<td colspan="3" align="center">
+ <strong>Compiler Overview</strong>                                                           </td>
+</tr>
+ <tr>
+<td align="center">
+ <em>Translation Passes</em> </td>
+<td align="center">
+ <a href="IntermediateLanguage">IntermediateLanguage</a> </td>
+<td align="center">
+ <em>Optimization Passes</em> </td>
+</tr>
+ <tr>
+<td colspan="1" align="center" rowspan="1">
+                      </td>
+<td colspan="1" align="center" rowspan="1">
+ Source                 </td>
+<td>
+                            </td>
+</tr>
+ <tr>
+<td align="center">
+ <a href="FrontEnd">FrontEnd</a>           </td>
+<td>
+                             </td>
+<td>
+                            </td>
+</tr>
+ <tr>
+<td colspan="1" align="center" rowspan="1">
+                      </td>
+<td colspan="1" align="center" rowspan="1">
+ <a href="AST">AST</a>                </td>
+<td>
+                            </td>
+</tr>
+ <tr>
+<td align="center">
+ <a href="Elaborate">Elaborate</a>          </td>
+<td>
+                             </td>
+<td>
+                            </td>
+</tr>
+ <tr>
+<td colspan="1" align="center" rowspan="3">
+                      </td>
+<td colspan="1" align="center" rowspan="3">
+ <a href="CoreML">CoreML</a>             </td>
+<td>
+                            </td>
+</tr>
+ <tr>
+<td align="center">
+ <a href="CoreMLSimplify">CoreMLSimplify</a>     </td>
+</tr>
+ <tr>
+<td>
+                           </td>
+</tr>
+ <tr>
+<td align="center">
+ <a href="Defunctorize">Defunctorize</a>       </td>
+<td>
+                             </td>
+<td>
+                            </td>
+</tr>
+ <tr>
+<td colspan="1" align="center" rowspan="3">
+                      </td>
+<td colspan="1" align="center" rowspan="3">
+ <a href="XML">XML</a>                </td>
+<td>
+                            </td>
+</tr>
+ <tr>
+<td align="center">
+ <a href="XMLSimplify">XMLSimplify</a>        </td>
+</tr>
+ <tr>
+<td>
+                           </td>
+</tr>
+ <tr>
+<td align="center">
+ <a href="Monomorphise">Monomorphise</a>       </td>
+<td>
+                             </td>
+<td>
+                            </td>
+</tr>
+ <tr>
+<td colspan="1" align="center" rowspan="3">
+                      </td>
+<td colspan="1" align="center" rowspan="3">
+ <a href="SXML">SXML</a>               </td>
+<td>
+                            </td>
+</tr>
+ <tr>
+<td align="center">
+ <a href="SXMLSimplify">SXMLSimplify</a>       </td>
+</tr>
+ <tr>
+<td>
+                           </td>
+</tr>
+ <tr>
+<td align="center">
+ <a href="ClosureConvert">ClosureConvert</a>     </td>
+<td>
+                             </td>
+<td>
+                            </td>
+</tr>
+ <tr>
+<td colspan="1" align="center" rowspan="3">
+                       </td>
+<td colspan="1" align="center" rowspan="3">
+ <a href="SSA">SSA</a>                </td>
+<td>
+                            </td>
+</tr>
+ <tr>
+<td align="center">
+ <a href="SSASimplify">SSASimplify</a>        </td>
+</tr>
+ <tr>
+<td>
+                           </td>
+</tr>
+ <tr>
+<td align="center">
+ <a href="ToSSA2">ToSSA2</a>             </td>
+<td>
+                             </td>
+<td>
+                            </td>
+</tr>
+ <tr>
+<td colspan="1" align="center" rowspan="3">
+                       </td>
+<td colspan="1" align="center" rowspan="3">
+ <a href="SSA2">SSA2</a>               </td>
+<td>
+                            </td>
+</tr>
+ <tr>
+<td align="center">
+ <a href="SSA2Simplify">SSA2Simplify</a>       </td>
+</tr>
+ <tr>
+<td>
+                           </td>
+</tr>
+ <tr>
+<td align="center">
+ <a href="ToRSSA">ToRSSA</a>             </td>
+<td>
+                             </td>
+<td>
+                            </td>
+</tr>
+ <tr>
+<td colspan="1" align="center" rowspan="3">
+                       </td>
+<td colspan="1" align="center" rowspan="3">
+ <a href="RSSA">RSSA</a>               </td>
+<td>
+                            </td>
+</tr>
+ <tr>
+<td align="center">
+ <a href="RSSASimplify">RSSASimplify</a>       </td>
+</tr>
+ <tr>
+<td>
+                           </td>
+</tr>
+ <tr>
+<td align="center">
+ <a href="ToMachine">ToMachine</a>          </td>
+<td>
+                             </td>
+<td>
+                            </td>
+</tr>
+ <tr>
+<td>
+                           </td>
+<td colspan="1" align="center" rowspan="1">
+ <a href="Machine">Machine</a>            </td>
+<td>
+                            </td>
+</tr>
+</table>
+</div>
+
+    </ul>
+
+
+<p>
+The <tt>Compile</tt> functor (
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/main/compile.sig?view=markup">compile.sig</a>
+,
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/main/compile.fun?view=markup">compile.fun</a>
+), controls the high-level view of the compiler passes, from <a href="FrontEnd">FrontEnd</a> to code generation. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:41:28 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/CompilerPassTemplate
===================================================================
--- mlton/trunk/doc/guide/CompilerPassTemplate	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/CompilerPassTemplate	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,72 @@
+<!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>CompilerPassTemplate - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      CompilerPassTemplate
+    <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">
+An analysis pass for the <a class="nonexistent" href="ZZZ">ZZZ</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a class="nonexistent" href="ZZZOtherPass">ZZZOtherPass</a>. An implementation pass for the <a class="nonexistent" href="ZZZ">ZZZ</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a class="nonexistent" href="ZZZSimplify">ZZZSimplify</a>. An optimization pass for the <a class="nonexistent" href="ZZZ">ZZZ</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a class="nonexistent" href="ZZZSimplify">ZZZSimplify</a>. A rewrite pass for the <a class="nonexistent" href="ZZZ">ZZZ</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a class="nonexistent" href="ZZZOtherPass">ZZZOtherPass</a>. A translation pass from the <a class="nonexistent" href="ZZA">ZZA</a> <a href="IntermediateLanguage">IntermediateLanguage</a> to the <a class="nonexistent" href="ZZB">ZZB</a> <a href="IntermediateLanguage">IntermediateLanguage</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+A short desciption of the pass. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ZZZ.sig?view=markup">ZZZ.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ZZZ.fun?view=markup">ZZZ.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+<p>
+Relevant details and notes. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:41:06 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/ConcurrentML
===================================================================
--- mlton/trunk/doc/guide/ConcurrentML	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/ConcurrentML	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,100 @@
+<!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>ConcurrentML - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      ConcurrentML
+    <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">
+<a class="external" href="http://cml.cs.uchicago.edu/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Concurrent ML</a> is an SML concurrency library based on synchronous message passing.   <p>
+MLton 20041109 has an initial port of CML from SML/NJ to MLton.  All of the core CML functionality is present. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">structure</FONT></B> CML: CML
+<B><FONT COLOR="#0000FF">structure</FONT></B> SyncVar: SYNC_VAR
+<B><FONT COLOR="#0000FF">structure</FONT></B> Mailbox: MAILBOX
+<B><FONT COLOR="#0000FF">structure</FONT></B> Multicast: MULTICAST
+<B><FONT COLOR="#0000FF">structure</FONT></B> SimpleRPC: SIMPLE_RPC
+<B><FONT COLOR="#0000FF">structure</FONT></B> RunCML: RUN_CML
+</PRE>
+<p>
+ 
+</p>
+<p>
+The <tt>RUN_CML</tt> signature is minimal. 
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> RUN_CML =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">val</FONT></B> isRunning: unit -&gt; bool
+      <B><FONT COLOR="#A020F0">val</FONT></B> doit: (unit -&gt; unit) * Time.time option -&gt; OS.Process.status
+      <B><FONT COLOR="#A020F0">val</FONT></B> shutdown: OS.Process.status -&gt; 'a
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+ This does not include all of the cleanup and logging operations of the SML/NJ <tt>RunCML</tt> structure.  However, the implementation does include the <tt>CML.timeOutEvt</tt> and <tt>CML.atTimeEvt</tt> functions, and a preemptive scheduler that knows to sleep when there are no ready threads and some threads blocked on time events. 
+</p>
+<p>
+None of the <a href="BasisLibrary"> Standard ML Basis Library</a> has been made either <tt>MLton.Thread</tt> or CML safe.  Much of the <tt>IO</tt> and <tt>OS</tt> structures have event based equivalents, which should be implemented.  The "right" way to call a Basis Library function that is stateful is to wrap the call with <tt>MLton.Thread.atomically</tt>. 
+</p>
+<h2 id="head-a4bc8bf5caf54b18cea9f58e83dd4acb488deb17">Also see</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="ConcurrentMLImplementation">ConcurrentMLImplementation</a> 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-02-12 23:38:18 by <span title="roam59-224.fas.harvard.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/ConcurrentMLImplementation
===================================================================
--- mlton/trunk/doc/guide/ConcurrentMLImplementation	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/ConcurrentMLImplementation	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,286 @@
+<!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>ConcurrentMLImplementation - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      ConcurrentMLImplementation
+    <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">
+Here are some notes on MLton's implementation of <a href="ConcurrentML">ConcurrentML</a>. <p>
+Concurrent ML was originally implemented for SML/NJ.  It was ported to MLton in the summer of 2004.  The main difference between the implementations is that SML/NJ uses continuations to implement CML threads, while MLton uses its underlying <a href="MLtonThread">thread</a> package.  Presently, MLton's threads are a little more heavyweight than SML/NJ's continuations, but it's pretty clear that there is some fat there that could be trimmed. 
+</p>
+<p>
+The implementation of CML in SML/NJ is built upon the first-class continuations of the <tt>SMLofNJ.Cont</tt> module. 
+<pre class=code>
+<B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> 'a cont
+</FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> callcc: ('a cont -&gt; 'a) -&gt; 'a
+<B><FONT COLOR="#A020F0">val</FONT></B> isolate: ('a -&gt; unit) -&gt; 'a cont
+<B><FONT COLOR="#A020F0">val</FONT></B> throw: 'a cont -&gt; 'a -&gt; 'b
+</PRE>
+ 
+</p>
+<p>
+The implementation of CML in MLton is built upon the first-class threads of the <a href="MLtonThread">MLtonThread</a> module. 
+<pre class=code>
+<B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> 'a t
+</FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> new: ('a -&gt; unit) -&gt; 'a t
+<B><FONT COLOR="#A020F0">val</FONT></B> prepare: 'a t * 'a -&gt; Runnable.t
+<B><FONT COLOR="#A020F0">val</FONT></B> switch: ('a t -&gt; Runnable.t) -&gt; 'a
+</PRE>
+ 
+</p>
+<p>
+The port is relatively straightforward, because CML throws to a continuation at most once.  Hence, an "abstract" implementation of CML could be built upon first-class one-shot continuations, which map equally well to SML/NJ's continuations and MLton's threads. 
+</p>
+<p>
+The "essence" of the port is to transform: 
+<pre>callcc (fn k =&gt; ... throw k' v')
+</pre>to 
+<pre>switch (fn t =&gt; ... prepare (t', v'))
+</pre>which suffices for the vast majority of the CML implementation. 
+</p>
+<p>
+There was only one complicated transformation: blocking multiple base events.  In SML/NJ CML, the representation of base events is given by: 
+<pre class=code>
+<B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> 'a event_status
+  </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">ENABLED</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> {prio: int, doFn: unit -&gt; 'a}
+  </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">BLOCKED</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> {
+        transId: trans_id ref, 
+        cleanUp: unit -&gt; unit, 
+        next: unit -&gt; unit
+      } -&gt; 'a
+</FONT></B><B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> 'a base_evt </FONT></B>=<FONT COLOR="#228B22"><B> unit -&gt; 'a event_status
+</FONT></B></PRE>
+ 
+</p>
+<p>
+When synchronizing on a set of base events, which are all blocked, we must invoke each <tt>BLOCKED</tt> function with the same transId and cleanUp (the transId is (checked and) set to CANCEL by the cleanUp function, which is invoked by the first enabled event; this "fizzles" every other event in the synchronization group that later becomes enabled). However, each <tt>BLOCKED</tt> function is implemented by a callcc, so that when the event is enabled, it throws back to the point of synchronization.  Hence, the next function (which doesn't return) is invoked by the <tt>BLOCKED</tt> function to escape the callcc and continue in the thread performing the synchronization.  In SML/NJ this is implemented as follows: 
+<pre class=code>
+<B><FONT COLOR="#A020F0">fun</FONT></B> ext ([], blockFns) = callcc (<B><FONT COLOR="#A020F0">fn</FONT></B> k =&gt; <B><FONT COLOR="#0000FF">let</FONT></B>
+      <B><FONT COLOR="#A020F0">val</FONT></B> throw = throw k
+      <B><FONT COLOR="#A020F0">val</FONT></B> (transId, setFlg) = mkFlg()
+      <B><FONT COLOR="#A020F0">fun</FONT></B> log [] = S.atomicDispatch ()
+        | log (blockFn:: r) =
+            throw (blockFn {
+                transId = transId,
+                cleanUp = setFlg,
+                next = <B><FONT COLOR="#A020F0">fn</FONT></B> () =&gt; log r
+              })
+      <B><FONT COLOR="#0000FF">in</FONT></B>
+        log blockFns; error <FONT COLOR="#BC8F8F"><B>&quot;[log]&quot;</FONT></B>
+      <B><FONT COLOR="#0000FF">end</FONT></B>)
+</PRE>
+ (Note that <tt>S.atomicDispatch</tt> invokes the continuation of the next continuation on the ready queue.)  This doesn't map well to the MLton thread model.  Although it follows the  
+<pre>callcc (fn k =&gt; ... throw k v)
+</pre>model, the fact that blockFn will also attempt to do 
+<pre>callcc (fn k' =&gt; ... next ())
+</pre>means that the naive transformation will result in nested switch-es. 
+</p>
+<p>
+We need to think a little more about what this code is trying to do. Essentially, each <tt>blockFn</tt> wants to capture this continuation, hold on to it until the event is enabled, and continue with next; when the event is enabled, before invoking the continuation and returning to the synchronization point, the cleanUp and other event specific operations are performed. 
+</p>
+<p>
+To accomplish the same effect in the MLton thread implementation, we have the following: 
+<pre class=code>
+<B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> 'a status </FONT></B>=<FONT COLOR="#228B22"><B>
+   <FONT COLOR="#B8860B">ENABLED</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> {prio: int, doitFn: unit -&gt; 'a}
+ </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">BLOCKED</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> {transId: trans_id,
+               cleanUp: unit -&gt; unit,
+               next: unit -&gt; rdy_thread} -&gt; 'a
+
+</FONT></B><B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> 'a base </FONT></B>=<FONT COLOR="#228B22"><B> unit -&gt; 'a status 
+
+</FONT></B><B><FONT COLOR="#A020F0">fun</FONT></B> ext ([], blockFns): 'a =
+     S.atomicSwitch
+     (<B><FONT COLOR="#A020F0">fn</FONT></B> (t: 'a S.thread) =&gt;
+      <B><FONT COLOR="#0000FF">let</FONT></B>
+         <B><FONT COLOR="#A020F0">val</FONT></B> (transId, cleanUp) = TransID.mkFlg ()
+         <B><FONT COLOR="#A020F0">fun</FONT></B> log blockFns: S.rdy_thread =
+            <B><FONT COLOR="#A020F0">case</FONT></B> blockFns <B><FONT COLOR="#A020F0">of</FONT></B>
+               [] =&gt; S.next ()
+             | blockFn::blockFns =&gt;
+                  (S.prep o S.new)
+                  (<B><FONT COLOR="#A020F0">fn</FONT></B> _ =&gt; <B><FONT COLOR="#A020F0">fn</FONT></B> () =&gt;
+                   <B><FONT COLOR="#0000FF">let</FONT></B> 
+                      <B><FONT COLOR="#A020F0">val</FONT></B> () = S.atomicBegin ()
+                      <B><FONT COLOR="#A020F0">val</FONT></B> x = blockFn {transId = transId,
+                                       cleanUp = cleanUp,
+                                       next = <B><FONT COLOR="#A020F0">fn</FONT></B> () =&gt; log blockFns}
+                   <B><FONT COLOR="#0000FF">in</FONT></B> S.switch(<B><FONT COLOR="#A020F0">fn</FONT></B> _ =&gt; S.prepVal (t, x))
+                   <B><FONT COLOR="#0000FF">end</FONT></B>)
+      <B><FONT COLOR="#0000FF">in</FONT></B>
+         log blockFns
+      <B><FONT COLOR="#0000FF">end</FONT></B>)
+</PRE>
+ 
+</p>
+<p>
+To avoid the nested switch-es, I run the blockFn in it's own thread, whose only purpose is to return to the synchronization point.  This corresponds to the <tt>throw&nbsp;(blockFn&nbsp;{...})</tt> in the SML/NJ implementation.  I'm worried that this implementation might be a little expensive, starting a new thread for each blocked event (when there are only multiple blocked events in a synchronization group). But, I don't see another way of implementing this behavior in the MLton thread model. 
+</p>
+<p>
+Note that another way of thinking about what is going on is to consider each <tt>blockFn</tt> as prepending a different set of actions to the thread <tt>t</tt>.  It might be possible to give a <tt>MLton.Thread.unsafePrepend</tt>. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">fun</FONT></B> unsafePrepend (T r: 'a t, f: 'b -&gt; 'a): 'b t =
+   <B><FONT COLOR="#A020F0">let</FONT></B>
+      <B><FONT COLOR="#A020F0">val</FONT></B> t =
+         <B><FONT COLOR="#A020F0">case</FONT></B> !r <B><FONT COLOR="#A020F0">of</FONT></B>
+            Dead =&gt; <B><FONT COLOR="#A020F0">raise</FONT></B> Fail <FONT COLOR="#BC8F8F"><B>&quot;prepend to a Dead thread&quot;</FONT></B>
+          | New g =&gt; New (g o f)
+          | Paused (g, t) =&gt; Paused (<B><FONT COLOR="#A020F0">fn</FONT></B> h =&gt; g (f o h), t)
+   <B><FONT COLOR="#A020F0">in</FONT></B> <I><FONT COLOR="#B22222">(* r := Dead; *)</FONT></I>
+      T (ref t)
+   <B><FONT COLOR="#A020F0">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<p>
+I have commented out the <tt>r&nbsp;:=&nbsp;Dead</tt>, which would allow multiple prepends to the same thread (i.e., not destroying the original thread in the process).  Of course, only one of the threads could be run: if the original thread were in the <tt>Paused</tt> state, then multiple threads would share the underlying runtime/primitive thread.  Now, this matches the "one-shot" nature of CML continuations/threads, but I'm not comfortable with extending <tt>MLton.Thread</tt> with such an unsafe operation. 
+</p>
+<p>
+Other than this complication with blocking multiple base events, the port was quite routine.  (As a very pleasant surprise, the CML implementation in SML/NJ doesn't use any SML/NJ-isms.)  There is a slight difference in the way in which critical sections are handled in SML/NJ and MLton; since <tt>MLton.Thread.switch</tt> _always_ leaves a critical section, it is sometimes necessary to add additional <tt>atomicBegin</tt>/<tt>End</tt>s to ensure that we remain in a critical section after a thread switch. 
+</p>
+<p>
+While looking at virtually every file in the core CML implementation, I took the liberty of simplifying things where it seemed possible; in terms of style, the implementation is about half-way between Reppy's original and MLton's.   
+</p>
+<p>
+Some changes of note: 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>util/</tt> contains all pertinent data-structures: (functional and  imperative) queues, (functional) priority queues.  Hence, it should  be easier to switch in more efficient or real-time implementations. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <tt>core-cml/scheduler.sml</tt>: in both implementations, this is  where most of the interesting action takes place.  I've made the  connection between <tt>MLton.Thread.t</tt>s and  <tt>ThreadId.thread_id</tt>s more abstract than it is in the SML/NJ  implemenation, and encapsulated all of the <tt>MLton.Thread</tt>  operations in this module.  
+</p>
+</li>
+    <li class="gap">
+<p>
+ eliminated all of the "by hand" inlining 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-531c9b98f5b5319fbd454f61787c5cafc2812a55">Future Extensions</h2>
+<p>
+The CML documentation says the following: 
+<pre>CML.joinEvt: thread_id -&gt; unit event
+</pre>
+</p>
+
+    <ul>
+
+ <tt>joinEvt&nbsp;tid</tt>    
+        <ul>
+
+  creates an event value for synchronizing on the termination of the   thread with the ID tid.  There are three ways that a thread may   terminate: the function that was passed to spawn (or spawnc) may   return; it may call the exit function, or it may have an uncaught   exception.  Note that <tt>joinEvt</tt> does not distinguish between   these cases; it also does not become enabled if the named thread   deadlocks (even if it is garbage collected). 
+        </ul>
+
+
+
+    </ul>
+
+
+<p>
+I believe that the <tt>MLton.Finalizable</tt> might be able to relax that last restriction.  Upon the creation of a <tt>'a&nbsp;Scheduler.thread</tt>, we could attach a finalizer to the underlying <tt>'a&nbsp;MLton.Thread.t</tt> that enables the <tt>joinEvt</tt> (in the associated <tt>ThreadID.thread_id</tt>) when the <tt>'a&nbsp;MLton.Thread.t</tt> becomes unreachable. 
+</p>
+<p>
+I don't know why CML doesn't have 
+</p>
+
+<pre>CML.kill: thread_id -&gt; unit
+</pre><p>
+which has a fairly simple implementation -- setting a kill flag in the <tt>thread_id</tt> and adjusting the scheduler to discard any killed threads that it takes off the ready queue.  The fairness of the scheduler ensures that a killed thread will eventually be discarded. The semantics are little murky for blocked threads that are killed, though.  For example, consider a thread blocked on  <tt>SyncVar.mTake&nbsp;mv</tt> and a thread blocked on <tt>SyncVar.mGet&nbsp;mv</tt>. If the first thread is killed while blocked, and a third thread does <tt>SyncVar.mPut&nbsp;(mv,&nbsp;x)</tt>, then we might expect that we'll enable the second thread, and never the first.  But, when only the ready queue is able to discard killed threads, then the <tt>SyncVar.mPut</tt> could enable the first thread (putting it on the ready queue, from which it will be discarded) and leave the second thread blocked.  We could solve this by adjusting the <tt>TransID.trans_id&nbsp;types</tt> and the "cleaner" functions to look for both canceled transactions and transactions on killed threads. 
+</p>
+<p>
+John Reppy says that <a href = "References#MarlowEtAl01">MarlowEtAl01</a> and <a href = "References#FlattFindler04">FlattFindler04</a> explain why <tt>CML.kill</tt> would be a bad idea. 
+</p>
+<p>
+Between <tt>CML.timeOutEvt</tt> and <tt>CML.kill</tt>, one could give an efficient solution to the recent comp.lang.ml post about terminating a function that doesn't complete in a given time. 
+<pre class=code>
+  <B><FONT COLOR="#A020F0">fun</FONT></B> timeOut (f: unit -&gt; 'a, t: Time.time): 'a option =
+    <B><FONT COLOR="#A020F0">let</FONT></B>
+       <B><FONT COLOR="#A020F0">val</FONT></B> iv = SyncVar.iVar ()
+       <B><FONT COLOR="#A020F0">val</FONT></B> tid = CML.spawn (<B><FONT COLOR="#A020F0">fn</FONT></B> () =&gt; SyncVar.iPut (iv, f ()))
+    <B><FONT COLOR="#A020F0">in</FONT></B>
+       CML.select 
+       [CML.wrap (CML.timeOutEvt t, <B><FONT COLOR="#A020F0">fn</FONT></B> () =&gt; (CML.kill tid; NONE)),
+        CML.wrap (SyncVar.iGetEvt iv, <B><FONT COLOR="#A020F0">fn</FONT></B> x =&gt; SOME x)]
+    <B><FONT COLOR="#A020F0">end</FONT></B>
+</PRE>
+ 
+</p>
+<h2 id="head-77083a6d602cd5c98f0ccc3e2f7584e93ad1f737">Space Safety</h2>
+<p>
+There are some CML related posts on the MLton mailing list 
+</p>
+
+        <ul>
+
+  <a href="http://mlton.org/pipermail/mlton/2004-May/">http://mlton.org/pipermail/mlton/2004-May/</a> 
+        </ul>
+
+
+<p>
+that discuss concerns that SML/NJ's implementation is not space efficient, because multi-shot continuations can be held indefinitely on event queues.  MLton is better off because of the one-shot nature -- when an event enables a thread, all other copies of the thread waiting in other event queues get turned into dead threads (of zero size). 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-03 00:24:53 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/ConstantPropagation
===================================================================
--- mlton/trunk/doc/guide/ConstantPropagation	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/ConstantPropagation	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,75 @@
+<!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>ConstantPropagation - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      ConstantPropagation
+    <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">
+<p>
+An optimization pass for the <a href="SSA">SSA</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="SSASimplify">SSASimplify</a>. 
+</p>
+<h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+This is whole-program constant propagation, even through data structures.  Also performs globalization of (small) values computed once. 
+</p>
+<p>
+Uses <a href="Multi">Multi</a>. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/constant-propagation.sig?view=markup">constant-propagation.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/constant-propagation.fun?view=markup">constant-propagation.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:40:52 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Contact
===================================================================
--- mlton/trunk/doc/guide/Contact	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Contact	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,117 @@
+<!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>Contact - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Contact
+    <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">
+<h2 id="head-a5772095bad3f5f510b46aeea40178c90cb9d2f9">Mailing lists</h2>
+<p>
+There are two mailing lists available. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>MLton@mlton.org</tt>   (<a class="external" href="http://mlton.org/mailman/listinfo/mlton"><img src="moin-www.png" alt="[WWW]" height="11" width="11">subscribe</a>,   <a class="external" href="http://mlton.org/pipermail/mlton"><img src="moin-www.png" alt="[WWW]" height="11" width="11">archive</a>)   MLton developers 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <tt>MLton-user@mlton.org</tt>   (<a class="external" href="http://mlton.org/mailman/listinfo/mlton-user"><img src="moin-www.png" alt="[WWW]" height="11" width="11">subscribe</a>,   <a class="external" href="http://mlton.org/pipermail/mlton-user"><img src="moin-www.png" alt="[WWW]" height="11" width="11">archive</a>)   MLton user community  
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+In addition to the pipermail archive on this site, there are archives of both  <a class="external" href="http://terpstra.ca/lurker/list/mlton.en.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">MLton</a> and <a class="external" href="http://terpstra.ca/lurker/list/mlton-user.en.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">MLton-user</a> that use <a class="external" href="http://lurker.sourceforge.net/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Lurker</a>. 
+</p>
+<h3 id="head-4d664627fe28b8283a45df64cc700772bb91b4c4">Mailing list policy</h3>
+
+    <ul>
+
+    <li>
+<p>
+ Both mailing lists are unmoderated.  However, we use a whitelist to  prevent spam.  So, the first time you send to the list, your mail  will be delayed until we add you to the whitelist. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ Large messages (over 512K) should not be sent.  Rather, please send  an email containing the discussion text and a link to any large  files.  You may use our <a href="http://mlton.org/TemporaryUpload">TemporaryUpload</a> page for uploading these files. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ Very active <tt>MLton@mlton.org</tt> list members who might otherwise  be expected to provide a fast response should send a message when  they will be offline for more than a few days.  The convention is to  put "<em>userid</em> offline until <em>date</em>" in the subject line to make it  easy to scan.  
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-a68fa8efe4a09d8c0c63ae60426d9366434bccb2">IRC</h2>
+
+    <ul>
+
+    <li>
+<p>
+ Some MLton developers and users are in channel <tt>#sml</tt> on  <a href="http://freenode.net">http://freenode.net</a>. 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-31 23:32:20 by <span title="adsl-64-166-226-67.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Contify
===================================================================
--- mlton/trunk/doc/guide/Contify	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Contify	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,72 @@
+<!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>Contify - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Contify
+    <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">
+An optimization pass for the <a href="SSA">SSA</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="SSASimplify">SSASimplify</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Contification is a compiler optimization that turns a function that always returns to the same place into a continuation.  This exposes control-flow information that is required by many optimizations, including traditional loop optimizations. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/contify.sig?view=markup">contify.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/contify.fun?view=markup">contify.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+<p>
+See <a href = "References#FluetWeeks01">Contification Using Dominators</a>.  The intermediate language described in that paper has since evolved to the <a href="SSA">SSA</a> <a href="IntermediateLanguage">IntermediateLanguage</a>; hence, the complication described in Section 6.1 is no longer relevant. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:40:37 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/CoreML
===================================================================
--- mlton/trunk/doc/guide/CoreML	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/CoreML	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,73 @@
+<!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>CoreML - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      CoreML
+    <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">
+An <a href="IntermediateLanguage">IntermediateLanguage</a>,  translated from <a href="AST">AST</a> by <a href="Elaborate">Elaborate</a>, optimized by <a href="CoreMLSimplify">CoreMLSimplify</a>, and  translated by <a href="Defunctorize">Defunctorize</a> to <a href="XML">XML</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+CoreML is polymorphic, higher-order, with nested patterns. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/core-ml/core-ml.sig?view=markup">core-ml.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/core-ml/core-ml.fun?view=markup">core-ml.fun</a>
+ <h2 id="head-a6de4b535fedeaa8890bd890b60fe09f87b5f96a">Type Checking</h2>
+<p>
+The CoreML <a href="IntermediateLanguage">IntermediateLanguage</a> has no independent type checker. 
+</p>
+<h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:40:22 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/CoreMLSimplify
===================================================================
--- mlton/trunk/doc/guide/CoreMLSimplify	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/CoreMLSimplify	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,74 @@
+<!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>CoreMLSimplify - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      CoreMLSimplify
+    <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 single optimization pass for the <a href="CoreML">CoreML</a> <a href="IntermediateLanguage">IntermediateLanguage</a> is controlled by the <tt>Compile</tt> functor (
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/main/compile.fun?view=markup">compile.fun</a>
+). <p>
+The following optimization pass is implemented: 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="DeadCode">DeadCode</a> 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:40:09 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/CreatingPages
===================================================================
--- mlton/trunk/doc/guide/CreatingPages	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/CreatingPages	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,70 @@
+<!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>CreatingPages - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      CreatingPages
+    <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">
+To create a page, edit an existing page, and add the name of the new page, like <tt>FooBar</tt>, to the page contents.  When you view the new version of the existing page, a link will have been automatically created, and if you click on it, you will be given the option to create the new page. <p>
+You can also go directly to a new page by entering the page name as a URL into your browser, like <tt>http://www.mlton.org/FooBar</tt>. 
+</p>
+<p>
+You can also type in the page name here to go directly to that page. 
+</p>
+<p>
+<form method="get"><input name="goto" size="30">
+        <input type="submit" value="Go">
+        </form> 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-10-28 22:37:02 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Credits
===================================================================
--- mlton/trunk/doc/guide/Credits	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Credits	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,234 @@
+<!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>Credits - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Credits
+    <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">
+MLton was designed and implemented by <a href="HenryCejtin">HenryCejtin</a>, <a href="MatthewFluet">MatthewFluet</a>, <a href="SureshJagannathan">SureshJagannathan</a>, and <a href="StephenWeeks">StephenWeeks</a>. 
+    <ul>
+
+    <li>
+<p>
+ <a href="HenryCejtin">HenryCejtin</a> wrote the <tt>IntInf</tt> implementation, the original  profiler, the original man pages, the <tt>.spec</tt> files for the RPMs,  and lots of little hacks to speed stuff up.  
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a href="MatthewFluet">MatthewFluet</a> implemented the X86 native code generator, ported  <tt>mlprof</tt> to work with the native code generator, did a lot of work  on the SSA optimizer, both adding new optimizations and improving or  porting existing optimizations, updated the   <a href="BasisLibrary"> SML Basis Library</a> implementation, ported  <a href="ConcurrentML">ConcurrentML</a> to MLton, and implemented the   <a href="MLBasis"> ML Basis system</a>.  
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a href="SureshJagannathan">SureshJagannathan</a> implemented some early inlining and uncurrying  optimizations.  
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a href="StephenWeeks">StephenWeeks</a> implemented most of the original version of MLton, and  continues to keep his fingers in most every part.  
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+Many people have helped us over the years.  Here is an alphabetical list. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ Jesper Louis Andersen sent several patches to improve the runtime on  FreeBSD and ported MLton to run on NetBSD and OpenBSD.  
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a href="JohnnyAndersen">JohnnyAndersen</a> implemented <tt>BinIO</tt>, modified MLton so it could  cross compile to MinGW, and provided useful discussion about  cross-compilation. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ Alain Deutsch and   <a class="external" href="http://www.polyspace.com/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">PolySpace Technologies</a> provided many bug  fixes and runtime system improvements, as well as some code to help  the Sparc port. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ Martin Elsman provided helpful discussions in the development of  the <a href="MLBasis"> MLBasis system</a>.  
+</p>
+</li>
+    <li class="gap">
+<p>
+ Brent Fulgham ported MLton most of the way to MinGW. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ Simon Helsen provided bug reports, suggestions, and helpful  discussions.  
+</p>
+</li>
+    <li class="gap">
+<p>
+ Joe Hurd provided useful discussion and feedback on source-level  profiling.  
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a href="VesaKarvonen">VesaKarvonen</a> contributed <tt>esml-mode.el</tt> (see <a href="Emacs">Emacs</a>) and  patches for improving match warnings. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ Richard Kelsey provided helpful discussions. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ Tom Murphy wrote the original version of <tt>MLton.Syslog</tt> as part  of his <tt>mlftpd</tt> project, and has sent many useful bug reports and  suggestions.  
+</p>
+</li>
+    <li class="gap">
+<p>
+ Michael Neumann helped to patch the runtime to compile under  FreeBSD.  
+</p>
+</li>
+    <li class="gap">
+<p>
+ Barak Pearlmutter built the original  <a class="external" href="http://packages.debian.org/mlton"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Debian package</a> for MLton, and  helped us to take over the process.  
+</p>
+</li>
+    <li class="gap">
+<p>
+ Filip Pizlo ported MLton to Darwin. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ Sam Rushing ported MLton to FreeBSD. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ Jeffrey Mark Siskind provided helpful discussions and inspiration  with his Stalin Scheme compiler.  
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a href="WesleyTerpstra">WesleyTerpstra</a> added support for <tt>MLton.Process.Create</tt>,  made  a number of contributions to the <a href="ForeignFunctionInterface">ForeignFunctionInterface</a> and  contributed a number of other runtime system patches. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ Luke Ziarek assisted in porting MLton to Darwin. 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+We have also benefited from other software development tools and borrowed code from other sources. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ MLton was developed using   <a class="external" href="http://www.smlnj.org"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Standard ML of New Jersey</a> and the  <a class="external" href="http://www.smlnj.org/doc/CM/index.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Compilation Manager (CM)</a>  
+</p>
+</li>
+    <li class="gap">
+<p>
+ MLton's lexer (<tt>mlton/frontend/ml.lex</tt>), parser  (<tt>mlton/frontend/ml.grm</tt>), and precedence-parser  (<tt>mlton/elaborate/precedence-parse.fun</tt>) are modified versions of  code from SML/NJ.  
+</p>
+</li>
+    <li class="gap">
+<p>
+ The MLton <a href="BasisLibrary"> SML Basis Library</a> implementation of  conversions between binary and decimal representations of reals uses  David Gay's  <a class="external" href="http://www.netlib.org/fp/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">gdtoa</a> library.  
+</p>
+</li>
+    <li class="gap">
+<p>
+ The MLton <a href="BasisLibrary"> SML Basis Library</a> implementation uses  modified versions of  portions of the the SML/NJ Basis Library  implementation modules <tt>OS.IO</tt>, <tt>Posix.IO</tt>, <tt>Process</tt>,  and <tt>Unix</tt>. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ The MLton <a href="BasisLibrary"> SML Basis Library</a> implementation uses  modified versions of portions of the  <a class="external" href="http://www.itu.dk/research/mlkit/kit3/readme.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ML Kit Version 4.1.4</a>  Basis Library implementation modules <tt>Path</tt>, <tt>Time</tt>, and  <tt>Date</tt>.   
+</p>
+</li>
+    <li class="gap">
+<p>
+ Many of the benchmarks come from the SML/NJ benchmark suite. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ Many of the regression tests come from the ML Kit Version 4.1.4  distribution, which borrowed them from the  <a class="external" href="http://www.dina.kvl.dk/~sestoft/mosml.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Moscow ML</a> distribution.  
+</p>
+</li>
+    <li class="gap">
+<p>
+ MLton uses the [<a href="http://www.gnu.org/software/gmp/gmp.html">http://www.gnu.org/software/gmp/gmp.html</a> GNU  multiprecision library] for its implementation of <tt>IntInf</tt>.  
+</p>
+</li>
+    <li class="gap">
+<p>
+ MLton's implementation of <a href="ConcurrentML">Concurrent ML</a> and the  <a href="MLNLFFI">ML-NLFFI</a> are modified versions of code from SML/NJ. 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-30 05:33:54 by <span title="adsl-64-166-226-67.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/CrossCompiling
===================================================================
--- mlton/trunk/doc/guide/CrossCompiling	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/CrossCompiling	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,104 @@
+<!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>CrossCompiling - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      CrossCompiling
+    <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">
+<p>
+You can use the MLton's <tt>-target</tt> flag to cross compile applications.  By default, MLton is only able to compile for the machine it is running on.  In order to use MLton as a cross compiler, you need to do two things. 
+</p>
+
+    <ol type="1">
+
+    <li>
+<p>
+Install the GCC cross-compiler tools on the host so that GCC can  compile to the target. 
+</p>
+</li>
+    <li class="gap">
+<p>
+Cross compile the MLton runtime system to build the runtime  libraries for the target. 
+</p>
+</li>
+
+    </ol>
+
+
+<p>
+To make the terminology clear, we refer to the <em>host</em> as the machine MLton is running on and the <em>target</em> as the machine that MLton is compiling for. 
+</p>
+<p>
+To build a GCC cross-compiler toolset on the host, you can use the script <tt>bin/build-cross-gcc</tt>, available in the MLton sources, as a template.  The value of the <tt>target</tt> variable in that script is important, since that is what you will pass to MLton's <tt>-target</tt> flag.  Once you have the toolset built, you should be able to test it by cross compiling a simple hello world program on your host machine. 
+<pre>% gcc -b i386-pc-cygwin -o hello-world hello-world.c
+</pre>You should now be able to run <tt>hello-world</tt> on the target machine, in this case, a Cygwin machine. 
+</p>
+<p>
+Next, you must cross compile the MLton runtime system and inform MLton of the availability of the new target.  The script <tt>bin/add-cross</tt> from the MLton sources will help you do this.  Please read the comments at the top of the script.  Here is a sample run adding a Solaris cross compiler. 
+<pre>% add-cross sparc-sun-solaris sun blade
+Making runtime.
+Building print-constants executable.
+Running print-constants on blade.
+</pre>Running <tt>add-cross</tt> uses <tt>ssh</tt> to compile the runtime on the target machine and to create <tt>print-constants</tt>, which prints out all of the constants that MLton needs in order to implement the <a href="BasisLibrary"> SML Basis Library</a>.  The script runs <tt>print-constants</tt> on the target machine (<tt>blade</tt> in this case), and saves the output. 
+</p>
+<p>
+Once you have done all this, you should be able to cross compile SML applications.  For example, 
+<pre>mlton -target i386-pc-cygwin hello-world.sml
+</pre>will create <tt>hello-world</tt>, which you should be able to run from a Cygwin shell on your Windows machine. 
+</p>
+<h2 id="head-80fca97412735573fcad1a4be39280262e6f73d5">Cross-compiling alternatives</h2>
+<p>
+Building and maintaining cross-compiling <tt>gcc</tt>'s is complex.  You may find it simpler to use <tt>mlton&nbsp;-keep&nbsp;g</tt> to generate the files on the host, then copy the files to the target, and then use <tt>gcc</tt> or <tt>mlton</tt> on the target to compile the files. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-28 21:47:57 by <span title="cfs36.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/DeadCode
===================================================================
--- mlton/trunk/doc/guide/DeadCode	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/DeadCode	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,94 @@
+<!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>DeadCode - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      DeadCode
+    <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">
+An optimization pass for the <a href="CoreML">CoreML</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="CoreMLSimplify">CoreMLSimplify</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Eliminate declarations from the <a href="BasisLibrary"> SML Basis Library</a> not needed by the user program. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/core-ml/dead-code.sig?view=markup">dead-code.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/core-ml/dead-code.fun?view=markup">dead-code.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+<p>
+In order to compile small programs rapidly, a pass of dead code elimination is run in order to eliminate as much of the Basis Library as possible.  The dead code elimination algorithm used is not safe in general, and only works because the Basis Library implementation has special properties: 
+</p>
+
+        <ul>
+
+        <li>
+<p>
+ it terminates 
+</p>
+</li>
+        <li>
+<p>
+ it performs no I/O 
+</p>
+</li>
+
+        </ul>
+
+
+<p>
+The dead code elimination includes the minimal set of declarations from the Basis Library so that there are no free variables in the user program (or remaining Basis Library implementation).  It has a special hack to include all bindings of the form: 
+<pre> val _ = ...
+</pre>
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:39:52 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/DeepFlatten
===================================================================
--- mlton/trunk/doc/guide/DeepFlatten	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/DeepFlatten	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,75 @@
+<!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>DeepFlatten - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      DeepFlatten
+    <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">
+<p>
+An optimization pass for the <a href="SSA2">SSA2</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="SSA2Simplify">SSA2Simplify</a>. 
+</p>
+<h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Flatten into mutable fields of objects and into vectors. 
+</p>
+<p>
+For example, an <tt>(int&nbsp;*&nbsp;int)&nbsp;ref</tt> is represented by a 2 word object, and an <tt>(int&nbsp;*&nbsp;int)&nbsp;array</tt> contains pairs of <tt>int</tt>s, rather than pointers to pairs of <tt>int</tt>s. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/deep-flatten.sig?view=markup">deep-flatten.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/deep-flatten.fun?view=markup">deep-flatten.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:39:38 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/DefineTypeBeforeUse
===================================================================
--- mlton/trunk/doc/guide/DefineTypeBeforeUse	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/DefineTypeBeforeUse	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,106 @@
+<!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>DefineTypeBeforeUse - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      DefineTypeBeforeUse
+    <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">
+<a href="StandardML">Standard ML</a> requires types to be defined before they are used.  Because of type inference, the use of a type can be implicit; hence, this requirement is more subtle than it might appear.  For example, the following program is not type correct, because the type of <tt>r</tt> is <tt>t&nbsp;option&nbsp;ref</tt>, but <tt>t</tt> is defined after <tt>r</tt>. 
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> r = ref NONE
+<B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">A</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">B</FONT>
+</FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> () = r := SOME A
+</PRE>
+<p>
+ 
+</p>
+<p>
+MLton reports the following error, indicating that the type defined on line 2 is used on line 1. 
+</p>
+
+<pre>Error: z.sml 1.1.
+  Type escapes the scope of its definition at z.sml 2.10.
+    type: t
+    in: val r = ref NONE
+</pre><p>
+While the above example is benign, the following example shows how to cast an integer to a function by (implicitly) using a type before it is defined.  In the example, the ref cell <tt>r</tt> is of type  <tt>t&nbsp;option&nbsp;ref</tt>, where <tt>t</tt> is defined <em>after</em> <tt>r</tt>, as a parameter to functor <tt>F</tt>.  This example causes <a href="PolyML">PolyML</a> 4.1.3 to seg fault. 
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> r = ref NONE
+<B><FONT COLOR="#0000FF">functor</FONT></B> F (<B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t
+           </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> x: t) =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#A020F0">val</FONT></B> () = r := SOME x
+      <B><FONT COLOR="#A020F0">fun</FONT></B> get () = valOf (!r)
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+<B><FONT COLOR="#0000FF">structure</FONT></B> S1 = F (<B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> unit -&gt; unit
+                  </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> x = <B><FONT COLOR="#A020F0">fn</FONT></B> () =&gt; ())
+<B><FONT COLOR="#0000FF">structure</FONT></B> S2 = F (<B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> int
+                  </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> x = <B><FONT COLOR="#5F9EA0">13</FONT></B>)
+<B><FONT COLOR="#A020F0">val</FONT></B> () = S1.get () ()
+</PRE>
+ 
+</p>
+<p>
+Unfortunately, there is a bug in MLton 20041109 that causes it to fail to properly display an error message for this program.  Instead it displays the obscure internal bug message <tt>t&nbsp;has&nbsp;no&nbsp;region&nbsp;property</tt>.  This problem has since been fixed, and later versions of MLton display the following. 
+</p>
+
+<pre>Warning: z.sml 1.1.
+  Unable to locally determine type of variable: r.
+    type: ??? option ref
+    in: val r = ref NONE
+Error: z.sml 1.1.
+  Type escapes the scope of its definition at z.sml 2.17.
+    type: t
+    in: val r = ref NONE
+</pre></div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-26 20:36:15 by <span title="cfs36.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/DefinitionOfStandardML
===================================================================
--- mlton/trunk/doc/guide/DefinitionOfStandardML	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/DefinitionOfStandardML	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,62 @@
+<!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>DefinitionOfStandardML - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      DefinitionOfStandardML
+    <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">
+<a href = "References#MilnerEtAl97"> The Definition of Standard ML (Revised)</a> is a terse and formal specification of <a href="StandardML">Standard ML</a>'s syntax and semantics.  The language specified by this book is often referred to as SML 97. <p>
+There is an <a href = "References#MilnerEtAl90"> older version</a> of the definition, published in 1990, which has an accompanying <a href = "References#MilnerTofte90"> commentary</a> that introduces and explains the notation and approach. The same notation is used in the SML 97 definition, so it is worth purchasing the older definition and commentary if you intend a close study of the definition. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-28 19:55:24 by <span title="adsl-64-166-225-13.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Defunctorize
===================================================================
--- mlton/trunk/doc/guide/Defunctorize	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Defunctorize	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,144 @@
+<!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>Defunctorize - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Defunctorize
+    <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">
+A translation pass from the <a href="CoreML">CoreML</a> <a href="IntermediateLanguage">IntermediateLanguage</a> to the <a href="XML">XML</a> <a href="IntermediateLanguage">IntermediateLanguage</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Converts a <a href="CoreML">CoreML</a> program to an <a href="XML">XML</a> program by performing: 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ linearlization 
+</p>
+</li>
+    <li>
+<p>
+ <a href="MatchCompile">MatchCompile</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a class="nonexistent" href="LookupConstants">LookupConstants</a> 
+</p>
+</li>
+    <li>
+<p>
+ polymorphic <tt>val</tt> dec expansion 
+</p>
+</li>
+    <li>
+<p>
+ <tt>datatype</tt> lifting (to the top-level) 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/defunctorize/defunctorize.sig?view=markup">defunctorize.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/defunctorize/defunctorize.fun?view=markup">defunctorize.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+<p>
+This pass is grossly misnamed (a consequence of the implementation of an <a href="Elaborate">Elaborate</a> pass that follows the  <a href="DefinitionOfStandardML"> Definition</a> and produces readable error messages). 
+</p>
+<h4 id="head-98226d2b13506c91181c040abfc6bb115b088746">Datatype Lifting</h4>
+<p>
+This pass moves all <tt>datatype</tt> declarations to the top level. 
+</p>
+<p>
+<a href="StandardML">Standard ML</a> <tt>datatype</tt> declarations can contain type variables that are not bound in the declaration itself.  For example, the following program is valid. 
+<pre class=code>
+<B><FONT COLOR="#A020F0">fun</FONT></B> <FONT COLOR="#228B22"><B>'a</FONT></B> f (x: 'a) =
+   <B><FONT COLOR="#A020F0">let</FONT></B>
+      <B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> 'b t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">T</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> 'a * 'b
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> y: int t = T (x, <B><FONT COLOR="#5F9EA0">1</FONT></B>)
+   <B><FONT COLOR="#A020F0">in</FONT></B> 
+      <B><FONT COLOR="#5F9EA0">13</FONT></B>
+   <B><FONT COLOR="#A020F0">end</FONT></B>
+</PRE>
+ 
+</p>
+<p>
+Unfortunately, the <tt>datatype</tt> declaration can not be immediately moved to the top level, because that would leave <tt>'a</tt> free. 
+<pre>datatype 'b t = T of 'a * 'b
+fun 'a f (x: 'a) =
+   let 
+      val y: int t = T (x, 1)
+   in 
+      13
+   end
+</pre>In order to safely move <tt>datatype</tt>s, this pass must close them, as well as add any free type variables as extra arguments to the type constructor.  For example, the above program would be translated to the following. 
+<pre>datatype ('a, 'b) t = T of 'a * 'b
+fun 'a f (x: 'a) = 
+   let 
+      val y: ('a, int) t = T (x, 1)
+   in 
+      13
+   end
+</pre>
+</p>
+<h2 id="head-53d5b31ac8da1ff19a82453fd040f529e241f6cd">Historical Notes</h2>
+<p>
+The Defunctorize pass originally eliminated  <a href="StandardML">Standard ML</a> functors by duplicating their body at each application.  These duties have been adopted by the <a href="Elaborate">Elaborate</a> pass. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:39:23 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Developers
===================================================================
--- mlton/trunk/doc/guide/Developers	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Developers	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,118 @@
+<!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>Developers - 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">
+
+
+<link rel="Appendix" title="team.jpg" href="http://mlton.org/pages/Developers/attachments/team.jpg">
+</head>
+
+<body lang="en" dir="ltr">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Developers
+    <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">
+Here is a picture of the MLton team at a meeting in Chicago in August 2003.  From left to right we have: <p>
+<a href="StephenWeeks">StephenWeeks</a> <a href="MatthewFluet">MatthewFluet</a> <a href="HenryCejtin">HenryCejtin</a> <a href="SureshJagannathan">SureshJagannathan</a> 
+</p>
+<p>
+<img src="http://mlton.org/pages/Developers/attachments/team.jpg?ts=1098901016" alt="team.jpg"> 
+</p>
+<p>
+Also see the <a href="Credits">Credits</a> for a list of specific contributions. 
+</p>
+<h2 id="head-b90776c7682f20fa1845ab687f9e1eef63b0ad4d">Developers list</h2>
+<p>
+A number of people read the developers mailing list, <tt>MLton@mlton.org</tt>, and make contributions there.  Here's a list of those on the list who have a page here. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="JohnnyAndersen">JohnnyAndersen</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="MikeThomas">MikeThomas</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="RayRacine">RayRacine</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="AndreiFormiga">AndreiFormiga</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="JesperLouisAndersen">JesperLouisAndersen</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="MichaelNorrish">MichaelNorrish</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="WesleyTerpstra">WesleyTerpstra</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="VesaKarvonen">VesaKarvonen</a> 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-12 13:54:35 by <span title="cs78147176.pp.htv.fi"><a href="VesaKarvonen">VesaKarvonen</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Development
===================================================================
--- mlton/trunk/doc/guide/Development	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Development	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,122 @@
+<!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>Development - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Development
+    <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">
+This page is the central point for MLton development. 
+    <ul>
+
+    <li>
+<p>
+ Access the <a href="Sources">Sources</a>. 
+</p>
+</li>
+    <li>
+<p>
+ Ideas for <a href="Projects">Projects</a> to improve MLton. 
+</p>
+</li>
+    <li>
+<p>
+ <a href="Developers">Developers</a> that are or have been involved in the project. 
+</p>
+</li>
+    <li>
+<p>
+ Help maintain and improve the <a href="WebSite">WebSite</a>. 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-70440046a3dc2e079f23ee1c57dfa76669b732aa">Notes</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="CompilerOverview">CompilerOverview</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="CrossCompiling">CrossCompiling</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="License">License</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="PortingMLton">PortingMLton</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="ReleaseChecklist">ReleaseChecklist</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="SelfCompiling">SelfCompiling</a> 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-04-22 19:59:46 by <span title="adsl-67-117-152-215.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Documentation
===================================================================
--- mlton/trunk/doc/guide/Documentation	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Documentation	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,199 @@
+<!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>Documentation - 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">
+
+
+<link rel="Appendix" title="mllex.pdf" href="http://mlton.org/pages/Documentation/attachments/mllex.pdf">
+<link rel="Appendix" title="mlyacc.pdf" href="http://mlton.org/pages/Documentation/attachments/mlyacc.pdf">
+<link rel="Appendix" title="user-guide.gz" href="http://mlton.org/pages/Documentation/attachments/user-guide.gz">
+<link rel="Appendix" title="user-guide.pdf" href="http://mlton.org/pages/Documentation/attachments/user-guide.pdf">
+</head>
+
+<body lang="en" dir="ltr">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Documentation
+    <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">
+Documentation is available on the following topics. 
+    <ul>
+
+    <li>
+<p>
+ <a href="StandardML">Standard ML</a> 
+</p>
+</li>
+
+        <ul>
+
+        <li>
+<p>
+ <a href="BasisLibrary"> SML Basis Library</a> 
+</p>
+</li>
+        <li>
+<p>
+ <a href="Libraries"> Additional libraries</a> 
+</p>
+</li>
+
+        </ul>
+
+
+    <li>
+<p>
+ <a href="Installation">Installing MLton</a> 
+</p>
+</li>
+    <li>
+<p>
+ Using MLton 
+</p>
+</li>
+
+        <ul>
+
+        <li>
+<p>
+ <a href="ForeignFunctionInterface"> Foreign function interface (FFI)</a> 
+</p>
+</li>
+        <li>
+<p>
+ <a href="ManualPage"> Manual Page</a> 
+</p>
+</li>
+        <li>
+<p>
+ <a href="MLBasis"> ML Basis system</a> 
+</p>
+</li>
+        <li>
+<p>
+ <a href="MLtonStructure"> MLton structure</a> 
+</p>
+</li>
+        <li>
+<p>
+ <a href="PlatformSpecificNotes"> Platform specific notes</a> 
+</p>
+</li>
+        <li>
+<p>
+ <a href="Profiling"> Profiling</a> 
+</p>
+</li>
+        <li>
+<p>
+ <a href="TypeChecking"> Type checking</a> 
+</p>
+</li>
+
+        </ul>
+
+
+    <li>
+<p>
+ About MLton 
+</p>
+</li>
+
+        <ul>
+
+        <li>
+<p>
+ <a href="Credits">Credits</a> 
+</p>
+</li>
+        <li>
+<p>
+ <a href="Drawbacks">Drawbacks</a> 
+</p>
+</li>
+        <li>
+<p>
+ <a href="Features">Features</a> 
+</p>
+</li>
+        <li>
+<p>
+ <a href="History">History</a> 
+</p>
+</li>
+        <li>
+<p>
+ <a href="License">License</a> 
+</p>
+</li>
+        <li>
+<p>
+ <a href="Talk">Talk</a> 
+</p>
+</li>
+
+        </ul>
+
+
+    <li>
+<p>
+ <a class="nonexistent" href="MLLex">MLLex</a> <a href="http://mlton.org/pages/Documentation/attachments/mllex.pdf">pdf</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a class="nonexistent" href="MLYacc">MLYacc</a> <a href="http://mlton.org/pages/Documentation/attachments/mlyacc.pdf">pdf</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="References">References</a> 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-29 01:32:35 by <span title="adsl-64-170-112-189.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Drawbacks
===================================================================
--- mlton/trunk/doc/guide/Drawbacks	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Drawbacks	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,98 @@
+<!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>Drawbacks - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Drawbacks
+    <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">
+
+    <ul>
+
+    <li>
+<p>
+ Large compile-time memory requirement. 
+</p>
+</li>
+
+            <ul>
+
+   Because MLton performs whole-program analysis and    optimization, compilation requires a large amount of    memory.  For example, compiling MLton (over 140K lines)    requires at least 512M RAM. 
+            </ul>
+
+
+    <li class="gap">
+<p>
+ Long compile times. 
+</p>
+</li>
+
+            <ul>
+
+   Whole-program compilation can take a long time on large    programs.  For example, compiling MLton (over 140K lines)    on a 1.6GhZ machine takes five to ten minutes. 
+            </ul>
+
+
+    <li class="gap">
+<p>
+ No interactive top level. 
+</p>
+</li>
+
+            <ul>
+
+   Because of whole-program compilation, MLton does not    provide an interactive top level.  In particular, it does    not implement the optional <tt>use</tt> <a href="BasisLibrary"> SML Basis Library</a>    function. </ul>
+
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-28 21:47:21 by <span title="cfs36.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/EXene
===================================================================
--- mlton/trunk/doc/guide/EXene	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/EXene	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,62 @@
+<!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>EXene - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      EXene
+    <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">
+<a class="external" href="http://people.cs.uchicago.edu/~jhr/eXene/index.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">eXene</a> is a multi-threaded X Window System toolkit written in <a href="ConcurrentML">ConcurrentML</a>. <p>
+There is a group at K-State working toward <a class="external" href="http://www.cis.ksu.edu/~stough/eXene/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">eXene 2.0</a>. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-17 12:07:27 by <span title="net-79206.roam.fas.harvard.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Eclipse
===================================================================
--- mlton/trunk/doc/guide/Eclipse	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Eclipse	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,62 @@
+<!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>Eclipse - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Eclipse
+    <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">
+<a class="external" href="http://eclipse.org/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Eclipse</a> is an open, extensible IDE. <p>
+There has been some talk on the MLton mailing list about adding support to Eclipse for MLton/SML, and in particular, using <a href="http://eclipsefp.sourceforge.net/">http://eclipsefp.sourceforge.net/</a>.  So far, we are unaware of any progress along these lines. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-03-08 06:46:15 by <span title="adsl-67-117-153-127.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/EditingPages
===================================================================
--- mlton/trunk/doc/guide/EditingPages	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/EditingPages	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,65 @@
+<!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>EditingPages - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      EditingPages
+    <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">
+You can help maintain the site and improve a page's contents by using the "Edit" link found at the bottom of that page.  Pages are written using <a href="MoinMoin">MoinMoin</a>'s  <a class="external" href="http://moinmoin.wikiwikiweb.de/HelpOnEditing"><img src="moin-www.png" alt="[WWW]" height="11" width="11">wiki markup language</a>. You can practice editing in the <a href="http://mlton.org/WikiSandBox">WikiSandBox</a>. <p>
+Before you begin editing, you must  <a href="http://mlton.org/Preferences">create a user account</a>.  When you do so, please also create a home page (like <a href="StephenWeeks">StephenWeeks</a>) so we know who you are.  See our <a href="AccessControl">AccessControl</a> policy for who is allowed to edit what. 
+</p>
+<p>
+By contributing to this web site, you agree to dedicate your contribution to the public domain.  For more details, please see the <a href="License">License</a>. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-03 00:40:17 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Elaborate
===================================================================
--- mlton/trunk/doc/guide/Elaborate	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Elaborate	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,370 @@
+<!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>Elaborate - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Elaborate
+    <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">
+A translation pass from the <a href="AST">AST</a> <a href="IntermediateLanguage">IntermediateLanguage</a> to the <a href="CoreML">CoreML</a> <a href="IntermediateLanguage">IntermediateLanguage</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Performs type inference and type checking according to the <a href="DefinitionOfStandardML"> Definition</a>. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate/elaborate.sig?view=markup">elaborate.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate/elaborate.fun?view=markup">elaborate.fun</a>
+<br>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate/elaborate-env.sig?view=markup">elaborate-env.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate/elaborate-env.fun?view=markup">elaborate-env.fun</a>
+<br>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate/elaborate-modules.sig?view=markup">elaborate-modules.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate/elaborate-modules.fun?view=markup">elaborate-modules.fun</a>
+<br>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate/elaborate-core.sig?view=markup">elaborate-core.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate/elaborate-core.fun?view=markup">elaborate-core.fun</a>
+<br>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate">elaborate</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+<p>
+At the modules level, the Elaborate pass: 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ elaborates signatures with interfaces (see 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate/interface.sig?view=markup">interface.sig</a>
+ and 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate/interface.fun?view=markup">interface.fun</a>
+).   
+</p>
+</li>
+
+            <ul>
+
+   The main trick is to use disjoint sets to efficiently handle    sharing of tycons and of structures and then to copy signatures as    dags rather than as trees. 
+            </ul>
+
+
+    <li>
+<p>
+ checks functors at the point of definition, using functor summaries to speed up checking of functor applications. 
+</p>
+</li>
+
+            <ul>
+
+   When a functor is first type checked, we keep track of the dummy    argument structure and the dummy result structure, as well as all    the tycons that were created while elaborating the body.  Then, if    we later need to type check an application of the functor (as    opposed to defunctorize an application), we pair up tycons in the    dummy argument structure with the actual argument structure and    then replace the dummy tycons with the actual tycons in the dummy    result structure, yielding the actual result structure.  We also    generate new tycons for all the tycons that we created while    originally elaborating the body. 
+            </ul>
+
+
+    <li>
+<p>
+ handles opaque signature constraints.   
+</p>
+</li>
+
+            <ul>
+
+   This is implemented by building a dummy structure realized from the    signature, just as we would for a functor argument when type    checking a functor.  The dummy structure contains exactly the type    information that is in the signature, which is what opacity    requires.  We then replace the variables (and constructors) in the    dummy structure with the corresponding variables (and constructors)    from the actual structure so that the translation to <a href="CoreML">CoreML</a>    uses the right stuff.  For each tycon in the dummy structure, we    keep track of the corresponding type structure in the actual    structure.  This is used when producing the <a href="CoreML">CoreML</a> types (see    <tt>expandOpaque</tt> in 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate/type-env.sig?view=markup">type-env.sig</a>
+ and    
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate/type-env.fun?view=markup">type-env.fun</a>
+). 
+            </ul>
+
+
+
+    </ul>
+
+
+<p>
+Then, within each <tt>structure</tt> or <tt>functor</tt> body, for each declaration (<tt>&lt;dec&gt;</tt> in the <a href="StandardML">Standard ML</a> grammar), the Elaborate pass does three steps: 
+</p>
+
+    <ol type="1">
+
+    <li>
+<p>
+<a href="ScopeInference">ScopeInference</a> 
+</p>
+</li>
+    <li>
+<p>
+ 
+</p>
+</li>
+
+                <ul>
+
+                <li>
+<p>
+ <a href="PrecedenceParse">PrecedenceParse</a> 
+</p>
+</li>
+                <li>
+<p>
+ <tt>_{ex,im}port</tt> expansion 
+</p>
+</li>
+                <li>
+<p>
+ profiling insertion 
+</p>
+</li>
+                <li>
+<p>
+ unification 
+</p>
+</li>
+
+                </ul>
+
+
+    <li>
+<p>
+Overloaded {constant, function, record pattern} resolution 
+</p>
+</li>
+
+    </ol>
+
+
+<h4 id="head-4cd3688ea7edd2f9c363c4ca43ea16b47061e473">Defunctorization</h4>
+<p>
+The Elaborate pass performs a number of duties historically assigned to the <a href="Defunctorize">Defunctorize</a> pass. 
+</p>
+<p>
+As part of the Elaborate pass, all module level constructs (<tt>open</tt>, <tt>signature</tt>, <tt>structure</tt>, <tt>functor</tt>, long identifiers) are removed.  This works because the Elaborate pass assigns a unique name to every type and variable in the program.  This also allows the Elaborate pass to eliminate <tt>local</tt> declarations, which are purely for namespace management. 
+</p>
+<p>
+Here are a number of examples of elaboration. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ All variables bound in <tt>val</tt> declarations are renamed.    
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> x = <B><FONT COLOR="#5F9EA0">13</FONT></B>
+<B><FONT COLOR="#A020F0">val</FONT></B> y = x
+</PRE>
+  
+<pre>val x_0 = 13 
+val y_0 = x_0
+</pre>
+</p>
+</li>
+    <li class="gap">
+<p>
+ All variables in <tt>fun</tt> declarations are renamed.   
+<pre class=code>
+<B><FONT COLOR="#A020F0">fun</FONT></B> f x = g x
+<B><FONT COLOR="#A020F0">and</FONT></B> g y = f y
+</PRE>
+  
+<pre>fun f_0 x_0 = g_0 x_0
+and g_0 y_0 = f_0 y_0
+</pre>
+</p>
+</li>
+    <li class="gap">
+<p>
+ Type abbreviations are removed, and the abbreviation is expanded  wherever it is used.   
+<pre class=code>
+<B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> 'a u </FONT></B>=<FONT COLOR="#228B22"><B> int * 'a
+</FONT></B><B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> 'b t </FONT></B>=<FONT COLOR="#228B22"><B> 'b u * real
+</FONT></B><B><FONT COLOR="#A020F0">fun</FONT></B> f (x : bool t) = x
+</PRE>
+ 
+<pre>fun f_0 (x_0 : (int * bool) * real) = x_0
+</pre>
+</p>
+</li>
+    <li class="gap">
+<p>
+ Exception declarations create a new constructor and rename the  type.   
+<pre class=code>
+<B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> int
+</FONT></B><B><FONT COLOR="#A020F0">exception</FONT></B><FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">E</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> t * real
+</FONT></B></PRE>
+   
+<pre>exception E_0 of int * real
+</pre>
+</p>
+</li>
+    <li class="gap">
+<p>
+ The type and value constructors in datatype declarations are renamed.  
+<pre class=code>
+<B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">A</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> int </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">B</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> real * t
+</FONT></B></PRE>
+  
+<pre>datatype t_0 = A_0 of int | B_0 of real * t_0
+</pre>
+</p>
+</li>
+    <li class="gap">
+<p>
+ Local declarations are moved to the top-level.  The environment  keeps track of the variables in scope.  
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> x = <B><FONT COLOR="#5F9EA0">13</FONT></B>
+<B><FONT COLOR="#A020F0">local</FONT></B> <B><FONT COLOR="#A020F0">val</FONT></B> x = <B><FONT COLOR="#5F9EA0">14</FONT></B>
+<B><FONT COLOR="#A020F0">in</FONT></B> <B><FONT COLOR="#A020F0">val</FONT></B> y = x
+<B><FONT COLOR="#A020F0">end</FONT></B>
+<B><FONT COLOR="#A020F0">val</FONT></B> z = x
+</PRE>
+  
+<pre>val x_0 = 13
+val x_1 = 14
+val y_0 = x_1
+val z_0 = x_0
+</pre>
+</p>
+</li>
+    <li class="gap">
+<p>
+ Structure declarations are eliminated, with all declarations   moved to the top level.  Long identifiers are renamed.  
+<pre class=code>
+<B><FONT COLOR="#0000FF">structure</FONT></B> S =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> int
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> x : t = <B><FONT COLOR="#5F9EA0">13</FONT></B>
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+<B><FONT COLOR="#A020F0">val</FONT></B> y : S.t = S.x
+</PRE>
+  
+<pre>val x_0 : int = 13
+val y_0 : int = x_0
+</pre>
+</p>
+</li>
+    <li class="gap">
+<p>
+ Open declarations are eliminated.  
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> x = <B><FONT COLOR="#5F9EA0">13</FONT></B>
+<B><FONT COLOR="#A020F0">val</FONT></B> y = <B><FONT COLOR="#5F9EA0">14</FONT></B>
+<B><FONT COLOR="#0000FF">structure</FONT></B> S =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+     <B><FONT COLOR="#A020F0">val</FONT></B> x = <B><FONT COLOR="#5F9EA0">15</FONT></B>
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+<B><FONT COLOR="#0000FF">open</FONT></B> S
+<B><FONT COLOR="#A020F0">val</FONT></B> z = x + y
+</PRE>
+  
+<pre>val x_0 = 13
+val y_0 = 14
+val x_1 = 15
+val z_0 = x_1 + y_0
+</pre>
+</p>
+</li>
+    <li class="gap">
+<p>
+ Functor declarations are eliminated, and the body of a functor is  duplicated wherever the functor is applied.  
+<pre class=code>
+<B><FONT COLOR="#0000FF">functor</FONT></B> F(<B><FONT COLOR="#A020F0">val</FONT></B> x : int) =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+     <B><FONT COLOR="#A020F0">val</FONT></B> y = x
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+<B><FONT COLOR="#0000FF">structure</FONT></B> F1 = F(<B><FONT COLOR="#A020F0">val</FONT></B> x = <B><FONT COLOR="#5F9EA0">13</FONT></B>)
+<B><FONT COLOR="#0000FF">structure</FONT></B> F2 = F(<B><FONT COLOR="#A020F0">val</FONT></B> x = <B><FONT COLOR="#5F9EA0">14</FONT></B>)
+<B><FONT COLOR="#A020F0">val</FONT></B> z = F1.y + F2.y
+</PRE>
+  
+<pre>val x_0 = 13
+val y_0 = x_0
+val x_1 = 14
+val y_1 = x_1
+val z_0 = y_0 + y_1
+</pre>
+</p>
+</li>
+    <li class="gap">
+<p>
+ Signature constraints are eliminated.  Note that signatures do  affect how subsequent variables are renamed.  
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> y = <B><FONT COLOR="#5F9EA0">13</FONT></B>
+<B><FONT COLOR="#0000FF">structure</FONT></B> S : <B><FONT COLOR="#0000FF">sig</FONT></B>
+                 <B><FONT COLOR="#A020F0">val</FONT></B> x : int
+              <B><FONT COLOR="#0000FF">end</FONT></B> =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#A020F0">val</FONT></B> x = <B><FONT COLOR="#5F9EA0">14</FONT></B>
+      <B><FONT COLOR="#A020F0">val</FONT></B> y = x
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+<B><FONT COLOR="#0000FF">open</FONT></B> S
+<B><FONT COLOR="#A020F0">val</FONT></B> z = x + y
+</PRE>
+  
+<pre>val y_0 = 13
+val x_0 = 14
+val y_1 = x_0
+val z_0 = x_0 + y_0
+</pre>
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:38:59 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Emacs
===================================================================
--- mlton/trunk/doc/guide/Emacs	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Emacs	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,162 @@
+<!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>Emacs - 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">
+
+
+<link rel="Appendix" title="esml-mlb-mode.el" href="http://mlton.org/pages/Emacs/attachments/esml-mlb-mode.el">
+<link rel="Appendix" title="mlb.el" href="http://mlton.org/pages/Emacs/attachments/mlb.el">
+</head>
+
+<body lang="en" dir="ltr">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Emacs
+    <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">
+<h2 id="head-2e0730f57444eb865302c3917a4902e6ceae973f">SML Modes</h2>
+<p>
+There are a few Emacs modes for SML. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>sml-mode</tt> 
+</p>
+</li>
+
+        <ul>
+
+        <li>
+<p>
+ <a href="http://www.xemacs.org/Documentation/packages/html/sml-mode_3.html">http://www.xemacs.org/Documentation/packages/html/sml-mode_3.html</a> 
+</p>
+</li>
+        <li>
+<p>
+ <a href="http://www.smlnj.org/doc/Emacs/sml-mode.html">http://www.smlnj.org/doc/Emacs/sml-mode.html</a> 
+</p>
+</li>
+
+        </ul>
+
+
+    <li class="gap">
+<p>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/ide/emacs/mlton.el?view=markup">mlton.el</a>
+ contains the Emacs lisp that <a href="StephenWeeks">StephenWeeks</a>  uses to interact with MLton (in addition to using <tt>sml-mode</tt>). 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a href="http://primate.net/~itz/mindent.tar">http://primate.net/~itz/mindent.tar</a>, developed by Ian Zimmerman,  who writes: 
+</p>
+</li>
+
+        <ul>
+
+  Unlike the widespread <tt>sml-mode.el</tt> it doesn't try to indent   code based on ML syntax.  I gradually got sceptical about this   approach after writing the initial indentation support for caml mode   and watching it bloat insanely as the language added new features.   Also, any such attempts that I know of impose a particular coding   style, or at best a choice among a limited set of styles, which I   now oppose.  Instead my mode is based on a generic package which   provides manual bindable commands for common indentation operations   (example: indent the current line under the n-th occurrence of a   particular character in the previous non-blank line). 
+        </ul>
+
+
+
+    </ul>
+
+
+<h3 id="head-ca4c2c588f94359116733bd5a53f0e418c8306bd">MLB modes</h3>
+<p>
+There are a couple of modes for editing <a href="MLBasis"> ML Basis</a> files.  
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/ide/emacs/esml-mlb-mode.el?view=markup">esml-mlb-mode.el</a>
+ 
+</p>
+</li>
+    <li>
+<p>
+ <a href="http://mlton.org/pages/Emacs/attachments/mlb.el">mlb.el</a> 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-38a2998cc83b4215b89f0b96917e58d59fdfae52">Error messages</h2>
+<p>
+MLton's error messages are not in the format that the Emacs <tt>next-error</tt> parser natively understands.  There are a couple of ways to fix this.  The easiest way is to add the following to your <tt>.emacs</tt> to cause Emacs to recognize MLton's error messages. 
+</p>
+
+        <ul>
+
+  
+<pre>(require 'compile)
+(add-to-list 'compilation-error-regexp-alist
+             '("^Error: \\([^\t\n]*\\) \\([0-9]+\\)\\.\\([0-9]+\\)\\.$"
+               1 2 3))
+</pre>
+        </ul>
+
+
+<p>
+Alternatively, you could use a sed script to rewrite MLton's errors. Here is one such script: 
+</p>
+
+        <ul>
+
+  
+<pre>sed -e 's/^\([W|E].*\): \([^ ]*\) \([0-9][0-9]*\)\.\([0-9][0-9]*\)\./\2:\3:\1:\4/'
+</pre></ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-06 22:25:50 by <span title="pool-70-22-241-24.bos.east.verizon.net"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Enscript
===================================================================
--- mlton/trunk/doc/guide/Enscript	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Enscript	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,205 @@
+<!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>Enscript - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Enscript
+    <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">
+<a class="external" href="http://people.ssh.com/mtr/genscript"><img src="moin-www.png" alt="[WWW]" height="11" width="11">GNU Enscript</a> converts ASCII files to Post<strong></strong>Script, HTML, and other output languages,  applying language sensitive highlighting (similar to <a href="Emacs">Emacs</a>'s font lock mode).  Here are a few <em>states</em> files for highlighting <a href="StandardML"> Standard ML</a>. 
+    <ul>
+
+    <li>
+<p>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/ide/enscript/sml_simple.st?view=markup">sml_simple.st</a>
+ -- Provides highlighting of keywords, string and character constants, and (nested) comments.  
+<pre class=code>
+<I><FONT COLOR="#B22222">(* Comments (* can be nested *) *)</FONT></I>
+<B><FONT COLOR="#A020F0">structure</FONT></B> S = <B><FONT COLOR="#A020F0">struct</FONT></B>
+  <B><FONT COLOR="#A020F0">val</FONT></B> x = (1, 2, <FONT COLOR="#BC8F8F"><B>&quot;three&quot;</FONT></B>)
+<B><FONT COLOR="#A020F0">end</FONT></B>
+</PRE>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/ide/enscript/sml_verbose.st?view=markup">sml_verbose.st</a>
+ -- Supersedes the above, adding  highlighting of numeric constants.  Due to the limited parsing  available, numeric record labels are highlighted as numeric  constants, in all contexts.  Likewise, a binding precedence separated  from <tt>infix</tt> or <tt>infixr</tt> by a newline is highlighted as a  numeric constant and a numeric record label selector separated from  <tt>#</tt> by a newline is highlighted as a numeric constant.  
+</p>
+ 
+<pre class=code>
+<B><FONT COLOR="#A020F0">structure</FONT></B> S = <B><FONT COLOR="#A020F0">struct</FONT></B>
+  <I><FONT COLOR="#B22222">(* These look good *)</FONT></I>
+  <B><FONT COLOR="#A020F0">val</FONT></B> x = (<B><FONT COLOR="#5F9EA0">1</FONT></B>, <B><FONT COLOR="#5F9EA0">2</FONT></B>, <FONT COLOR="#BC8F8F"><B>&quot;three&quot;</FONT></B>)
+  <B><FONT COLOR="#A020F0">val</FONT></B> z = #2 x
+
+  <I><FONT COLOR="#B22222">(* Although these look bad (not all the numbers are constants),       *
+   * they never occur in practice, as they are equivalent to the above. *)</FONT></I>
+  <B><FONT COLOR="#A020F0">val</FONT></B> x = {<B><FONT COLOR="#5F9EA0">1</FONT></B> = <B><FONT COLOR="#5F9EA0">1</FONT></B>, <B><FONT COLOR="#5F9EA0">3</FONT></B> = <FONT COLOR="#BC8F8F"><B>&quot;three&quot;</FONT></B>, <B><FONT COLOR="#5F9EA0">2</FONT></B> = <B><FONT COLOR="#5F9EA0">2</FONT></B>}
+  <B><FONT COLOR="#A020F0">val</FONT></B> z = #
+            <B><FONT COLOR="#5F9EA0">2</FONT></B> x
+<B><FONT COLOR="#A020F0">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/ide/enscript/sml_fancy.st?view=markup">sml_fancy.st</a>
+ -- Supersedes the above, adding  highlighting of type and constructor bindings, highlighting of  explicit binding of type variables at <tt>val</tt> and <tt>fun</tt> declarations, and  separate highlighting of core and modules level keywords.  Due to the  limited parsing available, it is assumed that the input is a  syntactically correct, top-level declaration.  
+<pre class=code>
+<B><FONT COLOR="#0000FF">structure</FONT></B> S = <B><FONT COLOR="#0000FF">struct</FONT></B>
+  <B><FONT COLOR="#A020F0">val</FONT></B> x = (<B><FONT COLOR="#5F9EA0">1</FONT></B>, <B><FONT COLOR="#5F9EA0">2</FONT></B>, <FONT COLOR="#BC8F8F"><B>&quot;three&quot;</FONT></B>)
+  <B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> 'a t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">T</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> 'a
+       </FONT></B><B><FONT COLOR="#A020F0">and</FONT></B><FONT COLOR="#228B22"><B> u </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">U</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> v * v
+  </FONT></B><B><FONT COLOR="#A020F0">withtype</FONT></B><FONT COLOR="#228B22"><B> v </FONT></B>=<FONT COLOR="#228B22"><B> {left: int t, right: int t}
+  </FONT></B><B><FONT COLOR="#A020F0">exception</FONT></B><FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">E1</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> int </FONT></B><B><FONT COLOR="#A020F0">and</FONT></B><FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">E2</FONT>
+  </FONT></B><B><FONT COLOR="#A020F0">fun</FONT></B> <FONT COLOR="#228B22"><B>'a</FONT></B> id (x: 'a) : 'a = x
+
+  <I><FONT COLOR="#B22222">(* Although this looks bad (the explicitly bound type variable 'a is *
+   * not highlighted), it is unlikely to occur in practice.            *)</FONT></I>
+  <B><FONT COLOR="#A020F0">val</FONT></B> 
+      'a id = <B><FONT COLOR="#A020F0">fn</FONT></B> (x : 'a) =&gt; x
+<B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/ide/enscript/sml_gaudy.st?view=markup">sml_gaudy.st</a>
+ -- Supersedes the above, adding  highlighting of type annotations, in both expressions and signatures.  Due to the limited parsing available, it is assumed that the input is  a syntactically correct, top-level declaration.   
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> S = <B><FONT COLOR="#0000FF">sig</FONT></B>
+  <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t
+  </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> x :<FONT COLOR="#228B22"><B> t
+  </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> f :<FONT COLOR="#228B22"><B> t * int -&gt; int
+</FONT></B><B><FONT COLOR="#0000FF">end</FONT></B>
+<B><FONT COLOR="#0000FF">structure</FONT></B> S : S = <B><FONT COLOR="#0000FF">struct</FONT></B>
+  <B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">T</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> int
+  </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> x :<FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B></FONT></B> T <B><FONT COLOR="#5F9EA0">0</FONT></B>
+  <B><FONT COLOR="#A020F0">fun</FONT></B> f (T x, i :<FONT COLOR="#228B22"><B> int</FONT></B>) :<FONT COLOR="#228B22"><B> int </FONT></B>=<FONT COLOR="#228B22"><B></FONT></B> x + y
+  <B><FONT COLOR="#A020F0">fun</FONT></B> <FONT COLOR="#228B22"><B>'a</FONT></B> id (x:<FONT COLOR="#228B22"><B> 'a</FONT></B>) :<FONT COLOR="#228B22"><B> 'a </FONT></B>=<FONT COLOR="#228B22"><B></FONT></B> x
+<B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+ 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-e5a1ef08918738578c7f1b88920c73a60499c69d">Install and use</h2>
+
+    <ul>
+
+    <li>
+<p>
+ Version 1.6.3 of <a class="external" href="http://people.ssh.com/mtr/genscript"><img src="moin-www.png" alt="[WWW]" height="11" width="11">GNU Enscript</a> 
+</p>
+</li>
+
+            <ul>
+
+            <li>
+<p>
+ Copy all files to <tt>/usr/share/enscript/hl/</tt> or <tt>.enscript/</tt> in your home directory. 
+</p>
+</li>
+            <li>
+<p>
+ Invoke <tt>enscript</tt> with <tt>--highlight=sml_simple</tt> (or <tt>--highlight=sml_verbose</tt> or <tt>--highlight=sml_fancy</tt> or <tt>--highlight=sml_gaudy</tt>). 
+</p>
+</li>
+
+            </ul>
+
+
+    <li>
+<p>
+ Version 1.6.1 of <a class="external" href="http://people.ssh.com/mtr/genscript"><img src="moin-www.png" alt="[WWW]" height="11" width="11">GNU Enscript</a> 
+</p>
+</li>
+
+            <ul>
+
+            <li>
+<p>
+ Append 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/ide/enscript/sml_all.st?view=markup">sml_all.st</a>
+ to <tt>/usr/share/enscript/enscript.st</tt> 
+</p>
+</li>
+            <li>
+<p>
+ Invoke <tt>enscript</tt> with <tt>--pretty-print=sml_simple</tt> (or <tt>--pretty-print=sml_verbose</tt> or <tt>--pretty-print=sml_fancy</tt> or <tt>--pretty-print=sml_gaudy</tt>). 
+</p>
+</li>
+
+            </ul>
+
+
+
+    </ul>
+
+
+<p>
+This <a href="WebSite">WebSite</a> uses <tt>sml_fancy</tt> to pretty-print <a href="StandardML">Standard ML</a> source code.  Comments and suggestions should be directed to <a href="MatthewFluet">MatthewFluet</a>. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-06 22:27:48 by <span title="pool-70-22-241-24.bos.east.verizon.net"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/EqualityType
===================================================================
--- mlton/trunk/doc/guide/EqualityType	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/EqualityType	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,111 @@
+<!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>EqualityType - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      EqualityType
+    <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">
+An equality type is a type to which <a href="PolymorphicEquality">PolymorphicEquality</a> can be applied.  The <a href="DefinitionOfStandardML"> Definition</a> and the <a href="BasisLibrary"> SML Basis Library</a> precisely spell out which types are equality types. 
+    <ul>
+
+    <li>
+<p>
+ <tt>bool</tt>, <tt>char</tt>, <tt>IntInf.int</tt>, <tt>Int</tt>&lt;N&gt;<tt>.int</tt>,  <tt>string</tt>, and <tt>Word</tt>&lt;N&gt;<tt>.word</tt> are equality types.  
+</p>
+</li>
+    <li class="gap">
+<p>
+ for any <tt>t</tt>, both <tt>t&nbsp;array</tt> and <tt>t&nbsp;ref</tt> are equality  types.  
+</p>
+</li>
+    <li class="gap">
+<p>
+ if <tt>t</tt> is an equality type, then <tt>t&nbsp;list</tt>, and   <tt>t&nbsp;vector</tt> are equality types. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ if <tt>t1</tt>, ..., <tt>tn</tt> are equality types, then  <tt>t1&nbsp;*&nbsp;...&nbsp;*&nbsp;tn</tt>  and <tt>{l1:&nbsp;t1,&nbsp;...,&nbsp;ln:&nbsp;tn}&nbsp;</tt>  are equality types. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ if <tt>t1</tt>, ..., <tt>tn</tt> are equality types and <tt>t</tt>   <a href="AdmitsEquality">AdmitsEquality</a>, then <tt>(t1,&nbsp;...,&nbsp;tn)&nbsp;t</tt> is an equality type. 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+To check that a type t is an equality type, use the following idiom. 
+<pre class=code>
+<B><FONT COLOR="#0000FF">structure</FONT></B> S: <B><FONT COLOR="#0000FF">sig</FONT></B> <B><FONT COLOR="#A020F0">eqtype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B><B><FONT COLOR="#0000FF">end</FONT></B> =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> </FONT></B>...
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+ 
+</p>
+<p>
+Notably, <tt>exn</tt> and <tt>real</tt> are not equality types.  Neither is <tt>t1&nbsp;-&gt;&nbsp;t2</tt>, for any <tt>t1</tt> and <tt>t2</tt>. 
+</p>
+<p>
+Equality on arrays and ref cells is by identity, not structure.  For example, <tt>ref&nbsp;13&nbsp;=&nbsp;ref&nbsp;13</tt> is <tt>false</tt>. On the other hand, equality for lists, strings, and vectors is by structure, not identity.  For example, the following equalities hold. 
+</p>
+
+<pre>[1, 2, 3] = 1 :: [2, 3]
+"foo" = concat ["f", "o", "o"]
+Vector.fromList [1, 2, 3] = Vector.tabulate (3, fn i =&gt; i + 1)
+</pre></div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-28 21:47:14 by <span title="cfs36.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/EqualityTypeVariable
===================================================================
--- mlton/trunk/doc/guide/EqualityTypeVariable	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/EqualityTypeVariable	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,217 @@
+<!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>EqualityTypeVariable - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      EqualityTypeVariable
+    <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">
+<p>
+An equality type variable is a type variable that starts with two or more primes, as in <tt>''a</tt> or <tt>''b</tt>.  The canonical use of equality type variables is in specifying the type of the <a href="PolymorphicEquality">PolymorphicEquality</a> function, which is <tt>''a&nbsp;*&nbsp;''a&nbsp;-&gt;&nbsp;bool</tt>. Equality type variables ensure that polymorphic equality is only used on <a href="EqualityType">EqualityType</a>s, by requiring that at every use of a polymorphic value, equality type variables are instantiated by equality types. 
+</p>
+<p>
+For example, the following program is type correct because polymorphic equality is applied to variables of type <tt>''a</tt>. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">fun</FONT></B> f (x: ''a, y: ''a): bool = x = y
+</PRE>
+<p>
+ 
+</p>
+<p>
+On the other hand, the following program is not type correct, because polymorphic equality is applied to variables of type <tt>'a</tt>, which is not an equality type. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">fun</FONT></B> f (x: 'a, y: 'a): bool = x = y
+</PRE>
+<p>
+ 
+</p>
+<p>
+MLton reports the following error, indicating that polymorphic equality expects equality types, but didn't get them. 
+</p>
+
+<pre>Error: z.sml 1.32.
+  Function applied to incorrect argument.
+    expects: [&lt;equality&gt;] * [&lt;equality&gt;]
+    but got: [&lt;non-equality&gt;] * [&lt;non-equality&gt;]
+    in: = (x, y)
+</pre><p>
+As an example of using such a function that requires equality types, suppose that <tt>f</tt> has polymorphic type <tt>''a&nbsp;-&gt;&nbsp;unit</tt>.  Then, <tt>f&nbsp;13</tt> is type correct because <tt>int</tt> is an equality type.  On the other hand, <tt>f&nbsp;13.0</tt> and <tt>f&nbsp;(fn&nbsp;x&nbsp;=&gt;&nbsp;x)</tt> are not type correct, because <tt>real</tt> and arrow types are not equality types. We can test these facts with the following short programs.  First, we verify that such an <tt>f</tt> can be applied to integers. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">functor</FONT></B> Ok (<B><FONT COLOR="#A020F0">val</FONT></B> f: ''a -&gt; unit): <B><FONT COLOR="#0000FF">sig</FONT></B> <B><FONT COLOR="#0000FF">end</FONT></B> =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#A020F0">val</FONT></B> () = f <B><FONT COLOR="#5F9EA0">13</FONT></B>
+      <B><FONT COLOR="#A020F0">val</FONT></B> () = f <B><FONT COLOR="#5F9EA0">14</FONT></B>
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<p>
+We can do better, and verify that such an <tt>f</tt> can be applied to any integer. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">functor</FONT></B> Ok (<B><FONT COLOR="#A020F0">val</FONT></B> f: ''a -&gt; unit): <B><FONT COLOR="#0000FF">sig</FONT></B> <B><FONT COLOR="#0000FF">end</FONT></B> =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#A020F0">fun</FONT></B> g (x: int) = f x
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<p>
+Even better, we don't need to introduce a dummy function name; we can use a type constraint. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">functor</FONT></B> Ok (<B><FONT COLOR="#A020F0">val</FONT></B> f: ''a -&gt; unit): <B><FONT COLOR="#0000FF">sig</FONT></B> <B><FONT COLOR="#0000FF">end</FONT></B> =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#A020F0">val</FONT></B> _ = f: int -&gt; unit
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<p>
+Even better, we can use a signature constraint. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">functor</FONT></B> Ok (S: <B><FONT COLOR="#0000FF">sig</FONT></B> <B><FONT COLOR="#A020F0">val</FONT></B> f: ''a -&gt; unit <B><FONT COLOR="#0000FF">end</FONT></B>):
+   <B><FONT COLOR="#0000FF">sig</FONT></B> <B><FONT COLOR="#A020F0">val</FONT></B> f: int -&gt; unit <B><FONT COLOR="#0000FF">end</FONT></B> = S
+</PRE>
+<p>
+ 
+</p>
+<p>
+This functor concisely verifies that a function of polymorphic type <tt>''a&nbsp;-&gt;&nbsp;unit</tt> can be safely used as a function of type <tt>int&nbsp;-&gt;&nbsp;unit</tt>. 
+</p>
+<p>
+As above, we can verify that such an <tt>f</tt> can not be used at non equality types. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">functor</FONT></B> Bad (S: <B><FONT COLOR="#0000FF">sig</FONT></B> <B><FONT COLOR="#A020F0">val</FONT></B> f: ''a -&gt; unit <B><FONT COLOR="#0000FF">end</FONT></B>):
+   <B><FONT COLOR="#0000FF">sig</FONT></B> <B><FONT COLOR="#A020F0">val</FONT></B> f: real -&gt; unit <B><FONT COLOR="#0000FF">end</FONT></B> = S
+</PRE>
+<p>
+ 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">functor</FONT></B> Bad (S: <B><FONT COLOR="#0000FF">sig</FONT></B> <B><FONT COLOR="#A020F0">val</FONT></B> f: ''a -&gt; unit <B><FONT COLOR="#0000FF">end</FONT></B>):
+   <B><FONT COLOR="#0000FF">sig</FONT></B> <B><FONT COLOR="#A020F0">val</FONT></B> f: ('a -&gt; 'a) -&gt; unit <B><FONT COLOR="#0000FF">end</FONT></B> = S
+</PRE>
+<p>
+ 
+</p>
+<p>
+For each of these programs, MLton reports the following error. 
+</p>
+
+<pre>Error: z.sml 2.4.
+  Variable type in structure disagrees with signature.
+    variable: f
+    structure: [&lt;equality&gt;] -&gt; _
+    signature: [&lt;non-equality&gt;] -&gt; _
+</pre><h2 id="head-298e9694028673faa9fcbabf774bc23e4d2fbbe0">Equality type variables in type and datatype declarations</h2>
+<p>
+Equality type variables can be used in type and datatype declarations, however they play no special role.  For example, 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> 'a t </FONT></B>=<FONT COLOR="#228B22"><B> 'a * int
+</FONT></B></PRE>
+<p>
+ 
+</p>
+<p>
+is completely identical to 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> ''a t </FONT></B>=<FONT COLOR="#228B22"><B> ''a * int
+</FONT></B></PRE>
+<p>
+ 
+</p>
+<p>
+In particular, such a definition does <em>not</em> require that <tt>t</tt> only be applied to equality types. 
+</p>
+<p>
+Similarly,  
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> 'a t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">A</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">B</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> 'a
+</FONT></B></PRE>
+<p>
+ 
+</p>
+<p>
+is completely identical to 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> ''a t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">A</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">B</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> ''a
+</FONT></B></PRE>
+<p>
+ 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-26 20:35:39 by <span title="cfs36.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Experimental
===================================================================
--- mlton/trunk/doc/guide/Experimental	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Experimental	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,232 @@
+<!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>Experimental - 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">
+
+
+<link rel="Appendix" title="mlton-20050423-1.powerpc-darwin.tgz" href="http://mlton.org/pages/Experimental/attachments/mlton-20050423-1.powerpc-darwin.tgz">
+<link rel="Appendix" title="mlton-20050731-1.i386-freebsd.tgz" href="http://mlton.org/pages/Experimental/attachments/mlton-20050731-1.i386-freebsd.tgz">
+<link rel="Appendix" title="mlton-20050731-1.i386-linux.tgz" href="http://mlton.org/pages/Experimental/attachments/mlton-20050731-1.i386-linux.tgz">
+<link rel="Appendix" title="mlton-20050731-1.i386-netbsd.tgz" href="http://mlton.org/pages/Experimental/attachments/mlton-20050731-1.i386-netbsd.tgz">
+<link rel="Appendix" title="mlton-20050731-1.i386-openbsd.tgz" href="http://mlton.org/pages/Experimental/attachments/mlton-20050731-1.i386-openbsd.tgz">
+<link rel="Appendix" title="mlton-20050731-1.i386.rpm" href="http://mlton.org/pages/Experimental/attachments/mlton-20050731-1.i386.rpm">
+<link rel="Appendix" title="mlton-20050731-1.powerpc-darwin.tgz" href="http://mlton.org/pages/Experimental/attachments/mlton-20050731-1.powerpc-darwin.tgz">
+<link rel="Appendix" title="mlton-20050731-1.sparc-solaris.tgz" href="http://mlton.org/pages/Experimental/attachments/mlton-20050731-1.sparc-solaris.tgz">
+<link rel="Appendix" title="mlton-20050731-1.src.rpm" href="http://mlton.org/pages/Experimental/attachments/mlton-20050731-1.src.rpm">
+<link rel="Appendix" title="mlton-20050731-1.src.tgz" href="http://mlton.org/pages/Experimental/attachments/mlton-20050731-1.src.tgz">
+<link rel="Appendix" title="mlton_20050731-1.diff.gz" href="http://mlton.org/pages/Experimental/attachments/mlton_20050731-1.diff.gz">
+<link rel="Appendix" title="mlton_20050731-1.dsc" href="http://mlton.org/pages/Experimental/attachments/mlton_20050731-1.dsc">
+<link rel="Appendix" title="mlton_20050731-1_i386.changes" href="http://mlton.org/pages/Experimental/attachments/mlton_20050731-1_i386.changes">
+<link rel="Appendix" title="mlton_20050731-1_i386.deb" href="http://mlton.org/pages/Experimental/attachments/mlton_20050731-1_i386.deb">
+<link rel="Appendix" title="mlton_20050731.orig.tar.gz" href="http://mlton.org/pages/Experimental/attachments/mlton_20050731.orig.tar.gz">
+</head>
+
+<body lang="en" dir="ltr">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Experimental
+    <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">
+<p>
+This page is for experimental releases of MLton.  These versions are not as well tested as our <a href="http://mlton.org/Download">public releases</a>, and may not be available for our all our usual platforms. 
+</p>
+<h2 id="head-9fa56f6715598f7143da2e8633da0b6fa4b9cfa7">Changes since the last public release</h2>
+
+    <ul>
+
+    <li>
+<p>
+ Compiler: better exception history 
+</p>
+</li>
+    <li>
+<p>
+ FFI: support for symbols 
+</p>
+</li>
+    <li>
+<p>
+ Libraries: <tt>Int1</tt>, <tt>MLton.CallStack</tt>,  <tt>MLton.Process.create</tt>, <tt>Word1</tt> 
+</p>
+</li>
+    <li>
+<p>
+ MLBs: <tt>warnExnMatch</tt> annotation 
+</p>
+</li>
+    <li>
+<p>
+ Profiling: better inclusion/exclusion of code 
+</p>
+</li>
+    <li>
+<p>
+ Tools: updates of mllex and mlyacc from SML/NJ 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-7c89f2526abeecbdfccbe96f59bbda5ed46c9792">20050731 binary packages</h2>
+
+    <ul>
+
+    <li>
+<p>
+ x86  
+</p>
+</li>
+
+        <ul>
+
+        <li>
+<p>
+ <a href="http://mlton.org/pages/Experimental/attachments/mlton-20050731-1.i386-freebsd.tgz">FreeBSD</a> 5.4 
+</p>
+</li>
+        <li>
+<p>
+ Linux 
+</p>
+</li>
+
+            <ul>
+
+            <li>
+<p>
+ <a href="http://mlton.org/pages/Experimental/attachments/mlton_20050731-1_i386.deb">Debian</a> testing 
+</p>
+</li>
+            <li>
+<p>
+ <a href="http://mlton.org/pages/Experimental/attachments/mlton-20050731-1.i386.rpm">RedHat</a> 7.1 
+</p>
+</li>
+            <li>
+<p>
+ <a href="http://mlton.org/pages/Experimental/attachments/mlton-20050731-1.i386-linux.tgz">tgz</a> for other distributions (glibc 2.3) 
+</p>
+</li>
+
+            </ul>
+
+
+        <li>
+<p>
+ <a href="http://mlton.org/pages/Experimental/attachments/mlton-20050731-1.i386-netbsd.tgz">NetBSD</a> 2.0.2 
+</p>
+</li>
+        <li>
+<p>
+ <a href="http://mlton.org/pages/Experimental/attachments/mlton-20050731-1.i386-openbsd.tgz">OpenBSD</a> 3.7 
+</p>
+</li>
+
+        </ul>
+
+
+    <li>
+<p>
+ PowerPC 
+</p>
+</li>
+
+        <ul>
+
+        <li>
+<p>
+ <a href="http://mlton.org/pages/Experimental/attachments/mlton-20050731-1.powerpc-darwin.tgz">Darwin</a> 7.0.0 (Mac OS X) 
+</p>
+</li>
+
+        </ul>
+
+
+    <li>
+<p>
+ Sparc 
+</p>
+</li>
+
+        <ul>
+
+        <li>
+<p>
+ <a href="http://mlton.org/pages/Experimental/attachments/mlton-20050731-1.sparc-solaris.tgz">Solaris</a> 8 
+</p>
+</li>
+
+        </ul>
+
+
+
+    </ul>
+
+
+<h2 id="head-16f82c0e297670ffc3ac6a9317e938c9cf0d178c">20050731 sources</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="http://mlton.org/pages/Experimental/attachments/mlton-20050731-1.src.tgz">source tgz</a> 
+</p>
+</li>
+    <li>
+<p>
+ Debian <a href="http://mlton.org/pages/Experimental/attachments/mlton_20050731-1.dsc">dsc</a>,   <a href="http://mlton.org/pages/Experimental/attachments/mlton_20050731-1.diff.gz">diff.gz</a>,  <a href="http://mlton.org/pages/Experimental/attachments/mlton_20050731.orig.tar.gz">orig.tar.gz</a> 
+</p>
+</li>
+    <li>
+<p>
+ R<strong></strong>edHat <a href="http://mlton.org/pages/Experimental/attachments/mlton-20050731-1.src.rpm">source rpm</a> 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-02 01:10:29 by <span title="adsl-66-126-175-21.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/FAQ
===================================================================
--- mlton/trunk/doc/guide/FAQ	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/FAQ	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,117 @@
+<!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>FAQ - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      FAQ
+    <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">
+Feel free to ask questions and to update answers by editing this page. Since we try to make as much information as possible available on the web site and we like to avoid duplication, many of the answers are simply links to a web page that answers the question. <h2 id="head-f1f9f5685d23c3281c96d9b8044327fd6383b108">How do you pronounce MLton?</h2>
+<p>
+<a href="Pronounce">Pronounce</a> 
+</p>
+<h2 id="head-8c50d4cab025df11817ce02ce31ce79b55fe5022">What SML software has been ported to MLton?</h2>
+<p>
+<a href="Libraries">Libraries</a> 
+</p>
+<h2 id="head-8bae3f9634b3c37ee10469682a818270ecc93448">What graphical libraries are available for MLton?</h2>
+<p>
+<a href="Libraries">Libraries</a> 
+</p>
+<h2 id="head-8f8a8041340f3d4c8225acd898598cb5e53bd91a">How does MLton's performance compare to other SML compilers and to other languages?</h2>
+<p>
+MLton has <a href="Performance">excellent performance</a>. 
+</p>
+<h2 id="head-192264d667fe968b31a7cb67efc7f5b812d9b2c3">Does MLton treat monomorphic arrays and vectors specially?</h2>
+<p>
+MLton implements monomorphic arrays and vectors (e.g. <tt>BoolArray</tt>, <tt>Word8Vector</tt>) exactly as instantiations of their polymorphic counterpart (e.g. <tt>bool&nbsp;array</tt>, <tt>Word8.word&nbsp;vector</tt>).  Thus, there is no need to use the monomorphic versions except when required to interface with the <a href="BasisLibrary"> SML Basis Library</a> or for portability with other SML implementations. 
+</p>
+<h2 id="head-a853893393a762751e90db219072e6a768c91f39">Why do I get a Segfault/Bus error in a program that uses IntInf/LargeInt to calculate numbers with several hundred thousand digits?</h2>
+<p>
+<a href="GnuMP">GnuMP</a> 
+</p>
+<h2 id="head-3f3ea5484de0f96d0f22bda712ddd1e71bd62faf">How can I decrease compile-time memory usage?</h2>
+
+    <ul>
+
+    <li>
+<p>
+ Compile with <tt>-verbose&nbsp;3</tt> to find out if the problem is due to  an SSA optimization pass.  If so, compile with <tt>-drop-pass&nbsp;</tt><em>pass</em>  to skip that pass. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ Compile with <tt>@MLton&nbsp;hash-cons&nbsp;0.5&nbsp;--</tt>, which will instruct the  runtime to hash cons the heap every other GC.  
+</p>
+</li>
+    <li class="gap">
+<p>
+ Compile with <tt>-polyvariance&nbsp;false</tt>, which is an undocumented  option that causes less code duplication. 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+Also, please <a href="Contact">Contact</a> us to let us know the problem to help us better understand MLton's limitations. 
+</p>
+<h2 id="head-5da60bc9034a764c34c1be37aa3017ce70bc131e">How do I see what has changed recently in the wiki?</h2>
+<p>
+<a href="http://mlton.org/RecentChanges">RecentChanges</a> 
+</p>
+<h2 id="head-756d1bccf1783a78c8c7af9ff6aadb9dee01b567">How portable is SML code across SML compilers?</h2>
+<p>
+<a href="StandardMLPortability">StandardMLPortability</a> 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-04-25 19:36:00 by <span title="adsl-63-195-184-50.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Features
===================================================================
--- mlton/trunk/doc/guide/Features	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Features	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,415 @@
+<!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>Features - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Features
+    <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">
+MLton has the following features. <h2 id="head-b307b88c84327b1804aee227595be53342245965">Portability</h2>
+
+    <ul>
+
+    <li>
+<p>
+ Runs on a variety of platforms. 
+</p>
+</li>
+
+        <ul>
+
+        <li>
+<p>
+ PowerPC: Darwin (Mac OSX) 
+</p>
+</li>
+        <li class="gap">
+<p>
+ X86: Linux, <a class="external" href="http://www.cygwin.com"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Cygwin</a>/Windows,   <a class="external" href="http://www.freebsd.org"><img src="moin-www.png" alt="[WWW]" height="11" width="11">FreeBSD</a>, <a class="external" href="http://www.netbsd.org"><img src="moin-www.png" alt="[WWW]" height="11" width="11">NetBSD</a>,   <a class="external" href="http://www.openbsd.org"><img src="moin-www.png" alt="[WWW]" height="11" width="11">OpenBSD</a>. 
+</p>
+</li>
+        <li class="gap">
+<p>
+ Sparc: Solaris. 
+</p>
+</li>
+
+        </ul>
+
+
+
+    </ul>
+
+
+<h2 id="head-8aa709faedc93ee0f2dd837347b1b6c2880d34d1">Robustness</h2>
+
+    <ul>
+
+    <li>
+<p>
+ Supports the full SML 97 language as given in <a href="DefinitionOfStandardML"> The Definition of Standard ML (Revised)</a>.  
+</p>
+</li>
+
+        <ul>
+
+  If there is a program that is valid according to The Definition that   is rejected by MLton, or a program that is invalid according to the   Definition that is accepted by MLton, it is a bug.  For a list of   known bugs, see <a href="UnresolvedBugs">UnresolvedBugs</a>. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ A complete implementation of the <a href="BasisLibrary"> SML Basis Library</a>. 
+</p>
+</li>
+
+        <ul>
+
+  MLton's implementation matches latest Basis Library specification,   and includes a complete implementation of all the required modules,   as well as many of the optional modules. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ Generates standalone executables. 
+</p>
+</li>
+
+        <ul>
+
+  No additional code or libraries are necessary in order to run an   executable, except for the standard shared libraries.  MLton can   also generate statically linked executables. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ Compiles large programs. 
+</p>
+</li>
+
+        <ul>
+
+  MLton is sufficiently efficient and robust that it can compile large   programs, including itself (over 140K lines).  The distributed   version of MLton was compiled by MLton. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ Support for large amounts of memory (up to 4G). 
+</p>
+</li>
+    <li class="gap">
+<p>
+ Array lengths up to 2<sup>31</sup> - 1, the largest possible twos-complement 32 bit integer.  
+</p>
+</li>
+    <li class="gap">
+<p>
+ Support for large files, using 64-bit file positions. 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-63c904559993935c470f516c8b549ca7f3640dbb">Performance</h2>
+
+    <ul>
+
+    <li>
+<p>
+ Executables have <a href="Performance">excellent running times</a>. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ Generates small executables. 
+</p>
+</li>
+
+        <ul>
+
+  MLton takes advantage of whole-program compilation to perform very   aggressive dead-code elimination, which often leads to smaller   executables than with other SML compilers. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ Native integers, reals, and words. 
+</p>
+</li>
+
+        <ul>
+
+  In MLton, integers and words are 32 bits and arithmetic does not   have any overhead due to tagging or boxing.  Also, reals are stored   unboxed, avoiding any overhead due to boxing. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ Unboxed native arrays. 
+</p>
+</li>
+
+        <ul>
+
+  In MLton, an array (or vector) of integers, reals, or words uses the   natural C-like representation.  This is fast and supports easy   exchange of data with C.  Monomorphic arrays (and vectors) use the   same C-like representations as their polymorphic counterparts. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ Multiple <a href="GarbageCollection">garbage collection</a> strategies. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ Fast arbitrary precision arithmetic (<tt>IntInf</tt>) based on the  <a href="GnuMP">GnuMP</a>.  For <tt>IntInf</tt> intensive programs, MLton can be an order of  magnitude or more faster than Poly/ML or SML/NJ.   
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-4fa8cc860c52b268dc6a3adcde7305e9415db5bb">Tools</h2>
+
+    <ul>
+
+    <li>
+<p>
+ Source-level <a href="Profiling">Profiling</a> of both time and allocation. 
+</p>
+</li>
+    <li>
+<p>
+ <a class="nonexistent" href="MLLex">MLLex</a> lexer generator 
+</p>
+</li>
+    <li>
+<p>
+ <a class="nonexistent" href="MLYacc">MLYacc</a> parser generator 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-656bcfe284e2da39c77d4fdab55b16ad3c654719">Extensions</h2>
+
+    <ul>
+
+    <li>
+<p>
+ A simple and fast C <a href="ForeignFunctionInterface">ForeignFunctionInterface</a> that supports calling  from SML to C and from C to SML.  
+</p>
+</li>
+    <li class="gap">
+<p>
+ The <a href="MLBasis">ML Basis system</a> for programming in the very large, separate delivery of library sources, and more. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ A number of extension libraries that provide useful functionality that cannot be implemented with the <a href="BasisLibrary"> SML Basis Library</a>.  See below for an overview and <a href="MLtonStructure">MLtonStructure</a> for details. 
+</p>
+</li>
+
+        <ul>
+
+        <li>
+<p>
+ continuations 
+</p>
+</li>
+
+            <ul>
+
+   MLton supports continuations via <tt>callcc</tt> and <tt>throw</tt>. 
+            </ul>
+
+
+        <li class="gap">
+<p>
+ finalization 
+</p>
+</li>
+
+            <ul>
+
+   MLton supports finalizable values of arbitrary type. 
+            </ul>
+
+
+        <li class="gap">
+<p>
+ interval timers 
+</p>
+</li>
+
+            <ul>
+
+   MLton supports the functionality of the C <tt>setitimer</tt> function. 
+            </ul>
+
+
+        <li class="gap">
+<p>
+ random numbers 
+</p>
+</li>
+
+            <ul>
+
+   MLton has functions similar to the C <tt>rand</tt> and <tt>srand</tt> functions, as well as support for access to <tt>/dev/random</tt> and <tt>/dev/urandom</tt>.  
+            </ul>
+
+
+        <li class="gap">
+<p>
+ resource limits 
+</p>
+</li>
+
+            <ul>
+
+   MLton has functions similar to the C <tt>getrlimit</tt> and <tt>setrlimit</tt> functions. 
+            </ul>
+
+
+        <li class="gap">
+<p>
+ resource usage 
+</p>
+</li>
+
+            <ul>
+
+   MLton supports a subset of the functionality of the C <tt>getrusage</tt> function. 
+            </ul>
+
+
+        <li class="gap">
+<p>
+ signal handlers 
+</p>
+</li>
+
+            <ul>
+
+   MLton supports signal handlers written in SML.  Signal handlers run    in a separate MLton thread, and have access to the thread that was    interrupted by the signal.  Signal handlers can be used in    conjunction with threads to implement preemptive multitasking. 
+            </ul>
+
+
+        <li class="gap">
+<p>
+ size primitive 
+</p>
+</li>
+
+            <ul>
+
+   MLton includes a primitive that returns the size (in bytes) of any object.  This can be useful in understanding the space behavior of a program. 
+            </ul>
+
+
+        <li class="gap">
+<p>
+ system logging 
+</p>
+</li>
+
+            <ul>
+
+   MLton has a complete interface to the C <tt>syslog</tt> function. 
+            </ul>
+
+
+        <li class="gap">
+<p>
+ threads 
+</p>
+</li>
+
+            <ul>
+
+   MLton has support for its own threads, upon which either preemptive or non-preemptive multitasking can be implemented.  MLton also has support for <a href="ConcurrentML">Concurrent ML</a> (CML).  
+            </ul>
+
+
+        <li class="gap">
+<p>
+ weak pointers 
+</p>
+</li>
+
+            <ul>
+
+   MLton supports weak pointers, which allow the garbage collector to    reclaim objects that it would otherwise be forced to keep.  Weak    pointers are also used to provide finalization.  
+            </ul>
+
+
+        <li class="gap">
+<p>
+ world save and restore 
+</p>
+</li>
+
+            <ul>
+
+   MLton has a facility for saving the entire state of a computation to a file and restarting it later.  This facility can be used for staging and for checkpointing computations.  It can even be used from within signal handlers, allowing interrupt driven checkpointing. </ul>
+
+</ul>
+
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-28 21:50:46 by <span title="cfs36.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/FirstClassPolymorphism
===================================================================
--- mlton/trunk/doc/guide/FirstClassPolymorphism	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/FirstClassPolymorphism	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,154 @@
+<!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>FirstClassPolymorphism - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      FirstClassPolymorphism
+    <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">
+First-class polymorphism means the ability to treat polymorphic functions as other values: pass them as arguments, store them in data structures, etc.  Although <a href="StandardML">Standard ML</a> does have polymorphic functions, it does not support first-class polymorphism. <p>
+For example, the following declares and uses the polymorphic function <tt>id</tt>. 
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> id = <B><FONT COLOR="#A020F0">fn</FONT></B> x =&gt; x
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = id <B><FONT COLOR="#5F9EA0">13</FONT></B>
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = id <FONT COLOR="#BC8F8F"><B>&quot;foo&quot;</FONT></B>
+</PRE>
+ 
+</p>
+<p>
+If SML supported first-class polymorphism, we could write the following. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">fun</FONT></B> useId id = (id <B><FONT COLOR="#5F9EA0">13</FONT></B>; id <FONT COLOR="#BC8F8F"><B>&quot;foo&quot;</FONT></B>)
+</PRE>
+<p>
+ 
+</p>
+<p>
+However, this does not type check.  MLton reports the following error. 
+</p>
+
+<pre>Error: z.sml 1.24.
+  Function applied to incorrect argument.
+    expects: [int]
+    but got: [string]
+    in: id "foo"
+</pre><p>
+The error message arises because MLton infers from <tt>id&nbsp;13</tt> that <tt>id</tt> accepts an integer argument, but that <tt>id&nbsp;"foo"</tt> is passing a string.  Using explicit types sheds some light on the problem. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">fun</FONT></B> useId (id: 'a -&gt; 'a) = (id <B><FONT COLOR="#5F9EA0">13</FONT></B>; id <FONT COLOR="#BC8F8F"><B>&quot;foo&quot;</FONT></B>)
+</PRE>
+<p>
+ 
+</p>
+<p>
+On this, MLton reports the following errors. 
+</p>
+
+<pre>Error: z.sml 1.29.
+  Function applied to incorrect argument.
+    expects: ['a]
+    but got: [int]
+    in: id 13
+Error: z.sml 1.36.
+  Function applied to incorrect argument.
+    expects: ['a]
+    but got: [string]
+    in: id "foo"
+</pre><p>
+The errors arise because the argument <tt>id</tt> is <em>not</em> polymorphic; rather, it is monomorphic, with type <tt>'a&nbsp;-&gt;&nbsp;'a</tt>.  It is perfectly valid to apply <tt>id</tt> to a value of type <tt>'a</tt>, as in the following 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">fun</FONT></B> useId (id: 'a -&gt; 'a, x: 'a) = id x  <I><FONT COLOR="#B22222">(* type correct *)</FONT></I>
+</PRE>
+<p>
+ 
+</p>
+<p>
+So, what is the difference between the type specification on <tt>id</tt> in the following two declarations? 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> id: 'a -&gt; 'a = <B><FONT COLOR="#A020F0">fn</FONT></B> x =&gt; x
+<B><FONT COLOR="#A020F0">fun</FONT></B> useId (id: 'a -&gt; 'a) = (id <B><FONT COLOR="#5F9EA0">13</FONT></B>; id <FONT COLOR="#BC8F8F"><B>&quot;foo&quot;</FONT></B>)
+</PRE>
+<p>
+ 
+</p>
+<p>
+While the type specifications on <tt>id</tt> look identical, they mean different things.  The difference can be made clearer by explicitly <a href="TypeVariableScope">scoping the type variables</a>. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> <FONT COLOR="#228B22"><B>'a</FONT></B> id: 'a -&gt; 'a = <B><FONT COLOR="#A020F0">fn</FONT></B> x =&gt; x
+<B><FONT COLOR="#A020F0">fun</FONT></B> <FONT COLOR="#228B22"><B>'a</FONT></B> useId (id: 'a -&gt; 'a) = (id <B><FONT COLOR="#5F9EA0">13</FONT></B>; id <FONT COLOR="#BC8F8F"><B>&quot;foo&quot;</FONT></B>)  <I><FONT COLOR="#B22222">(* type error *)</FONT></I>
+</PRE>
+<p>
+ 
+</p>
+<p>
+In <tt>val&nbsp;'a&nbsp;id</tt>, the type variable scoping means that for any <tt>'a</tt>, <tt>id</tt> has type <tt>'a&nbsp;-&gt;&nbsp;'a</tt>.  Hence, <tt>id</tt> can be applied to arguments of type <tt>int</tt>, <tt>real</tt>, etc.  Similarly, in <tt>fun&nbsp;'a&nbsp;useId</tt>, the scoping means that <tt>useId</tt> is a polymorphic function that for any <tt>'a</tt> takes a function of type <tt>'a&nbsp;-&gt;&nbsp;'a</tt> and does something.  Thus, <tt>useId</tt> could be applied to a function of type <tt>int&nbsp;-&gt;&nbsp;int</tt>, <tt>real&nbsp;-&gt;&nbsp;real</tt>, etc. 
+</p>
+<p>
+One could imagine an extension of SML that allowed scoping of type variables at places other than <tt>fun</tt> or <tt>val</tt> declarations, as in the following. 
+</p>
+
+<pre>fun useId (id: ('a).'a -&gt; 'a) = (id 13; id "foo")  (* not SML *)
+</pre><p>
+Such an extension would need to be thought through very carefully, as it could cause significant complications with <a class="nonexistent" href="TypeInference">TypeInference</a>, possible even undecidability. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-26 20:35:11 by <span title="cfs36.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Flatten
===================================================================
--- mlton/trunk/doc/guide/Flatten	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Flatten	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,117 @@
+<!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>Flatten - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Flatten
+    <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">
+<p>
+An optimization pass for the <a href="SSA">SSA</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="SSASimplify">SSASimplify</a>. 
+</p>
+<h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Flatten arguments to <a href="SSA">SSA</a> constructors, blocks, and functions. 
+</p>
+<p>
+If a tuple is explicitly available at all uses of a function (resp. block), then  
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ The formals and call sites are changed so that the components of the tuple are passed. 
+</p>
+</li>
+    <li>
+<p>
+ The tuple is reconstructed at the beginning of the body of the function (resp. block). 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+Similarly, if a tuple is explicitly available at all uses of a constructor, 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ The constructor argument datatype is changed to flatten the tuple type. 
+</p>
+</li>
+    <li>
+<p>
+ The tuple is passed flat at each <tt>ConApp</tt>. 
+</p>
+</li>
+    <li>
+<p>
+ The tuple is reconstructed at each <tt>Case</tt> transfer target. 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/flatten.sig?view=markup">flatten.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/flatten.fun?view=markup">flatten.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:38:29 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/ForLoops
===================================================================
--- mlton/trunk/doc/guide/ForLoops	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/ForLoops	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,261 @@
+<!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>ForLoops - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      ForLoops
+    <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">
+A <tt>for</tt>-loop is typically used to iterate over a range of consecutive integers that denote indices of some sort. For example, in <a href="OCaml">OCaml</a> a <tt>for</tt>-loop takes either the form 
+<pre>for &lt;name&gt; = &lt;lower&gt; to &lt;upper&gt; do &lt;body&gt; done
+</pre>or the form 
+<pre>for &lt;name&gt; = &lt;upper&gt; downto &lt;lower&gt; do &lt;body&gt; done
+</pre>Some languages provide considerably more flexible <tt>for</tt>-loop or <tt>foreach</tt>-constructs. <p>
+A bit suprisingly, <a href="StandardML">Standard ML</a> provides special syntax for <tt>while</tt>-loops, but not for <tt>for</tt>-loops. Indeed, in SML, many uses of <tt>for</tt>-loops are better expressed using <tt>app</tt>, <tt>foldl/foldr</tt>, <tt>map</tt> and many other higher-order functions provided by the <a href="BasisLibrary">Basis Library</a> for manipulating lists, vectors and arrays. However, the Basis Library does not provide a function for iterating over a range of integer values. Fortunately, it is very easy to write one. 
+</p>
+<h2 id="head-256b31fc11b749803c8295d4ec8da28712f04f19">A fairly simple design</h2>
+<p>
+The following implementation imitates both the syntax and semantics of the OCaml <tt>for</tt>-loop. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> for </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">to</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> int * int
+             </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">downto</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> int * int
+
+</FONT></B><B><FONT COLOR="#A020F0">infix</FONT></B> to downto
+
+<B><FONT COLOR="#A020F0">val</FONT></B> for =
+    <B><FONT COLOR="#A020F0">fn</FONT></B> lo to up =&gt;
+       (<B><FONT COLOR="#A020F0">fn</FONT></B> f =&gt; <B><FONT COLOR="#0000FF">let</FONT></B> <B><FONT COLOR="#A020F0">fun</FONT></B> loop lo = <B><FONT COLOR="#A020F0">if</FONT></B> lo &gt; up <B><FONT COLOR="#A020F0">then</FONT></B> ()
+                                  <B><FONT COLOR="#A020F0">else</FONT></B> (f lo; loop (lo+<B><FONT COLOR="#5F9EA0">1</FONT></B>))
+                <B><FONT COLOR="#0000FF">in</FONT></B> loop lo <B><FONT COLOR="#0000FF">end</FONT></B>)
+     | up downto lo =&gt;
+       (<B><FONT COLOR="#A020F0">fn</FONT></B> f =&gt; <B><FONT COLOR="#0000FF">let</FONT></B> <B><FONT COLOR="#A020F0">fun</FONT></B> loop up = <B><FONT COLOR="#A020F0">if</FONT></B> up &lt; lo <B><FONT COLOR="#A020F0">then</FONT></B> ()
+                                  <B><FONT COLOR="#A020F0">else</FONT></B> (f up; loop (up-<B><FONT COLOR="#5F9EA0">1</FONT></B>))
+                <B><FONT COLOR="#0000FF">in</FONT></B> loop up <B><FONT COLOR="#0000FF">end</FONT></B>)
+</PRE>
+<p>
+ 
+</p>
+<p>
+For example, 
+<pre class=code>
+for (<B><FONT COLOR="#5F9EA0">1</FONT></B> to <B><FONT COLOR="#5F9EA0">9</FONT></B>)
+    (<B><FONT COLOR="#A020F0">fn</FONT></B> i =&gt; print (Int.toString i))
+</PRE>
+ would print <tt>123456789</tt> and 
+<pre class=code>
+for (<B><FONT COLOR="#5F9EA0">9</FONT></B> downto <B><FONT COLOR="#5F9EA0">1</FONT></B>)
+    (<B><FONT COLOR="#A020F0">fn</FONT></B> i =&gt; print (Int.toString i))
+</PRE>
+ would print <tt>987654321</tt>. 
+</p>
+<p>
+Straightforward formatting of nested loops 
+<pre class=code>
+for (a to b)
+    (<B><FONT COLOR="#A020F0">fn</FONT></B> i =&gt;
+        for (c to d)
+            (<B><FONT COLOR="#A020F0">fn</FONT></B> j =&gt;
+                ...))
+</PRE>
+ is fairly readable, but tends to cause the body of the loop to be indented quite deeply. 
+</p>
+<h2 id="head-db5cb13e652c830a05ed522c82b38855adf3f29d">Off-by-one</h2>
+<p>
+The above design has an annoying feature. In practice, the upper bound of the iterated range is almost always excluded and most loops would subtract one from the upper bound: 
+<pre class=code>
+for (<B><FONT COLOR="#5F9EA0">0</FONT></B> to n-<B><FONT COLOR="#5F9EA0">1</FONT></B>) ...
+for (n-<B><FONT COLOR="#5F9EA0">1</FONT></B> downto <B><FONT COLOR="#5F9EA0">0</FONT></B>) ...
+</PRE>
+ It is probably better to break convention and exclude the upper bound by default, because it leads to more concise code and becomes idiomatic with very little practise. The iterator combinators described below exclude the upper bound by default. 
+</p>
+<h2 id="head-a43056e62b4e6692169c07351860dd6bb04042d0">Iterator combinators</h2>
+<p>
+While the simple <tt>for</tt>-function described in the previous section is probably good enough for many uses, it is a bit cumbersome when one needs to iterate over a cartesian product. One might also want to iterate over more than just consecutive integers. It turns out that one can provide a library of iterator combinators that allow one to implement iterators more flexibly. 
+</p>
+<p>
+Since the types of the combinators may be a bit difficult to infer from their implementations, let's first take a look at a signature of the iterator combinator library: 
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> ITER =
+  <B><FONT COLOR="#0000FF">sig</FONT></B>
+    <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> 'a iter </FONT></B>=<FONT COLOR="#228B22"><B> ('a -&gt; unit) -&gt; unit
+
+    </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> to : int * int -&gt; int iter
+    <B><FONT COLOR="#A020F0">val</FONT></B> downto : int * int -&gt; int iter
+
+    <B><FONT COLOR="#A020F0">val</FONT></B> inList : 'a list -&gt; 'a iter
+    <B><FONT COLOR="#A020F0">val</FONT></B> inVector : 'a Vector.vector -&gt; 'a iter
+    <B><FONT COLOR="#A020F0">val</FONT></B> inArray : 'a Array.array -&gt; 'a iter
+
+    <B><FONT COLOR="#A020F0">val</FONT></B> using : ('a -&gt; ('b * 'a) option) -&gt; 'a -&gt; 'b iter
+
+    <B><FONT COLOR="#A020F0">val</FONT></B> when : 'a iter * ('a -&gt; bool) -&gt; 'a iter
+    <B><FONT COLOR="#A020F0">val</FONT></B> by : 'a iter * ('a -&gt; 'b) -&gt; 'b iter
+
+    <B><FONT COLOR="#A020F0">val</FONT></B> &amp;&amp; : 'a iter * 'b iter -&gt; ('a, 'b) product iter
+
+    <B><FONT COLOR="#A020F0">val</FONT></B> for : 'a -&gt; 'a
+  <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+ Some of the above combinators are meant to be used as infix operators. Here is a set of suitable infix declarations: 
+<pre class=code>
+<B><FONT COLOR="#A020F0">infix</FONT></B> 2 to downto
+<B><FONT COLOR="#A020F0">infix</FONT></B> 1 when by
+<B><FONT COLOR="#A020F0">infix</FONT></B> 0 &amp;&amp;
+</PRE>
+ 
+</p>
+<p>
+A few notes are in order: 
+</p>
+
+        <ul>
+
+        <li>
+<p>
+ The following implementation of <tt>to</tt> and <tt>downto</tt> will omit   the upper bound of the range. 
+</p>
+</li>
+        <li>
+<p>
+ <tt>for</tt> is the identity function. It is purely for syntactic sugar   and is not strictly required. 
+</p>
+</li>
+        <li>
+<p>
+ Probably the most interesting combinator is <tt>&amp;&amp;</tt>. Given two   iterators, it produces an iterator for the cartesian product of the   iterators. 
+</p>
+</li>
+
+                <ul>
+
+                <li>
+<p>
+ See <a href="ProductType">ProductType</a> for the type function <tt>('a,&nbsp;'b)&nbsp;product</tt> used in     the type of the iterator produced by <tt>&amp;&amp;</tt>. 
+</p>
+</li>
+
+                </ul>
+
+
+        <li>
+<p>
+ The <tt>using</tt> combinator allows one to iterate over slices, streams   and many other kinds of sequences. 
+</p>
+</li>
+        <li>
+<p>
+ <tt>when</tt> is the filtering combinator. The name <tt>when</tt> is   inspired by <a href="OCaml">OCaml</a>'s guard clauses. 
+</p>
+</li>
+        <li>
+<p>
+ <tt>by</tt> is the mapping combinator. 
+</p>
+</li>
+
+        </ul>
+
+
+<p>
+Here is a structure implementing the <tt>ITER</tt> signature: 
+<pre class=code>
+<B><FONT COLOR="#0000FF">structure</FONT></B> Iter :&gt; ITER =
+  <B><FONT COLOR="#0000FF">struct</FONT></B>
+    <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> 'a iter </FONT></B>=<FONT COLOR="#228B22"><B> ('a -&gt; unit) -&gt; unit
+
+    </FONT></B><B><FONT COLOR="#A020F0">fun</FONT></B> <B><FONT COLOR="#A020F0">op</FONT></B> to (a, b) f =
+        <B><FONT COLOR="#A020F0">let</FONT></B> <B><FONT COLOR="#A020F0">fun</FONT></B> loop a = <B><FONT COLOR="#A020F0">if</FONT></B> a &lt; b <B><FONT COLOR="#A020F0">then</FONT></B> (f a; loop (a+<B><FONT COLOR="#5F9EA0">1</FONT></B>)) <B><FONT COLOR="#A020F0">else</FONT></B> ()
+        <B><FONT COLOR="#A020F0">in</FONT></B> loop a <B><FONT COLOR="#A020F0">end</FONT></B>
+    <B><FONT COLOR="#A020F0">fun</FONT></B> <B><FONT COLOR="#A020F0">op</FONT></B> downto (a, b) f =
+        <B><FONT COLOR="#A020F0">let</FONT></B> <B><FONT COLOR="#A020F0">fun</FONT></B> loop a = <B><FONT COLOR="#A020F0">if</FONT></B> a &gt; b <B><FONT COLOR="#A020F0">then</FONT></B> (<B><FONT COLOR="#A020F0">fn</FONT></B> a =&gt; (f a; loop a)) (a-<B><FONT COLOR="#5F9EA0">1</FONT></B>) <B><FONT COLOR="#A020F0">else</FONT></B> ()
+        <B><FONT COLOR="#A020F0">in</FONT></B> loop a <B><FONT COLOR="#A020F0">end</FONT></B>
+
+    <B><FONT COLOR="#A020F0">fun</FONT></B> inList l f = List.app f l
+    <B><FONT COLOR="#A020F0">fun</FONT></B> inVector v f = Vector.app f v
+    <B><FONT COLOR="#A020F0">fun</FONT></B> inArray a f = Array.app f a
+
+    <B><FONT COLOR="#A020F0">fun</FONT></B> using get s f =
+        <B><FONT COLOR="#A020F0">let</FONT></B> <B><FONT COLOR="#A020F0">fun</FONT></B> loop s = <B><FONT COLOR="#A020F0">case</FONT></B> get s
+                          <B><FONT COLOR="#A020F0">of</FONT></B> SOME (x, s) =&gt; (f x; loop s)
+                           | NONE =&gt; ()
+        <B><FONT COLOR="#A020F0">in</FONT></B> loop s <B><FONT COLOR="#A020F0">end</FONT></B>
+
+    <B><FONT COLOR="#A020F0">fun</FONT></B> <B><FONT COLOR="#A020F0">op</FONT></B> when (a, p) f = a (<B><FONT COLOR="#A020F0">fn</FONT></B> a =&gt; <B><FONT COLOR="#A020F0">if</FONT></B> p a <B><FONT COLOR="#A020F0">then</FONT></B> f a <B><FONT COLOR="#A020F0">else</FONT></B> ())
+    <B><FONT COLOR="#A020F0">fun</FONT></B> <B><FONT COLOR="#A020F0">op</FONT></B> by (a, g) f = a (f o g)
+
+    <B><FONT COLOR="#A020F0">fun</FONT></B> <B><FONT COLOR="#A020F0">op</FONT></B> &amp;&amp; (a, b) f = a (<B><FONT COLOR="#A020F0">fn</FONT></B> a =&gt; b (<B><FONT COLOR="#A020F0">fn</FONT></B> b =&gt; f (<B><FONT COLOR="#A020F0">op</FONT></B>&amp; (a, b))))
+
+    <B><FONT COLOR="#A020F0">val</FONT></B> for = <B><FONT COLOR="#A020F0">fn</FONT></B> x =&gt; x
+  <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+ 
+</p>
+<p>
+To use the above combinators the <tt>Iter</tt>-structure needs to be opened 
+<pre class=code>
+<B><FONT COLOR="#0000FF">open</FONT></B> Iter
+</PRE>
+ and one usually also wants to declare the infix status of the operators as shown earlier. 
+</p>
+<p>
+Here is an example that illustrates most of the features: 
+<pre class=code>
+for (<B><FONT COLOR="#5F9EA0">0</FONT></B> to <B><FONT COLOR="#5F9EA0">10</FONT></B> when (<B><FONT COLOR="#A020F0">fn</FONT></B> x =&gt; x mod <B><FONT COLOR="#5F9EA0">3</FONT></B> &lt;&gt; <B><FONT COLOR="#5F9EA0">0</FONT></B>) &amp;&amp; inList [<FONT COLOR="#BC8F8F"><B>&quot;a&quot;</FONT></B>, <FONT COLOR="#BC8F8F"><B>&quot;b&quot;</FONT></B>] &amp;&amp; <B><FONT COLOR="#5F9EA0">2</FONT></B> downto <B><FONT COLOR="#5F9EA0">1</FONT></B> by real)
+    (<B><FONT COLOR="#A020F0">fn</FONT></B> x &amp; y &amp; z =&gt;
+       print (<FONT COLOR="#BC8F8F"><B>&quot;(&quot;</FONT></B>^Int.toString x^<FONT COLOR="#BC8F8F"><B>&quot;, \&quot;&quot;</FONT></B>^y^<FONT COLOR="#BC8F8F"><B>&quot;\&quot;, &quot;</FONT></B>^Real.toString z^<FONT COLOR="#BC8F8F"><B>&quot;)\n&quot;</FONT></B>))
+</PRE>
+ 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-06-16 13:33:41 by <span title="cs78147115.pp.htv.fi"><a href="VesaKarvonen">VesaKarvonen</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/ForeignFunctionInterface
===================================================================
--- mlton/trunk/doc/guide/ForeignFunctionInterface	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/ForeignFunctionInterface	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,106 @@
+<!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>ForeignFunctionInterface - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      ForeignFunctionInterface
+    <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">
+MLton's foreign function interface (FFI) extends Standard ML and makes it easy to take the address of C global ojects, access C global variables, call from SML to C, and call from C to SML. <h2 id="head-0efc2e6be4c23b9a513d7ce0dcff8ed80e8912e7">Overview</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="ForeignFunctionInterfaceTypes">Foreign Function Interface Types</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="ForeignFunctionInterfaceSyntax">Foreign Function Interface Syntax</a> 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-b28d5f611807683a67d017b7798986eb5403f220">Importing Code into SML</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="CallingFromSMLToC">Calling From SML To C</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="CallingFromSMLToCFunctionPointer">Calling From SML To C Function Pointer</a> 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-2a9e78530f1ebcb99884b3be9e720ff24a091176">Exporting Code from SML</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="CallingFromCToSML">Calling From C To SML</a> 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-07 21:37:01 by <span title="pool-71-243-10-187.bos.east.verizon.net"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/ForeignFunctionInterfaceSyntax
===================================================================
--- mlton/trunk/doc/guide/ForeignFunctionInterfaceSyntax	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/ForeignFunctionInterfaceSyntax	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,200 @@
+<!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>ForeignFunctionInterfaceSyntax - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      ForeignFunctionInterfaceSyntax
+    <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">
+<p>
+The following descriptions of the syntax of MLton's <a href="ForeignFunctionInterface">ForeignFunctionInterface</a> expressions make use of the following (informal) type abbreviations: 
+</p>
+
+<div>
+<table>
+<tr>
+<td>
+ C base type </td>
+<td>
+ <em>cBaseTy</em> </td>
+<td>
+ <a href="ForeignFunctionInterfaceTypes"> Foreign Function Interface types</a> </td>
+</tr>
+<tr>
+<td>
+ C return type </td>
+<td>
+ <em>cRetTy</em> </td>
+<td>
+ <em>cBaseTy</em> or <tt>unit</tt> </td>
+</tr>
+<tr>
+<td>
+ C function type (<em>n</em> may be zero) </td>
+<td>
+ <em>cFuncTy</em> </td>
+<td>
+ <em>cBaseTy</em><sub>1</sub><tt>&nbsp;*&nbsp;</tt>...<tt>&nbsp;*&nbsp;</tt><em>cBaseTy</em><sub>n</sub><tt>&nbsp;-&gt;&nbsp;</tt><em>cRetTy</em> </td>
+</tr>
+<tr>
+<td>
+ C pointer type </td>
+<td>
+ <em>cPtrTy</em> </td>
+<td>
+ <tt>MLton.Pointer.t</tt> </td>
+</tr>
+</table>
+</div>
+<p>
+The type annotation and the semicolon are not optional in the syntax of <a href="ForeignFunctionInterface">ForeignFunctionInterface</a> expressions.  However, the type is lexed, parsed, and elaborated as an SML type, so any type (including type abbreviations) may be used, so long as it elaborates to a type of the correct form. 
+</p>
+<h2 id="head-d70f93df5e8f9b55be44fbeee9d203972e3383d4">Address</h2>
+
+<pre>_address "C function or variable name" : cPtrTy;
+</pre><p>
+Denotes the address of the C function or variable. 
+</p>
+<h2 id="head-3f84ef531f9db996694ad09a8fdddbca1440577e">Symbol</h2>
+
+<pre>_symbol "C variable name" attr... : (unit -&gt; cBaseTy) * (cBaseTy -&gt; unit);
+</pre><p>
+Denotes the <em>getter</em> and <em>setter</em> for a C variable.   (The <em>cBaseTy</em>s must agree.)   
+</p>
+
+<pre>_symbol * : cPtrTy -&gt; (unit -&gt; cBaseTy) * (cBaseTy -&gt; unit);
+</pre><p>
+Denotes the <em>getter</em> and <em>setter</em> for a C variable pointer.   (The <em>cBaseTy</em>s must agree.) 
+</p>
+<p>
+<tt>attr...</tt> denotes a (possibly empty) sequence of attributes. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>alloc</tt> : allocate storage (and export a symbol) for the C variable 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-d6fbc9d2bdd580e18ed0bc5805dc26db323d6f5f">Import</h2>
+
+<pre>_import "C function name" attr... : cFuncTy;
+</pre><p>
+Denotes a SML function whose behavior is implemented by calling the C function. 
+</p>
+<p>
+See <a href="CallingFromSMLToC"> Calling from SML to C</a> for more details. 
+</p>
+
+<pre>_import * attr... : cPtrTy -&gt; cFuncTy;
+</pre><p>
+Denotes a SML function whose behavior is implemented by calling a C function through a C function pointer. 
+</p>
+<p>
+<tt>attr...</tt> denotes a (possibly empty) sequence of attributes. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>cdecl</tt> : call with the <tt>cdecl</tt> calling convention. 
+</p>
+</li>
+    <li>
+<p>
+ <tt>stdcall</tt> : call with the <tt>stdcall</tt> calling convention. 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+See <a href="CallingFromSMLToCFunctionPointer"> Calling from SML to C function pointer</a> for more details. 
+</p>
+<h2 id="head-f3e4fadb9e370a1e2c0c622c01fc8c77daf93a2c">Export</h2>
+
+<pre>_export "C function name" attr... : cFuncTy -&gt; unit;
+</pre><p>
+Denotes a function that must be applied to a SML function <tt>f</tt> and arranges for the exported C function to call the SML function. 
+</p>
+<p>
+<tt>attr...</tt> denotes a (possibly empty) sequence of attributes. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>cdecl</tt> : call with the <tt>cdecl</tt> calling convention. 
+</p>
+</li>
+    <li>
+<p>
+ <tt>stdcall</tt> : call with the <tt>stdcall</tt> calling convention. 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+See <a href="CallingFromCToSML"> Calling from C to SML</a> for more details. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-07 21:52:33 by <span title="pool-71-243-10-187.bos.east.verizon.net"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/ForeignFunctionInterfaceTypes
===================================================================
--- mlton/trunk/doc/guide/ForeignFunctionInterfaceTypes	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/ForeignFunctionInterfaceTypes	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,250 @@
+<!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>ForeignFunctionInterfaceTypes - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      ForeignFunctionInterfaceTypes
+    <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">
+MLton's <a href="ForeignFunctionInterface">ForeignFunctionInterface</a> only allows values of certain SML types to be passed between SML and C.  The following types are allowed: <tt>bool</tt>, <tt>char</tt>, <tt>int</tt>, <tt>real</tt>, <tt>word</tt>. All of the different sizes of (fixed-sized) integers, reals, and words are supported as well: <tt>Int8.int</tt>, <tt>Int16.int</tt>, <tt>Int32.int</tt>, <tt>Int64.int</tt>, <tt>Real32.real</tt>, <tt>Real64.real</tt>, <tt>Word8.word</tt>, <tt>Word16.word</tt>, <tt>Word32.word</tt>, <tt>Word64.word</tt>.  There is a special type, <tt>MLton.Pointer.t</tt>, for passing C pointers -- see <a href="MLtonPointer">MLtonPointer</a> for details. <p>
+Arrays, refs, and vectors of the above types are also allowed. Because in MLton monomorphic arrays and vectors are exactly the same as their polymorphic counterpart, these are also allowed.  Hence, <tt>string</tt> (equivalent to <tt>CharVector.vector</tt>) is also allowed. Strings are not null terminated, unless you manually do so from the SML side. 
+</p>
+<p>
+Unfortunately, passing tuples or datatypes is not allowed because that would interfere with representation optimizations. 
+</p>
+<p>
+The C header file that <tt>-export-header</tt> generates includes <tt>typedef</tt>s for the C types corresponding to the SML types.  Here is the mapping between SML types and C types. 
+</p>
+
+<div>
+<table>
+<tr>
+<td>
+ SML type </td>
+<td>
+ C typedef </td>
+<td>
+ C type </td>
+</tr>
+<tr>
+<td>
+ <tt>array</tt> </td>
+<td>
+ <tt>Pointer</tt> </td>
+<td>
+ <tt>char&nbsp;*</tt> </td>
+</tr>
+<tr>
+<td>
+ <tt>bool</tt> </td>
+<td>
+ <tt>Int32</tt> </td>
+<td>
+ <tt>long</tt> </td>
+</tr>
+<tr>
+<td>
+ <tt>char</tt> </td>
+<td>
+ <tt>Int8</tt> </td>
+<td>
+ <tt>char</tt> </td>
+</tr>
+<tr>
+<td>
+ <tt>Int8.int</tt> </td>
+<td>
+ <tt>Int8</tt> </td>
+<td>
+ <tt>char</tt> </td>
+</tr>
+<tr>
+<td>
+ <tt>Int16.int</tt> </td>
+<td>
+ <tt>Int16</tt> </td>
+<td>
+ <tt>short</tt> </td>
+</tr>
+<tr>
+<td>
+ <tt>Int32.int</tt> </td>
+<td>
+ <tt>Int32</tt> </td>
+<td>
+ <tt>long</tt> </td>
+</tr>
+<tr>
+<td>
+ <tt>Int64.int</tt> </td>
+<td>
+ <tt>Int64</tt> </td>
+<td>
+ <tt>long&nbsp;long</tt> </td>
+</tr>
+<tr>
+<td>
+ <tt>int</tt> </td>
+<td>
+ <tt>Int32</tt> </td>
+<td>
+ <tt>long</tt> </td>
+</tr>
+<tr>
+<td>
+ <tt>MLton.Pointer.t</tt> </td>
+<td>
+ <tt>Pointer</tt> </td>
+<td>
+ <tt>char&nbsp;*</tt> </td>
+</tr>
+<tr>
+<td>
+ <tt>Real32.real</tt> </td>
+<td>
+ <tt>Real32</tt> </td>
+<td>
+ <tt>float</tt> </td>
+</tr>
+<tr>
+<td>
+ <tt>Real64.real</tt> </td>
+<td>
+ <tt>Real64</tt> </td>
+<td>
+ <tt>double</tt> </td>
+</tr>
+<tr>
+<td>
+ <tt>real</tt> </td>
+<td>
+ <tt>Real64</tt> </td>
+<td>
+ <tt>double</tt> </td>
+</tr>
+<tr>
+<td>
+ <tt>ref</tt> </td>
+<td>
+ <tt>Pointer</tt> </td>
+<td>
+ <tt>char&nbsp;*</tt> </td>
+</tr>
+<tr>
+<td>
+ <tt>string</tt> </td>
+<td>
+ <tt>Pointer</tt> </td>
+<td>
+ <tt>char&nbsp;*</tt> <strong>(read-only)</strong></td>
+</tr>
+<tr>
+<td>
+ <tt>vector</tt> </td>
+<td>
+ <tt>Pointer</tt> </td>
+<td>
+ <tt>char&nbsp;*</tt> <strong>(read-only)</strong></td>
+</tr>
+<tr>
+<td>
+ <tt>Word8.word</tt> </td>
+<td>
+ <tt>Word8</tt> </td>
+<td>
+ <tt>unsigned&nbsp;char</tt> </td>
+</tr>
+<tr>
+<td>
+ <tt>Word16.word</tt> </td>
+<td>
+ <tt>Word16</tt> </td>
+<td>
+ <tt>unsigned&nbsp;short</tt> </td>
+</tr>
+<tr>
+<td>
+ <tt>Word32.word</tt> </td>
+<td>
+ <tt>Word32</tt> </td>
+<td>
+ <tt>unsigned&nbsp;long</tt> </td>
+</tr>
+<tr>
+<td>
+ <tt>Word64.word</tt> </td>
+<td>
+ <tt>Word64</tt> </td>
+<td>
+ <tt>unsigned&nbsp;long&nbsp;long</tt> </td>
+</tr>
+<tr>
+<td>
+ <tt>word</tt> </td>
+<td>
+ <tt>Word32</tt> </td>
+<td>
+ <tt>unsigned&nbsp;int</tt> </td>
+</tr>
+</table>
+</div>
+<p>
+Because MLton assumes that vectors and strings are read-only (and will perform optimizations that, for instance, cause them to share space), you must not modify the data pointed to by the <tt>char&nbsp;*</tt> in C code. 
+</p>
+<p>
+Although the C type of an array, ref, or vector is always <tt>Pointer</tt>, in reality, the object has the natural C representation.  Your C code should cast to the appropriate C type if you want to keep the C compiler from complaining. 
+</p>
+<p>
+When calling an <a href="CallingFromSMLToC"> imported C function from SML</a> that returns an array, ref, or vector result or when calling an <a href="CallingFromCToSML"> exported SML function from C</a> that takes an array, ref, or string argument, then the object must be an ML object allocated on the ML heap.  (Although an array, ref, or vector object has the natural C representation, the object also has an additional header used by the SML runtime system.) 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-07 22:18:13 by <span title="pool-71-243-10-187.bos.east.verizon.net"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/FrontEnd
===================================================================
--- mlton/trunk/doc/guide/FrontEnd	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/FrontEnd	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,82 @@
+<!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>FrontEnd - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      FrontEnd
+    <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">
+A translation pass from source to the <a href="AST">AST</a> <a href="IntermediateLanguage">IntermediateLanguage</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Peforms lexing and parsing to produce an abstract syntax tree. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/front-end/front-end.sig?view=markup">front-end.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/front-end/front-end.fun?view=markup">front-end.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+<p>
+The lexer is produced by <a class="nonexistent" href="MLLex">MLLex</a> from 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/front-end/ml.lex?view=markup">ml.lex</a>
+. 
+</p>
+<p>
+The parser is produced by <a class="nonexistent" href="MLYacc">MLYacc</a> from 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/front-end/ml.grm?view=markup">ml.grm</a>
+. 
+</p>
+<p>
+The specifications for the lexer and parser were originally taken from <a href="SMLNJ"> SML/NJ</a> (version 109.32). 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:38:06 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/FunctionalRecordUpdate
===================================================================
--- mlton/trunk/doc/guide/FunctionalRecordUpdate	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/FunctionalRecordUpdate	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,253 @@
+<!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>FunctionalRecordUpdate - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      FunctionalRecordUpdate
+    <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">
+Functional record update is the copying of a record while replacing the values of some of the fields.  For example, the functional update of 
+<pre>{a = 13, b = 14, c = 15} 
+</pre>with <tt>c&nbsp;=&nbsp;16</tt> yields a new record  
+<pre>{a = 13, b = 14, c = 16}
+</pre>Functional record update also makes sense with multiple simultaneous updates.  For example, the functional update of the record above with <tt>a&nbsp;=&nbsp;18,&nbsp;c&nbsp;=&nbsp;19</tt> yields a new record  
+<pre>{a = 18, b = 14, c = 19}
+</pre><p>
+<a href="StandardML">Standard ML</a> does not have explicit syntax for functional record update.  One could easily imagine an extension of the SML that supported it.  For example 
+<pre>e with {a = 16, b = 17}
+</pre>would create a copy of the record denoted by <tt>e</tt> with field <tt>a</tt> replaced with <tt>16</tt> and <tt>b</tt> replaced with <tt>17</tt>. Despite the absence of special syntax, it is easy to emulate functional record update with a little boilerplate code. 
+</p>
+<h2 id="head-fa2179e8b7b0b4d2c689f9612a22a231e6cd9bf2">Simple implementation</h2>
+<p>
+To support functional record update on the record type 
+<pre>{a: 'a, b: 'b, c: 'c} 
+</pre>first, define an update function for each component. 
+<pre class=code>
+<B><FONT COLOR="#A020F0">fun</FONT></B> withA ({a = _, b, c}, a) = {a = a, b = b, c = c}
+<B><FONT COLOR="#A020F0">fun</FONT></B> withB ({a, b = _, c}, b) = {a = a, b = b, c = c}
+<B><FONT COLOR="#A020F0">fun</FONT></B> withC ({a, b, c = _}, c) = {a = a, b = b, c = c}
+</PRE>
+ Then, one can express <tt>e&nbsp;with&nbsp;{a&nbsp;=&nbsp;16,&nbsp;b&nbsp;=&nbsp;17}&nbsp;</tt> as 
+<pre>withB (withA (e, 16), 17)
+</pre>With infix notation 
+<pre>infix withA withB withC
+</pre>the syntax is almost as concise as a language extension. 
+<pre>e withA 16 withB 17
+</pre>
+</p>
+<h2 id="head-02713f1aab596f254ab1dd3551f0c5a015b6e40b">Advanced implementation</h2>
+<p>
+The above approach suffers from the fact that the amount of boilerplate code is quadratic in the number of record fields. Furthermore, changing, adding, or deleting a field requires time proportional to the number of fields (because each <tt>with</tt> function must be changed).  It is also annoying to have to define a <tt>with</tt> function, possibly with a fixity declaration, for each field. 
+</p>
+<p>
+Fortunately, there is a solution to these problems. We can define a single function, <tt>set</tt>, use the existing SML record selector syntax, and the <a href="InfixingOperators">left piping operator</a>, so that 
+<pre class=code>
+{a = <B><FONT COLOR="#5F9EA0">1</FONT></B>, b = <FONT COLOR="#BC8F8F"><B>&quot;foo&quot;</FONT></B>, c = <B><FONT COLOR="#5F9EA0">3.0</FONT></B>} &gt;| set#a <B><FONT COLOR="#5F9EA0">13</FONT></B> &gt;| set#b <FONT COLOR="#BC8F8F"><B>&quot;bar&quot;</FONT></B>
+</PRE>
+ will evaluate to 
+<pre class=code>
+{a = <B><FONT COLOR="#5F9EA0">13</FONT></B>, b = <FONT COLOR="#BC8F8F"><B>&quot;bar&quot;</FONT></B>, c = <B><FONT COLOR="#5F9EA0">3.0</FONT></B>}
+</PRE>
+ 
+</p>
+<p>
+Here is the definition of <tt>set</tt>. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">fun</FONT></B> set f z {a, b, c} =
+   <B><FONT COLOR="#A020F0">let</FONT></B>
+      <B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">A</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> 'a </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">B</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> 'b </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">C</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> 'c
+      </FONT></B><B><FONT COLOR="#A020F0">fun</FONT></B> g h z =
+         {a = <B><FONT COLOR="#A020F0">case</FONT></B> h z <B><FONT COLOR="#A020F0">of</FONT></B> A a =&gt; a | _ =&gt; a,
+          b = <B><FONT COLOR="#A020F0">case</FONT></B> h z <B><FONT COLOR="#A020F0">of</FONT></B> B b =&gt; b | _ =&gt; b,
+          c = <B><FONT COLOR="#A020F0">case</FONT></B> h z <B><FONT COLOR="#A020F0">of</FONT></B> C c =&gt; c | _ =&gt; c}
+   <B><FONT COLOR="#A020F0">in</FONT></B>
+      f {a = g A, b = g B, c = g C} z
+   <B><FONT COLOR="#A020F0">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<p>
+Here is the type of <tt>set</tt>. 
+</p>
+
+<pre>val set : ({a:'a -&gt; {a:'a, b:'b, c:'c},
+            b:'b -&gt; {a:'a, b:'b, c:'c},
+            c:'c -&gt; {a:'a, b:'b, c:'c}} -&gt; 'd -&gt; 'e)
+          -&gt; 'd
+          -&gt; {a:'a, b:'b, c:'c}
+          -&gt; 'e
+</pre><p>
+To change a field with this approach, we only have to change three things. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ the variant in <tt>datatype&nbsp;t</tt> 
+</p>
+</li>
+    <li>
+<p>
+ the field in the result of g 
+</p>
+</li>
+    <li>
+<p>
+ the field in the argument to <tt>f</tt> 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+There is a minor disadvantage, however. The type of the field being updated can not (easily) be changed: 
+<pre class=code>
+{a=<B><FONT COLOR="#5F9EA0">1</FONT></B>, b=<B><FONT COLOR="#5F9EA0">2</FONT></B>, c=<B><FONT COLOR="#5F9EA0">3</FONT></B>} &gt;| set#a <FONT COLOR="#BC8F8F"><B>&quot;1&quot;</FONT></B> <I><FONT COLOR="#B22222">(* Type error! *)</FONT></I>
+</PRE>
+ 
+</p>
+<p>
+While our definition of <tt>set</tt> is valid SML and works with MLton, unfortunately, most other SML compilers mistakenly reject the program because of the free type variables in the datatype declaration.  You can work around this problem in such compilers by manually lifting <tt>datatype&nbsp;t</tt> to the toplevel and adding <tt>'a</tt>, <tt>'b</tt>, and <tt>'c</tt> as parameters to <tt>t</tt>. 
+</p>
+<h2 id="head-5a88564031f8f0662f3a77b949186ffc75a82bc3">Going Further</h2>
+<p>
+One can generalize the previous approach and define a function that performs functional record update on any object that is isomorphic to a tuple (of the appropriate arity). 
+</p>
+<p>
+We first define a function to perform a functional 3-tuple update: 
+<pre class=code>
+<B><FONT COLOR="#A020F0">fun</FONT></B> set3 f v (v1, v2, v3) =
+    <B><FONT COLOR="#A020F0">let</FONT></B>
+       <B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> ('v1, 'v2, 'v3) t </FONT></B>=<FONT COLOR="#228B22"><B>
+                <FONT COLOR="#B8860B">V1</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> 'v1 </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">V2</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> 'v2 </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">V3</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> 'v3
+       </FONT></B><B><FONT COLOR="#A020F0">fun</FONT></B> g h v =
+           (<B><FONT COLOR="#A020F0">case</FONT></B> h v <B><FONT COLOR="#A020F0">of</FONT></B> V1 v1 =&gt; v1 | _ =&gt; v1,
+            <B><FONT COLOR="#A020F0">case</FONT></B> h v <B><FONT COLOR="#A020F0">of</FONT></B> V2 v2 =&gt; v2 | _ =&gt; v2,
+            <B><FONT COLOR="#A020F0">case</FONT></B> h v <B><FONT COLOR="#A020F0">of</FONT></B> V3 v3 =&gt; v3 | _ =&gt; v3)
+    <B><FONT COLOR="#A020F0">in</FONT></B>
+       f (g V1, g V2, g V3) v
+    <B><FONT COLOR="#A020F0">end</FONT></B>
+</PRE>
+ 
+</p>
+<p>
+We also define a generic function for wrapping a tuple update given an isomorphism: 
+<pre class=code>
+<B><FONT COLOR="#A020F0">fun</FONT></B> wrapSet (set, t2r, t2r', r2t) f v r = t2r (set (f o t2r') v (r2t r))
+</PRE>
+ 
+</p>
+<p>
+The isomorphism is specified by <tt>t2r</tt>, <tt>t2r'</tt>, and <tt>r2t</tt>; <tt>t2r</tt> and <tt>t2r'</tt> are actually the same function - we need to supply two copies because of the absence of <a href="FirstClassPolymorphism">FirstClassPolymorphism</a> in SML. 
+</p>
+<p>
+Here's how to use <tt>set3</tt> and <tt>wrapSet</tt> to define an update function for <tt>{a,&nbsp;b,&nbsp;c</tt>} and for <tt>{d,&nbsp;e,&nbsp;f</tt>}. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">fun</FONT></B> set f =
+    <B><FONT COLOR="#A020F0">let</FONT></B>
+       <B><FONT COLOR="#A020F0">fun</FONT></B> t2r (v1, v2, v3) = {a = v1, b = v2, c = v3}
+       <B><FONT COLOR="#A020F0">fun</FONT></B> r2t {a = v1, b = v2, c = v3} = (v1, v2, v3)
+    <B><FONT COLOR="#A020F0">in</FONT></B>
+       wrapSet (set3, t2r, t2r, r2t) f
+    <B><FONT COLOR="#A020F0">end</FONT></B>
+
+<B><FONT COLOR="#A020F0">fun</FONT></B> set f =
+    <B><FONT COLOR="#A020F0">let</FONT></B>
+       <B><FONT COLOR="#A020F0">fun</FONT></B> t2r (v1, v2, v3) = {d = v1, e = v2, f = v3}
+       <B><FONT COLOR="#A020F0">fun</FONT></B> r2t {d = v1, e = v2, f = v3} = (v1, v2, v3)
+    <B><FONT COLOR="#A020F0">in</FONT></B>
+       wrapSet (set3, t2r, t2r, r2t) f
+    <B><FONT COLOR="#A020F0">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<p>
+With this approach, changing a field name only requires changing the name in the <tt>t2r</tt> and <tt>r2t</tt> functions. 
+</p>
+<p>
+The MLton SVN contains Emacs functions in 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/ide/emacs/esml-gen.el?view=markup">esml-gen.el</a>
+ to generate functional tuple update functions and functional record update functions. For example, to generate a <tt>set</tt> function for the record <tt>{a,&nbsp;b,&nbsp;c</tt>} it is sufficient to type <tt>M&nbsp;x&nbsp;esml-gen-fru-setter&nbsp;a&nbsp;b&nbsp;c</tt>. 
+</p>
+<h2 id="head-12c4ffe1d987164a4bedf6ab2aac597a113e181c">Efficiency</h2>
+<p>
+With MLton, the efficiency of these approaches is as good as one would expect with the special syntax.  Namely a sequence of updates will be optimized into a single record construction that copies the unchanged fields and fills in the changed fields with their new values. 
+</p>
+<h2 id="head-1e08a697796bdf72d4e392f34eb1c72cd4ef029e">Imperative approach</h2>
+<p>
+One can use ref cells under the hood to implement functional record update. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">fun</FONT></B> set f z {a, b, c} =
+   <B><FONT COLOR="#A020F0">let</FONT></B>
+      <B><FONT COLOR="#A020F0">val</FONT></B> a = ref a
+      <B><FONT COLOR="#A020F0">val</FONT></B> b = ref b
+      <B><FONT COLOR="#A020F0">val</FONT></B> c = ref c
+      <B><FONT COLOR="#A020F0">val</FONT></B> () = f {a = a, b = b, c = c} := z
+   <B><FONT COLOR="#A020F0">in</FONT></B>
+      {a = !a, b = !b, c = !c}
+   <B><FONT COLOR="#A020F0">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-14 18:21:47 by <span title="cs78147176.pp.htv.fi"><a href="VesaKarvonen">VesaKarvonen</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/GarbageCollection
===================================================================
--- mlton/trunk/doc/guide/GarbageCollection	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/GarbageCollection	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,90 @@
+<!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>GarbageCollection - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      GarbageCollection
+    <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">
+For a good introduction and overview to garbage collection, see <a href = "References#Jones99">Jones99</a>. <p>
+MLton's garbage collector uses copying, mark-compact, and generational collection, automatically switching between them at run time based on the amount of live data relative to the amount of RAM.  The runtime system tries to keep the heap within RAM if at all possible. 
+</p>
+<p>
+MLton's copying collector is a simple, two-space, breadth-first, Cheney-style collector.  The design for the generational and mark-compact GC is based on <a href = "References#Sansom91">Sansom91</a>. 
+</p>
+<h2 id="head-ca5ffa1ff2511b4bf15f18d7a672a126f9977950">Design notes</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="http://mlton.org/pipermail/mlton/2002-May/012420.html">http://mlton.org/pipermail/mlton/2002-May/012420.html</a>  <br>
+ object layout and header word design 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-a4bc8bf5caf54b18cea9f58e83dd4acb488deb17">Also see</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="Regions">Regions</a> 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-10 18:23:47 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/GenerativeDatatype
===================================================================
--- mlton/trunk/doc/guide/GenerativeDatatype	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/GenerativeDatatype	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,86 @@
+<!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>GenerativeDatatype - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      GenerativeDatatype
+    <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">
+In <a href="StandardML">Standard ML</a>, datatype declarations are said to be <em>generative</em>, because each time a datatype declaration is evaluated, it yields a new type.  Thus, any attempt to mix the types will lead to a type error at compile-time.  The following program, which does not type check, demonstrates this. 
+<pre class=code>
+<B><FONT COLOR="#0000FF">functor</FONT></B> F () =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">T</FONT>
+   </FONT></B><B><FONT COLOR="#0000FF">end</FONT></B>
+<B><FONT COLOR="#0000FF">structure</FONT></B> S1 = F ()
+<B><FONT COLOR="#0000FF">structure</FONT></B> S2 = F ()
+<B><FONT COLOR="#A020F0">val</FONT></B> _: S1.t -&gt; S2.t = <B><FONT COLOR="#A020F0">fn</FONT></B> x =&gt; x
+</PRE>
+<p>
+ 
+</p>
+<p>
+Generativity also means that two different datatype declarations define different types, even if they define identical constructors. The following program does not type check due to this. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">A</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">B</FONT>
+</FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> a1 = A
+<B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">A</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">B</FONT>
+</FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> a2 = A
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = <B><FONT COLOR="#A020F0">if</FONT></B> true <B><FONT COLOR="#A020F0">then</FONT></B> a1 <B><FONT COLOR="#A020F0">else</FONT></B> a2
+</PRE>
+<p>
+ 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-26 20:34:48 by <span title="cfs36.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/GenerativeException
===================================================================
--- mlton/trunk/doc/guide/GenerativeException	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/GenerativeException	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,127 @@
+<!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>GenerativeException - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      GenerativeException
+    <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">
+In <a href="StandardML">Standard ML</a>, exception declarations are said to be <em>generative</em>, because each time an exception declaration is evaluated, it yields a new exception. <p>
+The following program demonstrates the generativity of exceptions. 
+<pre class=code>
+<B><FONT COLOR="#A020F0">exception</FONT></B><FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">E</FONT>
+</FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> e1 = E
+<B><FONT COLOR="#A020F0">fun</FONT></B> isE1 (e: exn): bool =
+   <B><FONT COLOR="#A020F0">case</FONT></B> e <B><FONT COLOR="#A020F0">of</FONT></B>
+      E =&gt; true
+    | _ =&gt; false
+<B><FONT COLOR="#A020F0">exception</FONT></B><FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">E</FONT>
+</FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> e2 = E
+<B><FONT COLOR="#A020F0">fun</FONT></B> isE2 (e: exn): bool =
+   <B><FONT COLOR="#A020F0">case</FONT></B> e <B><FONT COLOR="#A020F0">of</FONT></B>
+      E =&gt; true
+    | _ =&gt; false
+<B><FONT COLOR="#A020F0">fun</FONT></B> pb (b: bool): unit =
+   print (concat [Bool.toString b, <FONT COLOR="#BC8F8F"><B>&quot;\n&quot;</FONT></B>])
+<B><FONT COLOR="#A020F0">val</FONT></B> () = (pb (isE1 e1)
+          ;pb (isE1 e2)
+          ; pb (isE2 e1)
+          ; pb (isE2 e2))
+</PRE>
+ In the above program, two different exception declarations declare an exception <tt>E</tt> and a corresponding function that returns <tt>true</tt> only on that exception.  Although declared by syntactically identical exception declarations, <tt>e1</tt> and <tt>e2</tt> are different exceptions.  The program, when run, prints <tt>true</tt>, <tt>false</tt>, <tt>false</tt>, <tt>true</tt>. 
+</p>
+<p>
+A slight modification of the above program shows that even a single exception declaration yields a new exception each time it is evaluated. 
+<pre class=code>
+<B><FONT COLOR="#A020F0">fun</FONT></B> f (): exn * (exn -&gt; bool) =
+   <B><FONT COLOR="#A020F0">let</FONT></B>
+      <B><FONT COLOR="#A020F0">exception</FONT></B><FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">E</FONT>
+   </FONT></B><B><FONT COLOR="#A020F0">in</FONT></B>
+      (E, <B><FONT COLOR="#A020F0">fn</FONT></B> E =&gt; true | _ =&gt; false)
+   <B><FONT COLOR="#A020F0">end</FONT></B>
+<B><FONT COLOR="#A020F0">val</FONT></B> (e1, isE1) = f ()
+<B><FONT COLOR="#A020F0">val</FONT></B> (e2, isE2) = f ()
+<B><FONT COLOR="#A020F0">fun</FONT></B> pb (b: bool): unit =
+   print (concat [Bool.toString b, <FONT COLOR="#BC8F8F"><B>&quot;\n&quot;</FONT></B>])
+<B><FONT COLOR="#A020F0">val</FONT></B> () = (pb (isE1 e1)
+          ; pb (isE1 e2)
+          ; pb (isE2 e1)
+          ; pb (isE2 e2))
+</PRE>
+ Each call to <tt>f</tt> yields a new exception and a function that returns <tt>true</tt> only on that exception.  The program, when run, prints <tt>true</tt>, <tt>false</tt>, <tt>false</tt>, <tt>true</tt>. 
+</p>
+<h2 id="head-86469abfaa44f69bd741f559ff1bb935309ad35e">Type Safety</h2>
+<p>
+Exception generativity is required for type safety.  Consider the following valid SML program. 
+<pre class=code>
+<B><FONT COLOR="#A020F0">fun</FONT></B> f (): ('a -&gt; exn) * (exn -&gt; 'a) =
+   <B><FONT COLOR="#A020F0">let</FONT></B>
+      <B><FONT COLOR="#A020F0">exception</FONT></B><FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">E</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> 'a
+   </FONT></B><B><FONT COLOR="#A020F0">in</FONT></B>
+      (E, <B><FONT COLOR="#A020F0">fn</FONT></B> E x =&gt; x | _ =&gt; <B><FONT COLOR="#A020F0">raise</FONT></B> Fail <FONT COLOR="#BC8F8F"><B>&quot;f&quot;</FONT></B>)
+   <B><FONT COLOR="#A020F0">end</FONT></B>
+<B><FONT COLOR="#A020F0">fun</FONT></B> cast (a: 'a): 'b =
+   <B><FONT COLOR="#A020F0">let</FONT></B>
+      <B><FONT COLOR="#A020F0">val</FONT></B> (make: 'a -&gt; exn, _) = f ()
+      <B><FONT COLOR="#A020F0">val</FONT></B> (_, get: exn -&gt; 'b) = f ()
+   <B><FONT COLOR="#A020F0">in</FONT></B>
+      get (make a)
+   <B><FONT COLOR="#A020F0">end</FONT></B>
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = ((cast <B><FONT COLOR="#5F9EA0">13</FONT></B>): int -&gt; int) <B><FONT COLOR="#5F9EA0">14</FONT></B>
+</PRE>
+ 
+</p>
+<p>
+If exceptions weren't generative, then each call <tt>f&nbsp;()</tt> would yield the same exception constructor <tt>E</tt>.  Then, our <tt>cast</tt> function could use <tt>make:&nbsp;'a&nbsp;-&gt;&nbsp;exn</tt> to convert any value into an exception and then <tt>get:&nbsp;exn&nbsp;-&gt;&nbsp;'b</tt> to convert that exception to a value of arbitrary type.  If <tt>cast</tt> worked, then we could cast an integer as a function and apply.  Of course, because of generative exceptions, this program raises <tt>Fail&nbsp;"f"</tt>. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-26 20:34:34 by <span title="cfs36.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Globalize
===================================================================
--- mlton/trunk/doc/guide/Globalize	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Globalize	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,69 @@
+<!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>Globalize - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Globalize
+    <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">
+An analysis pass for the <a href="SXML">SXML</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="ClosureConvert">ClosureConvert</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Mark values that are constant, allowing <a href="ClosureConvert">ClosureConvert</a> to move them out to the top level so they are only evaluated once and do not appear in closures. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/closure-convert/globalize.sig?view=markup">globalize.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/closure-convert/globalize.fun?view=markup">globalize.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:37:52 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/GnuMP
===================================================================
--- mlton/trunk/doc/guide/GnuMP	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/GnuMP	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,77 @@
+<!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>GnuMP - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      GnuMP
+    <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 class="external" href="http://www.gnu.org/software/gmp/gmp.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">GnuMP</a> (GNU multiprecision library) is a library for arbitrary precision integer arithmetic.  MLton uses the GnuMP to implement the SML Basis <tt>IntInf</tt> module. <p>
+There is a known problem with the GnuMP, where it requires a lot of stack space for some compuations, e.g. <tt>IntInf.toString</tt> of a million digit number.  If you run with stack size limited, you may see a segfault in such programs.  This problem is mentioned in the <a class="external" href="http://www.swox.com/gmp/#FAQ"><img src="moin-www.png" alt="[WWW]" height="11" width="11">GnuMP FAQ</a>, where they describe two solutions. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ Increase (or unlimit) your stack space.  From your program, use  <tt>setrlimit</tt>, or from the shell, use <tt>ulimit</tt>. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ Configure and rebuild <tt>libgmp</tt> with <tt>--disable-alloca</tt>, which  will cause it to allocate temporaries using <tt>malloc</tt> instead of on the  stack. 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-02-03 19:19:26 by <span title="adsl-64-166-225-223.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/HaMLet
===================================================================
--- mlton/trunk/doc/guide/HaMLet	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/HaMLet	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,59 @@
+<!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>HaMLet - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      HaMLet
+    <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">
+<a class="external" href="http://www.ps.uni-sb.de/hamlet/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Hamlet</a> is  <a href="StandardMLImplementations">Standard ML Implementation</a>. It is intended as reference implementation of the  <a href="DefinitionOfStandardML">Definition of Standard ML</a> and not for serious practical work. </div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-07-27 18:18:25 by <span title="adsl-64-166-226-32.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/HenryCejtin
===================================================================
--- mlton/trunk/doc/guide/HenryCejtin	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/HenryCejtin	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,59 @@
+<!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>HenryCejtin - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      HenryCejtin
+    <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">
+I was one of the original developers of Mathematica (actually employee #1). My background is a combination of mathematics and computer science. Currently I am at <a class="external" href="http://www.sourcelight.com"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Sourcelight Technologies</a>. </div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-20 03:08:02 by <span title="adsl-64-108-192-30.dsl.chcgil.ameritech.net"><a href="HenryCejtin">HenryCejtin</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/History
===================================================================
--- mlton/trunk/doc/guide/History	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/History	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,77 @@
+<!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>History - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      History
+    <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">
+In April 1997, Stephen Weeks wrote a defunctorizer for Standard ML and integrated it with SML/NJ.  The defunctorizer used SML/NJ's visible compiler and operated on the <tt>Ast</tt> intermediate representation produced by the SML/NJ front end.  Experiments showed that defunctorization gave a speedup of up to six times over separate compilation and up to two times over batch compilation without functor expansion. <p>
+In August 1997, we began development of an independent compiler for SML.  At the time the compiler was called <tt>smlc</tt>.  By October, we had a working monomorphiser.  By November, we added a polyvariant higher-order control-flow analysis.  At that point, MLton was about 10,000 lines of code. 
+</p>
+<p>
+Over the next year and half, <tt>smlc</tt> morphed into a full-fledged compiler for SML.  It was renamed MLton, and first released in March 1999. 
+</p>
+<p>
+From the start, MLton has been driven by whole-program optimization and an emphasis on performance.  Also from the start, MLton has had a fast C FFI and <tt>IntInf</tt> based on the GNU multiprecision library. At its first release, MLton was 48,006 lines. 
+</p>
+<p>
+Between the March 1999 and January 2002, MLton grew to 102,541 lines, as we added a native code generator, mllex, mlyacc, a profiler, many optimizations, and many libraries including threads and signal handling.   
+</p>
+<p>
+During 2002, MLton grew to 112,204 lines and we had releases in April and September.  We added support for cross compilation and used this to enable MLton to run on Cygwin/Windows and FreeBSD.  We also made improvements to the garbage collector, so that it now works with large arrays and up to 4G of memory and so that it automatically uses copying, mark-compact, or generational collection depending on heap usage and RAM size.  We also continued improvements to the optimizer and libraries. 
+</p>
+<p>
+During 2003, MLton grew to 122,299 lines and we had releases in March and July.  We extended the profiler to support source-level profiling of time and allocation and to display call graphs.  We completed the basis library implementation, and added new MLton-specific libraries for weak pointers and finalization.  We extended the FFI to allow callbacks from C to SML.  We added support for the Sparc/Solaris platform, and made many improvements to the C code generator. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-15 23:12:05 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Home
===================================================================
--- mlton/trunk/doc/guide/Home	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Home	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,106 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<meta name="robots" content="index,follow">
+
+
+
+<title>Home - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Home
+    <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">
+<h2 id="head-0e2e052318497534ae5631e175d61d7203de1499">What is MLton?</h2>
+MLton is an open-source, whole-program, optimizing <a href="StandardML">Standard ML</a> compiler. <h2 id="head-11fc14203dd0f4441645a9c34d5dd022905f56e4">Next steps</h2>
+
+    <ul>
+
+    <li>
+<p>
+ Read about MLton's <a href="Features">Features</a>. 
+</p>
+</li>
+    <li>
+<p>
+ Look at <a href="Documentation">Documentation</a>. 
+</p>
+</li>
+    <li>
+<p>
+ See some <a href="Users">Users</a> of MLton. 
+</p>
+</li>
+    <li>
+<p>
+ <a href="http://mlton.org/Download">Download</a> MLton. 
+</p>
+</li>
+    <li>
+<p>
+ Meet the MLton <a href="Developers">Developers</a>. 
+</p>
+</li>
+    <li>
+<p>
+ Get involved with MLton <a href="Development">Development</a>. 
+</p>
+</li>
+    <li>
+<p>
+ User-maintained <a href="FAQ">FAQ</a>. 
+</p>
+</li>
+    <li>
+<p>
+ <a href="Contact">Contact</a> us. 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-02-07 01:07:19 by <span title="adsl-64-166-224-38.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/HowProfilingWorks
===================================================================
--- mlton/trunk/doc/guide/HowProfilingWorks	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/HowProfilingWorks	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,102 @@
+<!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>HowProfilingWorks - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      HowProfilingWorks
+    <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">
+Here's how <a href="Profiling">Profiling</a> works.  If profiling is on, the front end (elaborator) inserts <tt>Enter</tt> and <tt>Leave</tt> statements into the source program for function entry and exit.   For example, 
+<pre class=code>
+<B><FONT COLOR="#A020F0">fun</FONT></B> f n = <B><FONT COLOR="#A020F0">if</FONT></B> n = <B><FONT COLOR="#5F9EA0">0</FONT></B> <B><FONT COLOR="#A020F0">then</FONT></B> <B><FONT COLOR="#5F9EA0">0</FONT></B> <B><FONT COLOR="#A020F0">else</FONT></B> <B><FONT COLOR="#5F9EA0">1</FONT></B> + f (n - <B><FONT COLOR="#5F9EA0">1</FONT></B>)
+</PRE>
+<p>
+ becomes 
+<pre class=code>
+<B><FONT COLOR="#A020F0">fun</FONT></B> f n = 
+   <B><FONT COLOR="#A020F0">let</FONT></B>
+      <B><FONT COLOR="#A020F0">val</FONT></B> () = Enter <FONT COLOR="#BC8F8F"><B>&quot;f&quot;</FONT></B>
+      <B><FONT COLOR="#A020F0">val</FONT></B> res = (<B><FONT COLOR="#A020F0">if</FONT></B> n = <B><FONT COLOR="#5F9EA0">0</FONT></B> <B><FONT COLOR="#A020F0">then</FONT></B> <B><FONT COLOR="#5F9EA0">0</FONT></B> <B><FONT COLOR="#A020F0">else</FONT></B> <B><FONT COLOR="#5F9EA0">1</FONT></B> + f (n - <B><FONT COLOR="#5F9EA0">1</FONT></B>))
+                <B><FONT COLOR="#A020F0">handle</FONT></B> e =&gt; (Leave <FONT COLOR="#BC8F8F"><B>&quot;f&quot;</FONT></B>; <B><FONT COLOR="#A020F0">raise</FONT></B> e)
+      <B><FONT COLOR="#A020F0">val</FONT></B> () = Leave <FONT COLOR="#BC8F8F"><B>&quot;f&quot;</FONT></B>
+   <B><FONT COLOR="#A020F0">in</FONT></B> 
+      res
+   <B><FONT COLOR="#A020F0">end</FONT></B>
+</PRE>
+ Actually there is a bit more information than just the source function name; there is also lexical nesting and file position.  
+</p>
+<p>
+Most of the middle of the compiler ignores <tt>Enter</tt> and <tt>Leave</tt>.  However, so that profiling preserves tail calls, the Ssa shrinker has an optimization that notices when the only operations that cause a call to be a nontail call are profiling operations, and if so, moves them before the call, turning it into a tail call.  If you observe a program that has a tail call that appears to be turned into a nontail when compiled with profiling, please <a href="Bug">report a bug</a>. 
+</p>
+<p>
+There is the <tt>checkProf</tt> function in 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/type-check.fun?view=markup">type-check.fun</a>
+, which checks that the <tt>Enter</tt>/<tt>Leave</tt> statements match up. 
+</p>
+<p>
+In the backend, just before translating to the <a href="Machine">Machine</a> IL, the profiler uses the <tt>Enter</tt>/<tt>Leave</tt> statements to infer the "local" portion of the control stack at each program point.  The profiler then removes the <tt>Enter</tt>s/<tt>Leave</tt>s and inserts different information depending on which kind of profiling is happening.  For time profiling, the profiler inserts labels that cover the code (i.e. each statement has a unique label in its basic block that prefixes it) and associates each label with the local control stack.  For allocation profiling, the profiler inserts calls to a C function that will maintain byte counts.  With stack profiling, the profiler also inserts a call to a C function at each nontail call in order to maintain information at runtime about what SML functions are on the stack. 
+</p>
+<p>
+At run time, the profiler associates counters (either clock ticks or byte counts) with source functions.  When the program finishes, the profiler writes the counts out to the <tt>mlmon.out</tt> file.  Then, <tt>mlprof</tt> uses source information stored in the executable to associate the counts in the <tt>mlmon.out</tt> file with source functions. 
+</p>
+<p>
+For time profiling, the profiler catches the <tt>SIGPROF</tt> signal 100 times per second and increments the appropriate counter, determined by looking at the label prefixing the current program counter and mapping that to the current source function. 
+</p>
+<h2 id="head-bcaa33a7ae44bd5042c37a9cdbea7f843b1cf7c8">Caveats</h2>
+<p>
+There may be a few missed clock ticks or bytes allocated at the very end of the program after the data is written. 
+</p>
+<p>
+Profiling has not been tested with signals or threads.  In particular, stack profiling may behave strangely. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:37:29 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Identifier
===================================================================
--- mlton/trunk/doc/guide/Identifier	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Identifier	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,163 @@
+<!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>Identifier - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Identifier
+    <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">
+In <a href="StandardML">Standard ML</a>, there are syntactically two kinds of identifiers. 
+    <ul>
+
+    <li>
+<p>
+ Alphanumeric: starts with a letter or prime (<tt>'</tt>) and is  followed by letters, digits, primes and underbars (<tt>_</tt>). 
+</p>
+<p>
+ Examples: <tt>abc</tt>, <tt>ABC123</tt>, <tt>Abc_123</tt>, <tt>'a</tt>. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ Symbolic: a sequence of the following 
+<pre> ! % &amp; $ # + - / : &lt; = &gt; ? @ | ~ ` ^ | *</pre>
+</p>
+<p>
+ Examples: <tt>+=</tt>, <tt>&lt;=</tt>, <tt>&gt;&gt;</tt>, <tt>$</tt>. 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+With the exception of <tt>=</tt>, reserved words can not be identifiers. 
+</p>
+<p>
+There are a number of different classes of identifiers, some of which have additional syntactic rules. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ Identifiers not starting with a prime. 
+</p>
+</li>
+
+        <ul>
+
+        <li>
+<p>
+ value identifier (includes variables and constructors) 
+</p>
+</li>
+        <li>
+<p>
+ type constructor 
+</p>
+</li>
+        <li>
+<p>
+ structure identifier 
+</p>
+</li>
+        <li>
+<p>
+ signature identifier 
+</p>
+</li>
+        <li>
+<p>
+ functor identifier 
+</p>
+</li>
+
+        </ul>
+
+
+    <li class="gap">
+<p>
+ Identifiers starting with a prime. 
+</p>
+</li>
+
+        <ul>
+
+        <li>
+<p>
+ type variable (must start with prime) 
+</p>
+</li>
+
+        </ul>
+
+
+    <li class="gap">
+<p>
+ Identifiers + numeric labels (<tt>1</tt>, <tt>2</tt>, ...). 
+</p>
+</li>
+
+        <ul>
+
+        <li>
+<p>
+ record label 
+</p>
+</li>
+</ul>
+
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-18 15:02:21 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Immutable
===================================================================
--- mlton/trunk/doc/guide/Immutable	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Immutable	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,59 @@
+<!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>Immutable - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Immutable
+    <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">
+Immutable means not <a href="Mutable">mutable</a>, and is an adjective meaning "can not be modified".  Most values in <a href="StandardML">Standard ML</a> are immutable.  For example, constants, tuples, records, lists, and vectors are all immutable.   </div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-08 18:51:10 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/ImperativeTypeVariable
===================================================================
--- mlton/trunk/doc/guide/ImperativeTypeVariable	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/ImperativeTypeVariable	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,59 @@
+<!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>ImperativeTypeVariable - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      ImperativeTypeVariable
+    <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">
+In <a href="StandardML">Standard ML</a>, an imperative type variable is a type variable whose second character is a digit, as in <tt>'1a</tt> or <tt>'2b</tt>.  Imperative type variables were used as an alternative to the <a href="ValueRestriction">ValueRestriction</a> in an earlier version of SML, but no longer play a role.  They are treated exactly as other type variables. </div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-29 22:58:32 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/ImplementExceptions
===================================================================
--- mlton/trunk/doc/guide/ImplementExceptions	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/ImplementExceptions	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,72 @@
+<!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>ImplementExceptions - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      ImplementExceptions
+    <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">
+<p>
+An implementation pass for the <a href="SXML">SXML</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="SXMLSimplify">SXMLSimplify</a>. 
+</p>
+<h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Implements exceptions. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/xml/implement-exceptions.sig?view=markup">implement-exceptions.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/xml/implement-exceptions.fun?view=markup">implement-exceptions.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:37:11 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/ImplementHandlers
===================================================================
--- mlton/trunk/doc/guide/ImplementHandlers	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/ImplementHandlers	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,69 @@
+<!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>ImplementHandlers - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      ImplementHandlers
+    <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">
+An implementation pass for the <a href="RSSA">RSSA</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="RSSASimplify">RSSASimplify</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Implements (threaded) exception handler stack. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/backend/implement-handlers.sig?view=markup">implement-handlers.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/backend/implement-handlers.fun?view=markup">implement-handlers.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:36:52 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/ImplementProfiling
===================================================================
--- mlton/trunk/doc/guide/ImplementProfiling	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/ImplementProfiling	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,72 @@
+<!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>ImplementProfiling - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      ImplementProfiling
+    <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">
+An implementation pass for the <a href="RSSA">RSSA</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="RSSASimplify">RSSASimplify</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Implements profiling. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/backend/profile.sig?view=markup">profile.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/backend/profile.fun?view=markup">profile.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+<p>
+See <a href="HowProfilingWorks">HowProfilingWorks</a>. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:36:37 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/ImplementSuffix
===================================================================
--- mlton/trunk/doc/guide/ImplementSuffix	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/ImplementSuffix	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,121 @@
+<!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>ImplementSuffix - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      ImplementSuffix
+    <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">
+<p>
+An implementation pass for the <a href="SXML">SXML</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="SXMLSimplify">SXMLSimplify</a>. 
+</p>
+<h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Implements the <tt>TopLevel_setSuffix</tt> primitive,  which installs a function to exit the program. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/xml/implement-suffix.sig?view=markup">implement-suffix.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/xml/implement-suffix.fun?view=markup">implement-suffix.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+<p>
+ImplementSuffix works by introducing a new <tt>ref</tt> cell to contain the function of type <tt>unit&nbsp;-&gt;&nbsp;unit</tt> that should be called on program exit. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ The following code (appropriately alpha-converted) is appended to the beginning of the <a href="SXML">SXML</a> program: 
+<pre>    val z_0 = 
+      fn a_0 =&gt; 
+      let
+         val x_0 = 
+            "toplevel suffix not installed"
+         val x_1 = 
+            MLton_bug (x_0)
+      in
+         x_1
+      end
+   val topLevelSuffixCell = 
+      Ref_ref (z_0)
+</pre>
+</p>
+</li>
+    <li>
+<p>
+ Any occurence of 
+<pre>   val x_0 = 
+      TopLevel_setSuffix (f_0)
+</pre> is rewritten to 
+<pre>   val x_0 = 
+      Ref_assign (topLevelSuffixCell, f_0)
+</pre>
+</p>
+</li>
+    <li>
+<p>
+ The following code (appropriately alpha-converted) is appended to the end of the <a href="SXML">SXML</a> program: 
+<pre>   val f_0 = 
+      Ref_deref (topLevelSuffixCell)
+   val z_0 = 
+      ()
+   val x_0 = 
+      f_0 z_0
+</pre>
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:36:22 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Index
===================================================================
--- mlton/trunk/doc/guide/Index	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Index	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,343 @@
+<!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>Index - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Index
+    <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">
+There are 291 pages. <p><p><a href="#A">A</a> | <a href="#B">B</a> | <a href="#C">C</a> | <a href="#D">D</a> | <a href="#E">E</a> | <a href="#F">F</a> | <a href="#G">G</a> | <a href="#H">H</a> | <a href="#I">I</a> | <a href="#J">J</a> | <a href="#K">K</a> | <a href="#L">L</a> | <a href="#M">M</a> | <a href="#O">O</a> | <a href="#P">P</a> | <a href="#R">R</a> | <a href="#S">S</a> | <a href="#T">T</a> | <a href="#U">U</a> | <a href="#V">V</a> | <a href="#W">W</a> | <a href="#X">X</a> | <a href="#Z">Z</a><br>
+</p><a name="A"><h3>A</h3></a><a href="AccessControl">AccessControl</a>
+<br><a href="AdmitsEquality">AdmitsEquality</a>
+<br><a href="Alice">Alice</a>
+<br><a href="AllocateRegisters">AllocateRegisters</a>
+<br><a href="AndreiFormiga">AndreiFormiga</a>
+<br><a href="AST">AST</a>
+<a name="B"><h3>B</h3></a><a href="BasisLibrary">BasisLibrary</a>
+<br><a href="Bug">Bug</a>
+<br><a href="Bugs20041109">Bugs20041109</a>
+<a name="C"><h3>C</h3></a><a href="CallGraph">CallGraph</a>
+<br><a href="CallingFromCToSML">CallingFromCToSML</a>
+<br><a href="CallingFromSMLToC">CallingFromSMLToC</a>
+<br><a href="CallingFromSMLToCFunctionPointer">CallingFromSMLToCFunctionPointer</a>
+<br><a href="ChrisClearwater">ChrisClearwater</a>
+<br><a href="Chunkify">Chunkify</a>
+<br><a href="CKitLibrary">CKitLibrary</a>
+<br><a href="Closure">Closure</a>
+<br><a href="ClosureConvert">ClosureConvert</a>
+<br><a href="CommonArg">CommonArg</a>
+<br><a href="CommonBlock">CommonBlock</a>
+<br><a href="CommonSubexp">CommonSubexp</a>
+<br><a href="CompilationManager">CompilationManager</a>
+<br><a href="CompilerOverview">CompilerOverview</a>
+<br><a href="CompileTimeOptions">CompileTimeOptions</a>
+<br><a href="ConcurrentML">ConcurrentML</a>
+<br><a href="ConcurrentMLImplementation">ConcurrentMLImplementation</a>
+<br><a href="ConstantPropagation">ConstantPropagation</a>
+<br><a href="Contact">Contact</a>
+<br><a href="Contify">Contify</a>
+<br><a href="CoreML">CoreML</a>
+<br><a href="CoreMLSimplify">CoreMLSimplify</a>
+<br><a href="CreatingPages">CreatingPages</a>
+<br><a href="Credits">Credits</a>
+<br><a href="CrossCompiling">CrossCompiling</a>
+<a name="D"><h3>D</h3></a><a href="DeadCode">DeadCode</a>
+<br><a href="DeepFlatten">DeepFlatten</a>
+<br><a href="DefineTypeBeforeUse">DefineTypeBeforeUse</a>
+<br><a href="DefinitionOfStandardML">DefinitionOfStandardML</a>
+<br><a href="Defunctorize">Defunctorize</a>
+<br><a href="Developers">Developers</a>
+<br><a href="Development">Development</a>
+<br><a href="Documentation">Documentation</a>
+<br><a href="Drawbacks">Drawbacks</a>
+<a name="E"><h3>E</h3></a><a href="Eclipse">Eclipse</a>
+<br><a href="EditingPages">EditingPages</a>
+<br><a href="Elaborate">Elaborate</a>
+<br><a href="Emacs">Emacs</a>
+<br><a href="Enscript">Enscript</a>
+<br><a href="EqualityType">EqualityType</a>
+<br><a href="EqualityTypeVariable">EqualityTypeVariable</a>
+<br><a href="EXene">EXene</a>
+<br><a href="Experimental">Experimental</a>
+<a name="F"><h3>F</h3></a><a href="FAQ">FAQ</a>
+<br><a href="Features">Features</a>
+<br><a href="FirstClassPolymorphism">FirstClassPolymorphism</a>
+<br><a href="Flatten">Flatten</a>
+<br><a href="ForeignFunctionInterface">ForeignFunctionInterface</a>
+<br><a href="ForeignFunctionInterfaceSyntax">ForeignFunctionInterfaceSyntax</a>
+<br><a href="ForeignFunctionInterfaceTypes">ForeignFunctionInterfaceTypes</a>
+<br><a href="ForLoops">ForLoops</a>
+<br><a href="FrontEnd">FrontEnd</a>
+<br><a href="FunctionalRecordUpdate">FunctionalRecordUpdate</a>
+<a name="G"><h3>G</h3></a><a href="GarbageCollection">GarbageCollection</a>
+<br><a href="GenerativeDatatype">GenerativeDatatype</a>
+<br><a href="GenerativeException">GenerativeException</a>
+<br><a href="Globalize">Globalize</a>
+<br><a href="GnuMP">GnuMP</a>
+<a name="H"><h3>H</h3></a><a href="HaMLet">HaMLet</a>
+<br><a href="HenryCejtin">HenryCejtin</a>
+<br><a href="History">History</a>
+<br><a href="Home">Home</a>
+<br><a href="HowProfilingWorks">HowProfilingWorks</a>
+<a name="I"><h3>I</h3></a><a href="Identifier">Identifier</a>
+<br><a href="Immutable">Immutable</a>
+<br><a href="ImperativeTypeVariable">ImperativeTypeVariable</a>
+<br><a href="ImplementExceptions">ImplementExceptions</a>
+<br><a href="ImplementHandlers">ImplementHandlers</a>
+<br><a href="ImplementProfiling">ImplementProfiling</a>
+<br><a href="ImplementSuffix">ImplementSuffix</a>
+<br><a href="Index">Index</a>
+<br><a href="InfixingOperators">InfixingOperators</a>
+<br><a href="Inline">Inline</a>
+<br><a href="InsertLimitChecks">InsertLimitChecks</a>
+<br><a href="InsertSignalChecks">InsertSignalChecks</a>
+<br><a href="Installation">Installation</a>
+<br><a href="IntermediateLanguage">IntermediateLanguage</a>
+<br><a href="IntroduceLoops">IntroduceLoops</a>
+<a name="J"><h3>J</h3></a><a href="JesperLouisAndersen">JesperLouisAndersen</a>
+<br><a href="JohnnyAndersen">JohnnyAndersen</a>
+<a name="K"><h3>K</h3></a><a href="KnownCase">KnownCase</a>
+<a name="L"><h3>L</h3></a><a href="LambdaFree">LambdaFree</a>
+<br><a href="LanguageChanges">LanguageChanges</a>
+<br><a href="Lazy">Lazy</a>
+<br><a href="Libraries">Libraries</a>
+<br><a href="License">License</a>
+<br><a href="LineDirective">LineDirective</a>
+<br><a href="LocalFlatten">LocalFlatten</a>
+<br><a href="LocalRef">LocalRef</a>
+<br><a href="LoopInvariant">LoopInvariant</a>
+<a name="M"><h3>M</h3></a><a href="Machine">Machine</a>
+<br><a href="ManualPage">ManualPage</a>
+<br><a href="MatchCompilation">MatchCompilation</a>
+<br><a href="MatchCompile">MatchCompile</a>
+<br><a href="MatthewFluet">MatthewFluet</a>
+<br><a href="mGTK">mGTK</a>
+<br><a href="MichaelNorrish">MichaelNorrish</a>
+<br><a href="MikeThomas">MikeThomas</a>
+<br><a href="ML">ML</a>
+<br><a href="MLBasis">MLBasis</a>
+<br><a href="MLBasisAnnotationExamples">MLBasisAnnotationExamples</a>
+<br><a href="MLBasisAnnotations">MLBasisAnnotations</a>
+<br><a href="MLBasisAvailableLibraries">MLBasisAvailableLibraries</a>
+<br><a href="MLBasisExamples">MLBasisExamples</a>
+<br><a href="MLBasisPathMap">MLBasisPathMap</a>
+<br><a href="MLBasisSyntaxAndSemantics">MLBasisSyntaxAndSemantics</a>
+<br><a href="MLj">MLj</a>
+<br><a href="MLKit">MLKit</a>
+<br><a href="MLNLFFI">MLNLFFI</a>
+<br><a href="MLNLFFIImplementation">MLNLFFIImplementation</a>
+<br><a href="MLtonArray">MLtonArray</a>
+<br><a href="MLtonBinIO">MLtonBinIO</a>
+<br><a href="MLtonCont">MLtonCont</a>
+<br><a href="MLtonExn">MLtonExn</a>
+<br><a href="MLtonFinalizable">MLtonFinalizable</a>
+<br><a href="MLtonGC">MLtonGC</a>
+<br><a href="MLtonIntInf">MLtonIntInf</a>
+<br><a href="MLtonIO">MLtonIO</a>
+<br><a href="MLtonItimer">MLtonItimer</a>
+<br><a href="MLtonPlatform">MLtonPlatform</a>
+<br><a href="MLtonPointer">MLtonPointer</a>
+<br><a href="MLtonProcEnv">MLtonProcEnv</a>
+<br><a href="MLtonProcess">MLtonProcess</a>
+<br><a href="MLtonProfile">MLtonProfile</a>
+<br><a href="MLtonRandom">MLtonRandom</a>
+<br><a href="MLtonRlimit">MLtonRlimit</a>
+<br><a href="MLtonRusage">MLtonRusage</a>
+<br><a href="MLtonSignal">MLtonSignal</a>
+<br><a href="MLtonSocket">MLtonSocket</a>
+<br><a href="MLtonStructure">MLtonStructure</a>
+<br><a href="MLtonSyslog">MLtonSyslog</a>
+<br><a href="MLtonTextIO">MLtonTextIO</a>
+<br><a href="MLtonThread">MLtonThread</a>
+<br><a href="MLtonVector">MLtonVector</a>
+<br><a href="MLtonWeak">MLtonWeak</a>
+<br><a href="MLtonWord">MLtonWord</a>
+<br><a href="MLtonWorld">MLtonWorld</a>
+<br><a href="MoinMoin">MoinMoin</a>
+<br><a href="Monomorphise">Monomorphise</a>
+<br><a href="MoscowML">MoscowML</a>
+<br><a href="Multi">Multi</a>
+<br><a href="Mutable">Mutable</a>
+<a name="O"><h3>O</h3></a><a href="ObjectOrientedProgramming">ObjectOrientedProgramming</a>
+<br><a href="OCaml">OCaml</a>
+<br><a href="OpenGL">OpenGL</a>
+<br><a href="OperatorPrecedence">OperatorPrecedence</a>
+<br><a href="OptionalArguments">OptionalArguments</a>
+<br><a href="OrphanedPages">OrphanedPages</a>
+<br><a href="OtherSites">OtherSites</a>
+<br><a href="Overloading">Overloading</a>
+<a name="P"><h3>P</h3></a><a href="PackedRepresentation">PackedRepresentation</a>
+<br><a href="PageSize">PageSize</a>
+<br><a href="Papers">Papers</a>
+<br><a href="ParallelMove">ParallelMove</a>
+<br><a href="Performance">Performance</a>
+<br><a href="PhantomType">PhantomType</a>
+<br><a href="PlatformSpecificNotes">PlatformSpecificNotes</a>
+<br><a href="PolyEqual">PolyEqual</a>
+<br><a href="PolyML">PolyML</a>
+<br><a href="PolymorphicEquality">PolymorphicEquality</a>
+<br><a href="Polyvariance">Polyvariance</a>
+<br><a href="PortingMLton">PortingMLton</a>
+<br><a href="PrecedenceParse">PrecedenceParse</a>
+<br><a href="Printf">Printf</a>
+<br><a href="PrintfGentle">PrintfGentle</a>
+<br><a href="ProductType">ProductType</a>
+<br><a href="Profiling">Profiling</a>
+<br><a href="ProfilingAllocation">ProfilingAllocation</a>
+<br><a href="ProfilingCounts">ProfilingCounts</a>
+<br><a href="ProfilingTheStack">ProfilingTheStack</a>
+<br><a href="ProfilingTime">ProfilingTime</a>
+<br><a href="Projects">Projects</a>
+<br><a href="Pronounce">Pronounce</a>
+<br><a href="PropertyList">PropertyList</a>
+<a name="R"><h3>R</h3></a><a href="RayRacine">RayRacine</a>
+<br><a href="Redundant">Redundant</a>
+<br><a href="RedundantTests">RedundantTests</a>
+<br><a href="References">References</a>
+<br><a href="RefFlatten">RefFlatten</a>
+<br><a href="Regions">Regions</a>
+<br><a href="ReleaseChecklist">ReleaseChecklist</a>
+<br><a href="RemoveUnused">RemoveUnused</a>
+<br><a href="Restore">Restore</a>
+<br><a href="RSSA">RSSA</a>
+<br><a href="RSSAShrink">RSSAShrink</a>
+<br><a href="RSSASimplify">RSSASimplify</a>
+<br><a href="RunningOnCygwin">RunningOnCygwin</a>
+<br><a href="RunningOnDarwin">RunningOnDarwin</a>
+<br><a href="RunningOnFreeBSD">RunningOnFreeBSD</a>
+<br><a href="RunningOnLinux">RunningOnLinux</a>
+<br><a href="RunningOnMinGW">RunningOnMinGW</a>
+<br><a href="RunningOnNetBSD">RunningOnNetBSD</a>
+<br><a href="RunningOnOpenBSD">RunningOnOpenBSD</a>
+<br><a href="RunningOnPowerPC">RunningOnPowerPC</a>
+<br><a href="RunningOnSolaris">RunningOnSolaris</a>
+<br><a href="RunningOnSparc">RunningOnSparc</a>
+<br><a href="RunTimeOptions">RunTimeOptions</a>
+<a name="S"><h3>S</h3></a><a href="ScopeInference">ScopeInference</a>
+<br><a href="SelfCompiling">SelfCompiling</a>
+<br><a href="Serialization">Serialization</a>
+<br><a href="ShowBasis">ShowBasis</a>
+<br><a href="Shrink">Shrink</a>
+<br><a href="SimplifyTypes">SimplifyTypes</a>
+<br><a href="SMLNET">SMLNET</a>
+<br><a href="SMLNJ">SMLNJ</a>
+<br><a href="SMLNJDeviations">SMLNJDeviations</a>
+<br><a href="SMLNJLibrary">SMLNJLibrary</a>
+<br><a href="SMLofNJStructure">SMLofNJStructure</a>
+<br><a href="Sources">Sources</a>
+<br><a href="SpaceSafety">SpaceSafety</a>
+<br><a href="SSA">SSA</a>
+<br><a href="SSA2">SSA2</a>
+<br><a href="SSA2Simplify">SSA2Simplify</a>
+<br><a href="SSASimplify">SSASimplify</a>
+<br><a href="StandardML">StandardML</a>
+<br><a href="StandardMLBooks">StandardMLBooks</a>
+<br><a href="StandardMLHistory">StandardMLHistory</a>
+<br><a href="StandardMLImplementations">StandardMLImplementations</a>
+<br><a href="StandardMLPortability">StandardMLPortability</a>
+<br><a href="StandardMLTutorials">StandardMLTutorials</a>
+<br><a href="StephenWeeks">StephenWeeks</a>
+<br><a href="StyleGuide">StyleGuide</a>
+<br><a href="Subversion">Subversion</a>
+<br><a href="SureshJagannathan">SureshJagannathan</a>
+<br><a href="Survey">Survey</a>
+<br><a href="SurveyDone">SurveyDone</a>
+<br><a href="Swerve">Swerve</a>
+<br><a href="SXML">SXML</a>
+<br><a href="SXMLShrink">SXMLShrink</a>
+<br><a href="SXMLSimplify">SXMLSimplify</a>
+<br><a href="SyntacticConventions">SyntacticConventions</a>
+<br><a href="SystemInfo">SystemInfo</a>
+<a name="T"><h3>T</h3></a><a href="Talk">Talk</a>
+<br><a href="TalkDiveIn">TalkDiveIn</a>
+<br><a href="TalkFolkLore">TalkFolkLore</a>
+<br><a href="TalkFromSMLTo">TalkFromSMLTo</a>
+<br><a href="TalkHowHigherOrder">TalkHowHigherOrder</a>
+<br><a href="TalkHowModules">TalkHowModules</a>
+<br><a href="TalkHowPolymorphism">TalkHowPolymorphism</a>
+<br><a href="TalkMLtonApproach">TalkMLtonApproach</a>
+<br><a href="TalkMLtonFeatures">TalkMLtonFeatures</a>
+<br><a href="TalkMLtonHistory">TalkMLtonHistory</a>
+<br><a href="TalkStandardML">TalkStandardML</a>
+<br><a href="TalkWholeProgram">TalkWholeProgram</a>
+<br><a href="TILT">TILT</a>
+<br><a href="ToMachine">ToMachine</a>
+<br><a href="ToRSSA">ToRSSA</a>
+<br><a href="ToSSA2">ToSSA2</a>
+<br><a href="TrustedGroup">TrustedGroup</a>
+<br><a href="TypeChecking">TypeChecking</a>
+<br><a href="TypeConstructor">TypeConstructor</a>
+<br><a href="TypeVariableScope">TypeVariableScope</a>
+<a name="U"><h3>U</h3></a><a href="Unicode">Unicode</a>
+<br><a href="UniversalType">UniversalType</a>
+<br><a href="UnresolvedBugs">UnresolvedBugs</a>
+<br><a href="UnsafeStructure">UnsafeStructure</a>
+<br><a href="Useless">Useless</a>
+<br><a href="UserGuide">UserGuide</a>
+<br><a href="Users">Users</a>
+<a name="V"><h3>V</h3></a><a href="ValueRestriction">ValueRestriction</a>
+<br><a href="Variant">Variant</a>
+<br><a href="VesaKarvonen">VesaKarvonen</a>
+<a name="W"><h3>W</h3></a><a href="WantedPages">WantedPages</a>
+<br><a href="WebSite">WebSite</a>
+<br><a href="WesleyTerpstra">WesleyTerpstra</a>
+<br><a href="WholeProgramOptimization">WholeProgramOptimization</a>
+<br><a href="WikiMacros">WikiMacros</a>
+<br><a href="WikiName">WikiName</a>
+<br><a href="WikiTool">WikiTool</a>
+<a name="X"><h3>X</h3></a><a href="XML">XML</a>
+<br><a href="XMLShrink">XMLShrink</a>
+<br><a href="XMLSimplify">XMLSimplify</a>
+<br><a href="XMLSimplifyTypes">XMLSimplifyTypes</a>
+<a name="Z"><h3>Z</h3></a><a href="Zone">Zone</a>
+<br><a href="ZZZOrphanedPages">ZZZOrphanedPages</a>
+ </div>
+
+
+
+<p>
+<hr>
+</body></html>

Added: mlton/trunk/doc/guide/InfixingOperators
===================================================================
--- mlton/trunk/doc/guide/InfixingOperators	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/InfixingOperators	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,221 @@
+<!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>InfixingOperators - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      InfixingOperators
+    <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">
+Unlike in <a href="Alice">Alice</a>, fixity specifications are not part of signatures in <a href="StandardML"> Standard ML</a>. When one wants to use a module that provides functions designed to be used as infix operators there are several obvious alternatives: 
+        <ul>
+
+        <li>
+<p>
+ Use only prefix applications. Unfortunately there are situations where   infix applications lead to considerably more readable code. 
+</p>
+</li>
+        <li>
+<p>
+ Make the fixity declarations at the top-level. This may lead to   collisions and may be unsustainable in a large project. Pollution of the   top-level should be avoided. 
+</p>
+</li>
+        <li>
+<p>
+ Make the fixity declarations at each scope where you want to use infix   applications. The duplication becomes inconvenient if the operators are   widely used. Duplication of code should be avoided. 
+</p>
+</li>
+        <li>
+<p>
+ Use non-standard extensions, such as the <a href="MLBasis"> ML Basis system</a>   to control the scope of fixity declarations. This has the obvious   drawback of reduced portability. 
+</p>
+</li>
+
+        </ul>
+
+
+<p>
+None of the obvious alternatives is best in every case. The following describes a slightly less obvious alternative that can sometimes be useful. The idea is to approximate Haskell's special syntax for treating any identifier enclosed in grave accents (backquotes) as an infix operator. In Haskell, instead of writing the prefix application <tt>f&nbsp;x&nbsp;y</tt> one can write the infix application <tt>x&nbsp;`f`&nbsp;y</tt>. 
+</p>
+<h2 id="head-2064441d71938e807c277e86da93e8d294ecdcf1">Infixing operators</h2>
+<p>
+Let's first take a look at the definitions of the operators: 
+<pre class=code>
+<B><FONT COLOR="#A020F0">infix</FONT></B>  3 &lt;\     <B><FONT COLOR="#A020F0">fun</FONT></B> x &lt;\ f = <B><FONT COLOR="#A020F0">fn</FONT></B> y =&gt; f (x, y)     <I><FONT COLOR="#B22222">(* Left section      *)</FONT></I>
+<B><FONT COLOR="#A020F0">infix</FONT></B>  3 \&gt;     <B><FONT COLOR="#A020F0">fun</FONT></B> f \&gt; y = f y                  <I><FONT COLOR="#B22222">(* Left application  *)</FONT></I>
+<B><FONT COLOR="#A020F0">infixr</FONT></B> 3 /&gt;     <B><FONT COLOR="#A020F0">fun</FONT></B> f /&gt; y = <B><FONT COLOR="#A020F0">fn</FONT></B> x =&gt; f (x, y)     <I><FONT COLOR="#B22222">(* Right section     *)</FONT></I>
+<B><FONT COLOR="#A020F0">infixr</FONT></B> 3 &lt;/     <B><FONT COLOR="#A020F0">fun</FONT></B> x &lt;/ f = f x                  <I><FONT COLOR="#B22222">(* Right application *)</FONT></I>
+
+<B><FONT COLOR="#A020F0">infix</FONT></B>  2 o  <I><FONT COLOR="#B22222">(* See motivation below *)</FONT></I>
+<B><FONT COLOR="#A020F0">infix</FONT></B>  0 := 
+</PRE>
+ The left and right sectioning operators, <tt>&lt;\</tt> and <tt>/&gt;</tt>, are useful in SML for partial application of infix operators. <a href = "References#Paulson96"> ML For the Working Programmer</a> describes curried functions <tt>secl</tt> and <tt>secr</tt> for the same purpose on pages 179-181. For example, 
+<pre class=code>
+List.map (<B><FONT COLOR="#A020F0">op</FONT></B>- /&gt; y) 
+</PRE>
+ is a function for subtracting <tt>y</tt> from a list of integers and 
+<pre class=code>
+List.exists (x &lt;\ <B><FONT COLOR="#A020F0">op</FONT></B>=) 
+</PRE>
+ is a function for testing whether a list contains an <tt>x</tt>. 
+</p>
+<p>
+Together with the left and right application operators, <tt>\&gt;</tt> and <tt>&lt;/</tt>, the sectioning operators provide a way to treat any binary function (i.e. a function whose domain is a pair) as an infix operator. In general, 
+<pre>x0 &lt;\f1\&gt; x1 &lt;\f2\&gt; x2 ... &lt;\fN\&gt; xN  =  fN (... f2 (f1 (x0, x1), x2) ..., xN)
+</pre>and 
+<pre>xN &lt;/fN/&gt; ... x2 &lt;/f2/&gt; x1 &lt;/f1/&gt; x0  =  fN (xN, ... f2 (x2, f1 (x1, x0)) ...) </pre>
+</p>
+<h3 id="head-eb01bf04c9a0e8a71c45816513df424f1c7ffedb">Examples</h3>
+<p>
+As a fairly realistic example, consider providing a function for sequencing comparisons: 
+<pre class=code>
+<B><FONT COLOR="#0000FF">structure</FONT></B> Order <I><FONT COLOR="#B22222">(* ... *)</FONT></I> =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <I><FONT COLOR="#B22222">(* ... *)</FONT></I>
+      <B><FONT COLOR="#A020F0">val</FONT></B> orWhenEq = <B><FONT COLOR="#A020F0">fn</FONT></B> (EQUAL, th) =&gt; th ()
+                      | (other,  _) =&gt; other
+      <I><FONT COLOR="#B22222">(* ... *)</FONT></I>
+   <B><FONT COLOR="#0000FF">end</FONT></B> 
+</PRE>
+ Using <tt>orWhenEq</tt> and the infixing operators, one can write a <tt>compare</tt> function for triples as 
+<pre class=code>
+<B><FONT COLOR="#A020F0">fun</FONT></B> compare (fad, fbe, fcf) ((a, b, c), (d, e, f)) =
+    fad (a, d) &lt;\Order.orWhenEq\&gt; `fbe (b, e) &lt;\Order.orWhenEq\&gt; `fcf (c, f)
+</PRE>
+ where <tt>`</tt> is defined as 
+<pre class=code>
+<B><FONT COLOR="#A020F0">fun</FONT></B> `f x = <B><FONT COLOR="#A020F0">fn</FONT></B> () =&gt; f x
+</PRE>
+ Although <tt>orWhenEq</tt> can be convenient (try rewriting the above without it), it is probably not useful enough to be defined at the top level as an infix operator. Fortunately we can use the infixing operators and don't have to. 
+</p>
+<p>
+Another fairly realistic example would be to use the infixing operators with the technique described on the <a href="Printf">Printf</a> page. Assuming that you would have a <tt>Printf</tt> module binding <tt>printf</tt>, <tt>`</tt>, and formatting combinators named <tt>int</tt> and <tt>string</tt>, you could write 
+<pre class=code>
+<B><FONT COLOR="#A020F0">let</FONT></B> <B><FONT COLOR="#0000FF">open</FONT></B> Printf <B><FONT COLOR="#A020F0">in</FONT></B>
+  printf (`<FONT COLOR="#BC8F8F"><B>&quot;Here's an int &quot;</FONT></B>&lt;\int\&gt;<FONT COLOR="#BC8F8F"><B>&quot; and a string &quot;</FONT></B>&lt;\string\&gt;<FONT COLOR="#BC8F8F"><B>&quot;.&quot;</FONT></B>) <B><FONT COLOR="#5F9EA0">13</FONT></B> <FONT COLOR="#BC8F8F"><B>&quot;foo&quot;</FONT></B> <B><FONT COLOR="#A020F0">end</FONT></B> 
+</PRE>
+ without having to duplicate the fixity declarations. Alternatively, you could write 
+<pre class=code>
+P.printf (P.`<FONT COLOR="#BC8F8F"><B>&quot;Here's an int &quot;</FONT></B>&lt;\P.int\&gt;<FONT COLOR="#BC8F8F"><B>&quot; and a string &quot;</FONT></B>&lt;\P.string\&gt;<FONT COLOR="#BC8F8F"><B>&quot;.&quot;</FONT></B>) <B><FONT COLOR="#5F9EA0">13</FONT></B> <FONT COLOR="#BC8F8F"><B>&quot;foo&quot;</FONT></B> 
+</PRE>
+ assuming you have the made the binding 
+<pre class=code>
+<B><FONT COLOR="#0000FF">structure</FONT></B> P = Printf
+</PRE>
+ 
+</p>
+<h2 id="head-cc41911c3699b10c36ceb8fb01f0650a4e0e758d">Application and piping operators</h2>
+<p>
+The left and right application operators may also provide some notational convenience on their own. In general, 
+<pre>f \&gt; x1 \&gt; ... \&gt; xN = f x1 ... xN </pre>and 
+<pre>xN &lt;/ ... &lt;/ x1 &lt;/ f = f x1 ... xN </pre>
+</p>
+<p>
+If nothing else, both of them can eliminate parentheses. For example, 
+<pre class=code>
+foo (<B><FONT COLOR="#5F9EA0">1</FONT></B> + <B><FONT COLOR="#5F9EA0">2</FONT></B>) = foo \&gt; <B><FONT COLOR="#5F9EA0">1</FONT></B> + <B><FONT COLOR="#5F9EA0">2</FONT></B> 
+</PRE>
+ 
+</p>
+<p>
+The left and right application operators are related to operators that could be described as the right and left piping operators: 
+<pre class=code>
+<B><FONT COLOR="#A020F0">infix</FONT></B>  1 &gt;|     <B><FONT COLOR="#A020F0">val</FONT></B> <B><FONT COLOR="#A020F0">op</FONT></B>&gt;| = <B><FONT COLOR="#A020F0">op</FONT></B>&lt;/      <I><FONT COLOR="#B22222">(* Left pipe *)</FONT></I>
+<B><FONT COLOR="#A020F0">infixr</FONT></B> 1 |&lt;     <B><FONT COLOR="#A020F0">val</FONT></B> <B><FONT COLOR="#A020F0">op</FONT></B>|&lt; = <B><FONT COLOR="#A020F0">op</FONT></B>\&gt;      <I><FONT COLOR="#B22222">(* Right pipe *)</FONT></I> 
+</PRE>
+ 
+</p>
+<p>
+As you can see, the left and right piping operators, &gt;| and |&lt;, are the same as the right and left application operators, respectively, except the associativities are reversed and the binding strength is lower. They are useful for piping data trough a sequence of operations. In general, 
+<pre>  x &gt;| f1 &gt;| ... &gt;| fN
+= fN (... (f1 x) ...)
+= (fN o ... o f1) x </pre>and 
+<pre>  fN |&lt; ... |&lt; f1 |&lt; x
+= fN (... (f1 x) ...)
+= (fN o ... o f1) x </pre>
+</p>
+<p>
+The right piping operator, <tt>|&lt;</tt>, is provided by the Haskell prelude as <tt>$</tt>. It can be convenient in CPS or continuation passing style. 
+</p>
+<p>
+A use for the left piping operator is with parsing combinators. In a strict language, like SML, eta-reduction is generally unsafe. Using the left piping operator, parsing functions can be formatted conveniently as 
+<pre class=code>
+<B><FONT COLOR="#A020F0">fun</FONT></B> parsingFunc input =
+   input &gt;| <I><FONT COLOR="#B22222">(* ... *)</FONT></I>
+         || <I><FONT COLOR="#B22222">(* ... *)</FONT></I>
+         || <I><FONT COLOR="#B22222">(* ... *)</FONT></I> 
+</PRE>
+ where <tt>||</tt> is supposed to be a combinator provided by the parsing combinator library. 
+</p>
+<h2 id="head-aacfb4ed5c69ecb1facd0a8a1b5aa3f2e9deeeed">About precedences</h2>
+<p>
+You probably noticed that we redefined the <a href="OperatorPrecedence">precedences</a> of the function composition operator <tt>o</tt> and the assignment operator <tt>:=</tt>. Doing so is not strictly necessary, but can be convenient and should be relatively safe. Consider the following motivating examples from <a href="WesleyTerpstra"> Wesley W. Terpstra</a> relying on the redefined precedences: 
+<pre class=code>
+Word8.fromInt o Char.ord o s &lt;\String.sub
+<I><FONT COLOR="#B22222">(* Combining sectioning and composition *)</FONT></I>
+
+x := s &lt;\String.sub\&gt; i
+<I><FONT COLOR="#B22222">(* Assigning the result of an infixed application *)</FONT></I> 
+</PRE>
+ 
+</p>
+<p>
+In imperative languages, assignment usually has the lowest precedence (ignoring statement separators). The precedence of <tt>:=</tt> in the <a href="BasisLibrary"> Basis library</a> is perhaps unnecessarily high, because an expression of the form <tt>r&nbsp;:=&nbsp;x</tt> always returns a unit, which makes little sense to combine with anything. Dropping <tt>:=</tt> to the lowest precedence level makes it behave more like in other imperative languages. 
+</p>
+<p>
+The case for <tt>o</tt> is different. With the exception of <tt>before</tt> and <tt>:=</tt>, it doesn't seem to make much sense to use <tt>o</tt> with any of the operators defined by the Basis library in an unparenthesized expression. This is simply because none of the other operators deal with functions. It would seem that the precedence of <tt>o</tt> could be chosen completely arbitrarily from the set <tt>{1,&nbsp;...,&nbsp;9</tt>} without having any adverse effects with respect to other infix operators defined by the Basis library. 
+</p>
+<h2 id="head-bb4d2ad8129dd782305f5b40532aa67acfd4581e">Design of the symbols</h2>
+<p>
+The closest approximation of Haskell's <tt>x&nbsp;`f`&nbsp;y</tt> syntax achievable in Standard ML would probably be something like <tt>x&nbsp;`f^&nbsp;y</tt>, but <tt>^</tt> is already used for string concatenation by the Basis library. Other combinations of the characters <tt>`</tt> and <tt>^</tt> would be possible, but none seems clearly the best visually. The symbols <tt>&lt;\</tt>, <tt>\&gt;</tt>, <tt>&lt;/</tt> and <tt>/&gt;</tt> are reasonably concise and have a certain self-documenting appearance and symmetry, which can help to remember them. As the names suggest, the symbols of the piping operators <tt>&gt;|</tt> and <tt>|&lt;</tt> are inspired by Unix shell pipelines. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-07 18:22:19 by <span title="cs78147176.pp.htv.fi"><a href="VesaKarvonen">VesaKarvonen</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Inline
===================================================================
--- mlton/trunk/doc/guide/Inline	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Inline	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,95 @@
+<!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>Inline - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Inline
+    <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">
+<p>
+An optimization pass for the <a href="SSA">SSA</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="SSASimplify">SSASimplify</a>. 
+</p>
+<h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Inline <a href="SSA">SSA</a> functions with a size-based metric. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/inline.sig?view=markup">inline.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/inline.fun?view=markup">inline.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+<p>
+The Inline pass can be invoked to use one of three metrics: 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>NonRecursive(product,&nbsp;small)</tt> -- inline any function satisfying <tt>(numCalls&nbsp;-&nbsp;1)&nbsp;*&nbsp;(size&nbsp;-&nbsp;small)&nbsp;&lt;=&nbsp;product</tt>, where <tt>numCalls</tt> is the static number of calls to the function and <tt>size</tt> is the size of the function. 
+</p>
+</li>
+    <li>
+<p>
+ <tt>Leaf(size)</tt> -- inline any leaf function smaller than <tt>size</tt> 
+</p>
+</li>
+    <li>
+<p>
+ <tt>LeafNoLoop(size)</tt> -- inline any leaf function without loops smaller than <tt>size</tt> 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:36:08 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/InsertLimitChecks
===================================================================
--- mlton/trunk/doc/guide/InsertLimitChecks	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/InsertLimitChecks	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,69 @@
+<!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>InsertLimitChecks - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      InsertLimitChecks
+    <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">
+An implementation pass for the <a href="RSSA">RSSA</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="RSSASimplify">RSSASimplify</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Insert limit checks. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/backend/limit-check.sig?view=markup">limit-check.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/backend/limit-check.fun?view=markup">limit-check.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:35:50 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/InsertSignalChecks
===================================================================
--- mlton/trunk/doc/guide/InsertSignalChecks	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/InsertSignalChecks	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,69 @@
+<!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>InsertSignalChecks - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      InsertSignalChecks
+    <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">
+An implementation pass for the <a href="RSSA">RSSA</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="RSSASimplify">RSSASimplify</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Insert signal checks. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/backend/limit-check.sig?view=markup">limit-check.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/backend/limit-check.fun?view=markup">limit-check.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:35:36 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Installation
===================================================================
--- mlton/trunk/doc/guide/Installation	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Installation	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,164 @@
+<!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>Installation - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Installation
+    <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">
+MLton runs on a variety of platforms and is distributed in both source and binary form.  The format for the binary package depends on the platform.  The binary package will install under <tt>/usr</tt> or <tt>/usr/local</tt>, depending on the platform.  If you install MLton somewhere else, you must set the <tt>lib</tt> variable in the <tt>/usr/bin/mlton</tt> script to the directory that contains the libraries (<tt>/usr/lib/mlton</tt> by default). <p>
+MLton requires that you have the <a class="external" href="http://www.gnu.org/software/gmp/gmp.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">GNU multiprecision library</a> installed on your machine.  MLton must be able to find both the <tt>gmp.h</tt> include file and the <tt>libgmp.a</tt> or <tt>libgmp.so</tt> library. If you see the error message <tt>gmp.h:&nbsp;No&nbsp;such&nbsp;file&nbsp;or&nbsp;directory</tt>, you should copy <tt>gmp.h</tt> to <tt>/usr/lib/mlton/self/include</tt>.  If you see the error message <tt>/usr/bin/ld:&nbsp;cannot&nbsp;find&nbsp;-lgmp</tt>, you should add a <tt>-link-opt&nbsp;-L</tt> argument in the <tt>/usr/bin/mlton</tt> script so that the linker can find <tt>libgmp</tt>.  If, for example, <tt>libgmp.a</tt> is in <tt>/tmp</tt>, then add <tt>-link-opt&nbsp;-L/tmp</tt>. 
+</p>
+<p>
+Installation of MLton creates the following files and directories. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>/usr/bin/mllex</tt> 
+</p>
+</li>
+
+            <ul>
+
+   The <a class="nonexistent" href="MLLex">MLLex</a> lexer generator. 
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>/usr/bin/mlprof</tt> 
+</p>
+</li>
+
+            <ul>
+
+   A <a href="Profiling">Profiling</a> tool. 
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>/usr/bin/mlton</tt> 
+</p>
+</li>
+
+            <ul>
+
+   A script to call the compiler.  This script may be moved anywhere,    however, it makes use of files in <tt>/usr/lib/mlton</tt>.  
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>/usr/bin/mlyacc</tt> 
+</p>
+</li>
+
+            <ul>
+
+   The <a class="nonexistent" href="MLYacc">MLYacc</a> parser generator. 
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>/usr/lib/mlton</tt> 
+</p>
+</li>
+
+            <ul>
+
+   Directory containing libraries and include files needed during    compilation. 
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>/usr/share/man/man1/mllex.1</tt>, <tt>mlprof.1</tt>, <tt>mlton.1</tt>, <tt>mlyacc.1</tt> 
+</p>
+</li>
+
+            <ul>
+
+   Man pages. 
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>/usr/share/doc/mlton</tt> 
+</p>
+</li>
+
+            <ul>
+
+   Directory containing the user guide for MLton, mllex, and mlyacc,    as well as example SML programs (in the <tt>examples</tt> dir), and    license information. 
+            </ul>
+
+
+
+    </ul>
+
+
+<h2 id="head-0a0a9f2a6772942557ab5355d76af442f8f65e01">Hello, World!</h2>
+<p>
+Once you have installed MLton, create a file called <tt>hello-world.sml</tt> with the following contents. 
+</p>
+
+<pre>print "Hello, world!\n";
+</pre>Now create an executable, <tt>hello-world</tt>, with the following command. 
+<pre>mlton hello-world.sml
+</pre>You can now run <tt>hello-world</tt> to verify that it works.  There are more small examples in <tt>/usr/share/doc/mlton/examples</tt>. </div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-01 21:24:12 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/IntermediateLanguage
===================================================================
--- mlton/trunk/doc/guide/IntermediateLanguage	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/IntermediateLanguage	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,104 @@
+<!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>IntermediateLanguage - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      IntermediateLanguage
+    <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">
+MLton uses a number of intermediate languages in translating from the input source program to low-level code.  Here is a list in the order which they are translated to. 
+    <ul>
+
+    <li>
+<p>
+ <a href="AST">AST</a>.  Pretty close to the source. 
+</p>
+</li>
+    <li>
+<p>
+ <a href="CoreML">CoreML</a>.  Explicitly typed, no module constructs. 
+</p>
+</li>
+    <li>
+<p>
+ <a href="XML">XML</a>.  Polymorphic, <a class="nonexistent" href="HigherOrder">HigherOrder</a>. 
+</p>
+</li>
+    <li>
+<p>
+ <a href="SXML">SXML</a>.  <a class="nonexistent" href="SimplyTyped">SimplyTyped</a>, <a class="nonexistent" href="HigherOrder">HigherOrder</a>. 
+</p>
+</li>
+    <li>
+<p>
+ <a href="SSA">SSA</a>.  <a class="nonexistent" href="SimplyTyped">SimplyTyped</a>, <a class="nonexistent" href="FirstOrder">FirstOrder</a>. 
+</p>
+</li>
+    <li>
+<p>
+ <a href="SSA2">SSA2</a>.  <a class="nonexistent" href="SimplyTyped">SimplyTyped</a>, <a class="nonexistent" href="FirstOrder">FirstOrder</a>. 
+</p>
+</li>
+    <li>
+<p>
+ <a href="RSSA">RSSA</a>.  Explicit data representations. 
+</p>
+</li>
+    <li>
+<p>
+ <a href="Machine">Machine</a>.  Untyped register transfer language. 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-29 02:16:14 by <span title="cfs38.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/IntroduceLoops
===================================================================
--- mlton/trunk/doc/guide/IntroduceLoops	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/IntroduceLoops	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,93 @@
+<!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>IntroduceLoops - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      IntroduceLoops
+    <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">
+<p>
+An optimization pass for the <a href="SSA">SSA</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="SSASimplify">SSASimplify</a>. 
+</p>
+<h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Rewrites any <a href="SSA">SSA</a> function that calls itself in tail position into one with a local loop and no self tail calls. 
+</p>
+<p>
+A <a href="SSA">SSA</a> function like 
+<pre>fun F (arg_0, arg_1) = L_0 ()
+  ...
+  L_16 (x_0)
+    ...
+    F (z_0, z_1) Tail
+  ...
+</pre>becomes 
+<pre>fun F (arg_0', arg_1') = loopS_0 ()
+  loopS_0 ()
+    loop_0 (arg_0', arg_1')
+  loop_0 (arg_0, arg_1)
+    L_0 ()
+  ...
+  L_16 (x_0)
+    ...
+    loop_0 (z_0, z_1)
+  ...
+</pre>
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/introduce-loops.sig?view=markup">introduce-loops.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/introduce-loops.fun?view=markup">introduce-loops.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:35:21 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/JesperLouisAndersen
===================================================================
--- mlton/trunk/doc/guide/JesperLouisAndersen	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/JesperLouisAndersen	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,73 @@
+<!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>JesperLouisAndersen - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      JesperLouisAndersen
+    <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">
+<h2 id="head-84dbb47f639fb90536266609d226ad50a637f6c6">Jesper Louis Andersen</h2>
+<p>
+Jesper Louis Andersen is an undergraduate student at DIKU, the department of computer science, Copenhagen university. His contributions to MLton are few, though he has made the port of MLton to the NetBSD and OpenBSD platforms. 
+</p>
+<p>
+His general interests in computer science are compiler theory, language theory, algorithms and datastructures and programming. His assets are his general knowledge of UNIX systems, knowledge of system administration, knowledge of operating system kernels; NetBSD in particular. 
+</p>
+<p>
+He was employed by the university as a system administrator for 2 years, which has set him back somewhat in his studies. Currently he is trying to learn mathematics (real analysis, general topology, complex functional analysis and algebra). 
+</p>
+<hr size="3">
+ <h3 id="head-c4b415806d31fe551386b7c3f4bab76f83708c34">Projects using MLton</h3>
+<h4 id="head-b7b41ebfc9860e752ceb2cf62f8c62046dd5628b">A register allocator</h4>
+For internal use at a compiler course at DIKU. It is written in the literate programming style and implements the <em>Iterated Register Coalescing</em> algorithm by Lal George and Andrew Appel <a class="external" href="http://citeseer.ist.psu.edu/george96iterated.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">http://citeseer.ist.psu.edu/george96iterated.html</a>. The status of the project is that it is unfinished. Most of the basic parts of the algorithm is done, but the interface to the students (simple) datatype takes some conversion. <h4 id="head-4943d3a0e948a3e02da7fc1cb02e9e0be745cb9b">A configuration management system in SML</h4>
+At this time, only loose plans exists for this. The plan is to build a Configuration Management system on the principles of the OpenCM system, see <a class="external" href="http://www.opencm.org/docs.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">http://www.opencm.org/docs.html</a>. The basic idea is to unify "naming" and "identity" into one by uniquely identifying all objects managed in the repository by the use of cryptographic checksums. This mantra guides the rest of the system, providing integrity, accessibility and confidentiality. </div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-06 13:45:22 by <span title="port1015.ds1-ry.adsl.cybercity.dk"><a href="JesperLouisAndersen">JesperLouisAndersen</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/JohnnyAndersen
===================================================================
--- mlton/trunk/doc/guide/JohnnyAndersen	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/JohnnyAndersen	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,66 @@
+<!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>JohnnyAndersen - 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">
+
+
+<link rel="Appendix" title="anoq.jpg" href="http://mlton.org/pages/JohnnyAndersen/attachments/anoq.jpg">
+</head>
+
+<body lang="en" dir="ltr">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      JohnnyAndersen
+    <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">
+Johnny Andersen (aka Anoq of the Sun)  <p>
+Here is a picture in front of the academy building at the University of Athens, Greece, taken in September 2003. 
+</p>
+<p>
+<img src="http://mlton.org/pages/JohnnyAndersen/attachments/anoq.jpg?ts=1098900670" alt="anoq.jpg"> 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-10-27 18:12:11 by <span title="127.0.0.1=eponym">eponym</span>.
+</body></html>

Added: mlton/trunk/doc/guide/KnownCase
===================================================================
--- mlton/trunk/doc/guide/KnownCase	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/KnownCase	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,122 @@
+<!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>KnownCase - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      KnownCase
+    <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">
+<p>
+An optimization pass for the <a href="SSA">SSA</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="SSASimplify">SSASimplify</a>. 
+</p>
+<h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Duplicate and simplify <tt>Case</tt> transfers when the constructor of the scruitinee is known. 
+</p>
+<p>
+Uses <a href="Restore">Restore</a>. 
+</p>
+<p>
+For example, the program 
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> <B><FONT COLOR="#A020F0">rec</FONT></B> last =
+   <B><FONT COLOR="#A020F0">fn</FONT></B> [] =&gt; <B><FONT COLOR="#5F9EA0">0</FONT></B>
+    | [x] =&gt; x
+    | _ :: l =&gt; last l
+
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = <B><FONT COLOR="#5F9EA0">1</FONT></B> + last [<B><FONT COLOR="#5F9EA0">2</FONT></B>, <B><FONT COLOR="#5F9EA0">3</FONT></B>, <B><FONT COLOR="#5F9EA0">4</FONT></B>, <B><FONT COLOR="#5F9EA0">5</FONT></B>, <B><FONT COLOR="#5F9EA0">6</FONT></B>, <B><FONT COLOR="#5F9EA0">7</FONT></B>]
+</PRE>
+ gives rise to the <a href="SSA">SSA</a> function 
+<pre>fun last_0 (x_142) = loopS_1 ()
+  loopS_1 ()
+    loop_11 (x_142)
+  loop_11 (x_143)
+    case x_143 of
+      nil_1 =&gt; L_73 | ::_0 =&gt; L_74
+  L_73 ()
+    return global_5
+  L_74 (x_145, x_144)
+    case x_145 of
+      nil_1 =&gt; L_75 | _ =&gt; L_76
+  L_75 ()
+    return x_144
+  L_76 ()
+    loop_11 (x_145)
+</pre>which is simplified to 
+<pre>fun last_0 (x_142) = loopS_1 ()
+  loopS_1 ()
+    case x_142 of
+      nil_1 =&gt; L_73 | ::_0 =&gt; L_118
+  L_73 ()
+    return global_5
+  L_118 (x_230, x_229)
+    L_74 (x_230, x_229, x_142)
+  L_74 (x_145, x_144, x_232)
+    case x_145 of
+      nil_1 =&gt; L_75 | ::_0 =&gt; L_114
+  L_75 ()
+    return x_144
+  L_114 (x_227, x_226)
+    L_74 (x_227, x_226, x_145)
+</pre>
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/known-case.sig?view=markup">known-case.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/known-case.fun?view=markup">known-case.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+<p>
+One interesting aspect of KnownCase, is that it often has the effect of unrolling list traversals by one iteration, moving the <tt>nil</tt>/<tt>::</tt> check to the end of the loop, rather than the beginning. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:35:00 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/LambdaFree
===================================================================
--- mlton/trunk/doc/guide/LambdaFree	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/LambdaFree	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,80 @@
+<!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>LambdaFree - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      LambdaFree
+    <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">
+An analysis pass for the <a href="SXML">SXML</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="ClosureConvert">ClosureConvert</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Descends the entire <a href="SXML">SXML</a> program and attaches a property to each <tt>Lambda</tt> <tt>PrimExp.t</tt> in the program.  Then, you can use <tt>lambdaFree</tt> and <tt>lambdaRec</tt> to get free variables of that <tt>Lambda</tt>. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/closure-convert/lambda-free.sig?view=markup">lambda-free.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/closure-convert/lambda-free.fun?view=markup">lambda-free.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+<p>
+For <tt>Lambda</tt>s bound in a <tt>Fun</tt> dec, <tt>lambdaFree</tt> gives the union of the frees of the entire group of mutually recursive functions.  Hence, <tt>lambdaFree</tt> for every <tt>Lambda</tt> in a single <tt>Fun</tt> dec is the same. Furthermore, for a <tt>Lambda</tt> bound in a <tt>Fun</tt> dec, <tt>lambdaRec</tt> gives the list of other functions bound in the same dec defining that <tt>Lambda</tt>.  For example: 
+<pre>val rec f = fn x =&gt; ... y ... g ... f ...
+and g = fn z =&gt; ... f ... w ...
+</pre>
+<pre> * lambdaFree(fn x =&gt;) = [y, w]
+ * lambdaFree(fn z =&gt;) = [y, w]
+ * lambdaRec(fn x =&gt;) = [g, f]
+ * lambdaRec(fn z =&gt;) = [f]
+</pre>
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:34:44 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/LanguageChanges
===================================================================
--- mlton/trunk/doc/guide/LanguageChanges	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/LanguageChanges	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,125 @@
+<!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>LanguageChanges - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      LanguageChanges
+    <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">
+We are sometimes asked to modify MLton to change the language it compiles.  In short, we are very conservative about making such changes.  There are a number of reasons for this. 
+    <ul>
+
+    <li>
+<p>
+ The <a href="DefinitionOfStandardML">Definition of Standard ML</a> is an  extremely high standard of specification.  The value of the  Definition would be significantly diluted by changes that are not  specified at an equally high level, and the dilution increases with  the complexity of the language change and its interaction with other  language features.  
+</p>
+</li>
+    <li class="gap">
+<p>
+ The SML community is small and there are a    <a href="StandardMLImplementations">number of SML implementations</a>.  Without  an agreed-upon standard, it becomes very difficult to port programs  between compilers, and the community would be balkanized. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ Our main goal is to enable programmers to be as effective as   possible with MLton/SML.  There are a number of improvements other  than language changes that we could spend our time on that would  provide more benefit to programmers. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ The more the language that MLton compiles changes over time, the  more difficult it is to use MLton as a stable platform for serious  program development. 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+Despite these drawbacks, we have extended SML in a couple of cases. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="ForeignFunctionInterface"> Foreign function interface</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="MLBasis"> ML Basis system</a> 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+We allow these language extensions because they provide functionality that is impossible to achieve without them.  The Definition does not define a foreign function interface.  So, we must either extend the language or greatly restrict the class of programs that can be written.  Similarly, the Definition does not provide a mechanism for namespace control at the module level, making it impossible to deliver packaged libraries and have a hope of users using them without name clashes.  The <a href="MLBasis"> ML Basis system</a> addresses this problem.  We have also provided a formal specification of the ML Basis system at the level of the Definition. 
+</p>
+<h2 id="head-a4bc8bf5caf54b18cea9f58e83dd4acb488deb17">Also see</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="http://mlton.org/pipermail/mlton/2004-August/016165.html">http://mlton.org/pipermail/mlton/2004-August/016165.html</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="http://mlton.org/pipermail/mlton-user/2004-December/000320.html">http://mlton.org/pipermail/mlton-user/2004-December/000320.html</a> 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-28 21:46:52 by <span title="cfs36.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Lazy
===================================================================
--- mlton/trunk/doc/guide/Lazy	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Lazy	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,99 @@
+<!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>Lazy - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Lazy
+    <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">
+In a lazy (or non-strict) language, the arguments to a function are not evaluated before calling the function.  Instead, the arguments are suspended and only evaluated by the function if needed. <p>
+<a href="StandardML">Standard ML</a> is an eager (or strict) language, not a lazy language.  However, it is easy to delay evaluation of an expression in SML by creating a <em>thunk</em>, which is a nullary function.  In SML, a thunk is written <tt>fn&nbsp;()&nbsp;=&gt;&nbsp;e</tt>.  Another essential feature of laziness is <em>memoization</em>, meaning that once a suspended argument is evaluated, subsequent references look up the value.  We can express this in SML with a function that maps a thunk to a memoized thunk. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> LAZY =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">val</FONT></B> lazy: (unit -&gt; 'a) -&gt; unit -&gt; 'a
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<p>
+This is easy to implement in SML. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">structure</FONT></B> Lazy: LAZY =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#A020F0">fun</FONT></B> lazy (th: unit -&gt; 'a): unit -&gt; 'a =
+         <B><FONT COLOR="#A020F0">let</FONT></B>
+            <B><FONT COLOR="#A020F0">val</FONT></B> r: 'a option ref = ref NONE
+         <B><FONT COLOR="#A020F0">in</FONT></B>
+            <B><FONT COLOR="#A020F0">fn</FONT></B> () =&gt;
+            <B><FONT COLOR="#A020F0">case</FONT></B> !r <B><FONT COLOR="#A020F0">of</FONT></B>
+               NONE =&gt;
+                  <B><FONT COLOR="#A020F0">let</FONT></B>
+                     <B><FONT COLOR="#A020F0">val</FONT></B> a = th ()
+                     <B><FONT COLOR="#A020F0">val</FONT></B> () = r := SOME a
+                  <B><FONT COLOR="#A020F0">in</FONT></B>
+                     a
+                  <B><FONT COLOR="#A020F0">end</FONT></B>
+             | SOME a =&gt; a
+         <B><FONT COLOR="#A020F0">end</FONT></B>
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-26 20:33:55 by <span title="cfs36.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Libraries
===================================================================
--- mlton/trunk/doc/guide/Libraries	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Libraries	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,242 @@
+<!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>Libraries - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Libraries
+    <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">
+In theory every strictly conforming Standard ML program should run on MLton.  However, often large SML projects use implementation specific features so some "porting" is required. Here is a partial list of software that is known to run on MLton. 
+    <ul>
+
+    <li>
+<p>
+ Concurrency: <a href="ConcurrentML">ConcurrentML</a> - distributed with MLton 
+</p>
+</li>
+    <li>
+<p>
+ Graphics 
+</p>
+</li>
+
+        <ul>
+
+        <li>
+<p>
+ GTK: <a href="mGTK">mGTK</a>. 
+</p>
+</li>
+        <li>
+<p>
+ <a href="OpenGL">OpenGL</a> 
+</p>
+</li>
+
+        </ul>
+
+
+    <li>
+<p>
+ Lex-like lexer generator: <a class="nonexistent" href="MLLex">MLLex</a> - distributed with MLton. 
+</p>
+</li>
+    <li>
+<p>
+ Regular expressions 
+</p>
+</li>
+
+        <ul>
+
+        <li>
+<p>
+ The <a href="SMLNJLibrary">SMLNJLibrary</a> has a regexp module. 
+</p>
+</li>
+        <li>
+<p>
+ The internal MLton library has a regexp module which we hope to   cleanup and make more accessible someday.   See 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/lib/mlton/basic/regexp.sig?view=markup">regexp.sig</a>
+   
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/lib/mlton/basic/regexp.sml?view=markup">regexp.sml</a>
+ 
+</p>
+</li>
+
+        </ul>
+
+
+    <li>
+<p>
+ <a href="SMLNJLibrary">SMLNJLibrary</a> - distributed with MLton 
+</p>
+</li>
+    <li>
+<p>
+ <a href="CKitLibrary">CKitLibrary</a> - distributed with MLton 
+</p>
+</li>
+    <li>
+<p>
+ <a href="MLNLFFI">MLNLFFI</a> - distributed with MLton 
+</p>
+</li>
+    <li>
+<p>
+ <a class="external" href="http://cvs.sourceforge.net/viewcvs.py/tom7misc/sml-lib/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">sml-lib</a>, a sort  of grab-bag of libraries for MLton and other SML implementations. 
+</p>
+</li>
+    <li>
+<p>
+ <a class="external" href="http://www.twelf.org/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Twelf</a>.  The version in CVS should compile  out of the box. 
+</p>
+</li>
+    <li>
+<p>
+ XML:  <a class="external" href="http://atseidl2.informatik.tu-muenchen.de/~berlea/Fxp/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">fxp</a>,  which has a   <a class="external" href="http://atseidl2.informatik.tu-muenchen.de/~berlea/Fxp/mlton.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">patch</a>  to compile with MLton. 
+</p>
+</li>
+    <li>
+<p>
+ Yacc-like parser generator: <a class="nonexistent" href="MLYacc">MLYacc</a> - distributed with MLton. 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-8d4f7cc0b49938845ad1333cece387d86a6718d7">Ports in progress</h2>
+<p>
+<a href="Contact">Contact</a> us for details on any of these. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a class="nonexistent" href="MLRISC">MLRISC</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a class="nonexistent" href="MLDoc">MLDoc</a> <a class="external" href="http://people.cs.uchicago.edu/~jhr/tools/ml-doc.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">http://people.cs.uchicago.edu/~jhr/tools/ml-doc.html</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="Unicode">Unicode</a> 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-4bab2d8fe13fa6ab57f80098b414f0f734c5dd25">More</h2>
+<p>
+More projects using MLton can be seen on the <a href="Users">Users</a> page. 
+</p>
+<h2 id="head-10bbb90b22ce7897c576b3e926543d9871bd8cfb">Software for SML implementations other than MLton</h2>
+
+    <ul>
+
+    <li>
+<p>
+ PostgreSQL 
+</p>
+</li>
+
+        <ul>
+
+        <li>
+<p>
+ Moscow ML: <a href="http://www.dina.kvl.dk/~sestoft/mosmllib/Postgres.html">http://www.dina.kvl.dk/~sestoft/mosmllib/Postgres.html</a> 
+</p>
+</li>
+        <li>
+<p>
+ SML/NJ NLFFI: <a href="http://smlweb.sourceforge.net/smlsql/">http://smlweb.sourceforge.net/smlsql/</a> 
+</p>
+</li>
+
+        </ul>
+
+
+    <li>
+<p>
+ Web:  
+</p>
+</li>
+
+        <ul>
+
+        <li>
+<p>
+ ML Kit: <a class="external" href="http://www.smlserver.org"><img src="moin-www.png" alt="[WWW]" height="11" width="11">SMLserver</a>    (a plugin for AOLserver) 
+</p>
+</li>
+        <li class="gap">
+<p>
+ Moscow ML: <a class="external" href="http://ellemose.dina.kvl.dk/~sestoft/msp/index.msp"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ML Server Pages</a>   (support for PHP-style CGI scripting) 
+</p>
+</li>
+        <li class="gap">
+<p>
+ SML/NJ: <a class="external" href="http://smlweb.sourceforge.net/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">smlweb</a> 
+</p>
+</li>
+</ul>
+
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:53:41 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/License
===================================================================
--- mlton/trunk/doc/guide/License	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/License	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,97 @@
+<!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>License - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      License
+    <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">
+<h2 id="head-b0a13098285920a28e5300e9af0df4be59e22a41">Web Site</h2>
+In order to allow the maximum freedom for the future use of the content in this web site, we require that contributions to the web site be dedicated to the public domain.  That means that you can only add works that are already in the public domain, or that you must hold the copyright on the work that you agree to dedicate the work to the public domain. <p>
+By contributing to this web site, you agree to dedicate your contribution to the public domain. 
+</p>
+<h2 id="head-9ad052271e0186ed108ab51a2c5684a90c5a025a">Software</h2>
+<p>
+As of 20050812, The MLton software is licensed under the BSD-style license below.  By contributing code to the project, you agree to release the code under this license. 
+</p>
+<p>
+<pre class=code>This is the license for MLton, a whole-program optimizing compiler for
+the Standard ML programming language.  Send comments and questions to
+MLton@mlton.org.
+
+MLton COPYRIGHT NOTICE, LICENSE AND DISCLAIMER.
+
+Copyright (C) 1999-2005 Henry Cejtin, Matthew Fluet, Suresh
+   Jagannathan, and Stephen Weeks.
+Copyright (C) 1997-2000 by the NEC Research Institute
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both the copyright notice and this permission notice and warranty
+disclaimer appear in supporting documentation, and that the name of
+NEC, or any NEC entity not be used in advertising or publicity
+pertaining to distribution of the software without specific, written
+prior permission.
+
+NEC disclaims all warranties with regard to this software, including
+all implied warranties of merchantability and fitness. In no event
+shall NEC be liable for any special, indirect or consequential damages
+or any damages whatsoever resulting from loss of use, data or profits,
+whether in an action of contract, negligence or other tortious action,
+arising out of or in connection with the use or performance of this
+software.
+</PRE>
+ 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-12 17:57:33 by <span title="adsl-64-170-112-117.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/LineDirective
===================================================================
--- mlton/trunk/doc/guide/LineDirective	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/LineDirective	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,59 @@
+<!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>LineDirective - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      LineDirective
+    <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">
+To aid in the debugging of code produced by program generators such as <a class="external" href="http://www.eecs.harvard.edu/~nr/noweb/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Noweb</a>, MLton supports comments with line directives of the form  <tt>&nbsp;(*#line&nbsp;</tt><em>line</em><tt>.</tt><em>col</em><tt>&nbsp;"</tt><em>file</em><tt>"*)</tt>.   Here, <em>line</em> and <em>col</em> are sequences of decimal digits and <em>file</em> is the source file.  A line directive causes the front end to believe that the character following the right parenthesis is at the line and column of the specified file.  A line directive only affects the reporting of error messages and does not affect program semantics (except for functions like <tt>MLton.Exn.history</tt> that report source file positions).  Syntactically invalid line directives are ignored. To prevent incompatibilites with SML, the file name may not contain the character sequence <tt>*)</tt>. </div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-28 19:09:52 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/LocalFlatten
===================================================================
--- mlton/trunk/doc/guide/LocalFlatten	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/LocalFlatten	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,75 @@
+<!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>LocalFlatten - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      LocalFlatten
+    <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">
+<p>
+An optimization pass for the <a href="SSA">SSA</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="SSASimplify">SSASimplify</a>. 
+</p>
+<h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Flatten arguments to <a href="SSA">SSA</a> blocks. 
+</p>
+<p>
+A block argument is flattened as long as it only flows to selects and there is some tuple constructed in this function that flows to it. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/local-flatten.sig?view=markup">local-flatten.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/local-flatten.fun?view=markup">local-flatten.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:33:55 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/LocalRef
===================================================================
--- mlton/trunk/doc/guide/LocalRef	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/LocalRef	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,157 @@
+<!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>LocalRef - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      LocalRef
+    <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">
+<p>
+An optimization pass for the <a href="SSA">SSA</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="SSASimplify">SSASimplify</a>. 
+</p>
+<h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Optimize <tt>ref</tt> cells local to a <a href="SSA">SSA</a> function: 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ global <tt>ref</tt>s only used in one function are moved to the function 
+</p>
+</li>
+    <li>
+<p>
+ <tt>ref</tt>s only created, read from, and written to (i.e., don't escape) are converted into function local variables 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+Uses <a href="Multi">Multi</a> and <a href="Restore">Restore</a>. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/local-ref.sig?view=markup">local-ref.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/local-ref.fun?view=markup">local-ref.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+<p>
+Moving a global <tt>ref</tt> requires the <a href="Multi">Multi</a> analysis, because a global <tt>ref</tt> can only be moved into a function that is executed at most once. 
+</p>
+<p>
+Conversion of non-escaping <tt>ref</tt>s is structured in three phases: 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ analysis -- a variable <tt>r&nbsp;=&nbsp;Ref_ref&nbsp;x</tt> escapes if 
+</p>
+</li>
+
+            <ul>
+
+            <li>
+<p>
+ <tt>r</tt> is used in any context besides <tt>Ref_assign&nbsp;(r,&nbsp;_)</tt> or <tt>Ref_deref&nbsp;r</tt> 
+</p>
+</li>
+            <li>
+<p>
+ all uses <tt>r</tt> reachable from a (direct or indirect) call to <tt>Thread_copyCurrent</tt> are of the same flavor (either <tt>Ref_assign</tt> or <tt>Ref_deref</tt>); this also requires the <a href="Multi">Multi</a> analysis. 
+</p>
+</li>
+
+            </ul>
+
+
+    <li>
+<p>
+ transformation  
+</p>
+</li>
+
+            <ul>
+
+            <li>
+<p>
+ rewrites <tt>r&nbsp;=&nbsp;Ref_ref&nbsp;x</tt> to <tt>r&nbsp;=&nbsp;x</tt> 
+</p>
+</li>
+            <li>
+<p>
+ rewrites <tt>_&nbsp;=&nbsp;Ref_assign&nbsp;(r,&nbsp;y)</tt> to <tt>r&nbsp;=&nbsp;y</tt> 
+</p>
+</li>
+            <li>
+<p>
+ rewrites <tt>z&nbsp;=&nbsp;Ref_deref&nbsp;r</tt> to <tt>z&nbsp;=&nbsp;r</tt>    Note that the resulting program violates the <strong></strong>SSA<strong></strong> condition. 
+</p>
+</li>
+
+            </ul>
+
+
+    <li>
+<p>
+ <a href="Restore">Restore</a> -- restore the <strong></strong>SSA<strong></strong> condition. 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:33:39 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/LoopInvariant
===================================================================
--- mlton/trunk/doc/guide/LoopInvariant	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/LoopInvariant	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,86 @@
+<!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>LoopInvariant - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      LoopInvariant
+    <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">
+<p>
+An optimization pass for the <a href="SSA">SSA</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="SSASimplify">SSASimplify</a>. 
+</p>
+<h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Remove loop invariant arguments to local loops. 
+</p>
+
+<pre>  loop (x, y)
+    ...
+  ... 
+    loop (x, z) 
+  ...
+</pre>becomes 
+<pre>  loop' (x, y)
+    loop (y)
+  loop (y)
+    ...
+  ...
+    loop (z)
+  ...
+</pre><h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/loop-invariant.sig?view=markup">loop-invariant.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/loop-invariant.fun?view=markup">loop-invariant.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:33:24 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/ML
===================================================================
--- mlton/trunk/doc/guide/ML	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/ML	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,59 @@
+<!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>ML - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      ML
+    <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">
+ML stands for <em>meta language</em>.  ML was originally designed in the 1970s as a programming language to assist theorem proving in the logic LCF.  In the 1980s, ML split into two variants,  <a href="StandardML">Standard ML</a> and <a href="OCaml">OCaml</a>, both of which are still used today. </div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-06 06:00:35 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MLBasis
===================================================================
--- mlton/trunk/doc/guide/MLBasis	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MLBasis	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,124 @@
+<!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>MLBasis - 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">
+
+
+<link rel="Appendix" title="mlb-formal.pdf" href="http://mlton.org/pages/MLBasis/attachments/mlb-formal.pdf">
+</head>
+
+<body lang="en" dir="ltr">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MLBasis
+    <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 ML Basis system extends Standard ML to support programming-in-the-very-large, namespace management at the module level, separate delivery of library sources, and more.  While Standard ML modules are a sophisticated language for programming-in-the-large, it is difficult, if not impossible, to accomplish a number of routine namespace management operations when a program draws upon multiple libraries provided by different vendors.   <p>
+The ML Basis system is a simple, yet powerful, approach that builds upon the programmer's intuitive notion (and the <a href="DefinitionOfStandardML"> Definition of Standard ML's</a> formal notion) of the top-level environment (a <em>basis</em>).  The system has been designed to be a natural extension of <a href="StandardML"> Standard ML</a>; the Formal Specification of the ML Basis system (<a href="http://mlton.org/pages/MLBasis/attachments/mlb-formal.pdf">pdf</a>) is given in the style of the Definition. 
+</p>
+<p>
+Here are some of the key features of the ML Basis system: 
+</p>
+
+    <ol type="1">
+
+    <li>
+<p>
+Explicit file order: The order of files (and, hence, the order  of evaluation) in the program is explicit.  The ML Basis system's semantics are  structured in such a way that for any well-formed project, there  will be exactly one possible interpretation of the project's syntax,  static semantics, and dynamic semantics. 
+</p>
+</li>
+    <li class="gap">
+<p>
+Implicit dependencies: A source file (corresponding to a SML  top-level declaration) is elaborated in the environment described by  preceding declarations.  It is not necessary to explicitly list the  dependencies of a file. 
+</p>
+</li>
+    <li class="gap">
+<p>
+Scoping and renaming: The ML Basis system provides mechanisms for limiting the  scope of (i.e, hiding) and renaming identifiers. 
+</p>
+</li>
+    <li class="gap">
+<p>
+No file name convention: The ML Basis system assumes no convention for finding  the file that defines a module.  (Conversely, to import a module,  its defining file must appear in the project.) 
+</p>
+</li>
+
+    </ol>
+
+
+<h2 id="head-11fc14203dd0f4441645a9c34d5dd022905f56e4">Next steps</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="MLBasisSyntaxAndSemantics">MLBasisSyntaxAndSemantics</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="MLBasisExamples">MLBasisExamples</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="MLBasisPathMap">MLBasisPathMap</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="MLBasisAnnotations">MLBasisAnnotations</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="MLBasisAvailableLibraries">MLBasisAvailableLibraries</a> 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-29 01:32:39 by <span title="adsl-64-170-112-189.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MLBasisAnnotationExamples
===================================================================
--- mlton/trunk/doc/guide/MLBasisAnnotationExamples	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MLBasisAnnotationExamples	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,100 @@
+<!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>MLBasisAnnotationExamples - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MLBasisAnnotationExamples
+    <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">
+Here are some example uses of <a href="MLBasisAnnotations">MLBasisAnnotations</a>. <h2 id="head-1152ecc106cfaf7f85015d0ff747fb60937f1498">Eliminate spurious warnings in automatically generated code</h2>
+<p>
+Programs that automatically generate source code can often produce nonexhaustive matches, relying upon invariants of the generated code to ensure that the matches never fail.  A programmer may wish to elide the nonexhaustive match warnings from this code, in order that legitimate warnings are not missed in a flurry of false positives.  To do so, the programmer simply annotates the generated code with the <tt>nonexhaustiveMatch&nbsp;ignore</tt> annotation: 
+<pre>local
+  $(GEN_ROOT)/gen-lib.mlb
+
+  ann "nonexhaustiveMatch ignore" in
+    foo.gen.sml
+  end
+in
+  signature FOO
+  structure Foo
+end
+</pre>
+</p>
+<h2 id="head-ca0798eb6a561e7bad74e00fdaeec1e2d7d9dec3">Deliver a library</h2>
+<p>
+Standard ML libraries can be delivered via <tt>.mlb</tt> files.  Authors of such libraries should strive to be mindful of the ways in which programmers may choose to compile their programs.  For example, although the defaults for <tt>sequenceUnit</tt> and <tt>warnUnused</tt> are <tt>false</tt>, periodically compiling with these annotations defaulted to <tt>true</tt> can help uncover likely bugs.  However, a programmer is unlikely to be interested in unused modules from an imported library, and the behavior of <tt>sequenceUnit&nbsp;true</tt> may be incompatible with some libraries.  Hence, a library author may choose to deliver a library as follows: 
+<pre>ann 
+  "nonexhaustiveMatch warn" "redundantMatch warn"
+  "sequenceNonUnit warn"
+  "warnUnused true" "forceUsed"
+in
+  local
+    file1.sml
+    ...
+    filen.sml
+  in
+    functor F1
+    ...
+    signature S1
+    ...
+    structure SN
+    ...
+  end
+end
+</pre>
+</p>
+<p>
+The annotations <tt>nonexhaustiveMatch&nbsp;warn</tt>,  <tt>redundantMatch&nbsp;warn</tt>, and <tt>sequenceNonUnit&nbsp;warn</tt> have the obvious effect on elaboration.  The annotations <tt>warnUnused&nbsp;true</tt> and <tt>forceUsed</tt> work in conjunction --- warning on any identifiers that do not contribute to the exported modules, and preventing warnings on exported modules that are not used in the remainder of the program.  Many of the <a href="MLBasisAvailableLibraries">available libraries</a> are delivered with these annotations. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-07 22:08:02 by <span title="pool-71-243-10-187.bos.east.verizon.net"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MLBasisAnnotations
===================================================================
--- mlton/trunk/doc/guide/MLBasisAnnotations	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MLBasisAnnotations	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,152 @@
+<!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>MLBasisAnnotations - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MLBasisAnnotations
+    <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">
+<a href="MLBasis">ML Basis</a> annotations control options that affect the elaboration of SML source files.  Conceptually, a basis file is elaborated in a default annotation environment (just as it is elaborated in an empty basis).  The declaration <tt>ann&nbsp;</tt><tt>"</tt><em>ann</em><tt>"</tt><tt>&nbsp;in&nbsp;</tt><em>basdec</em><tt>&nbsp;end</tt> merges the annotation <em>ann</em> with the "current" annotation environment for the elaboration of <em>basdec</em>. To allow for future expansion, <tt>"</tt><em>ann</em><tt>"</tt> is lexed as  a single SML string constant.  To conveniently specify multiple  annotations, the following derived form is provided: 
+<div>
+<table>
+<tr>
+<td>
+<tt>ann&nbsp;</tt><tt>"</tt><em>ann</em><tt>"</tt><tt>&nbsp;</tt>(<tt>"</tt><em>ann</em><tt>"</tt>)+<tt>&nbsp;in&nbsp;</tt><em>basdec</em><tt>&nbsp;end</tt><tt>&nbsp;==&gt;&nbsp;</tt> <tt>ann&nbsp;</tt><tt>"</tt><em>ann</em><tt>"</tt><tt>&nbsp;in&nbsp;ann&nbsp;</tt>(<tt>"</tt><em>ann</em><tt>"</tt>)+<tt>&nbsp;in&nbsp;</tt><em>basdec</em><tt>&nbsp;end</tt><tt>&nbsp;end</tt></td>
+</tr>
+</table>
+</div>
+<p>
+Here are the available annotations.  In the explanation below, for annotations that take  argument, the first value listed is the default. 
+</p>
+<p>
+<tt>allowFFI&nbsp;{false|true}&nbsp;</tt> 
+</p>
+
+        <ul>
+
+  If <tt>true</tt>, allow <tt>_address</tt>,<tt>_export</tt>,<tt>_import</tt>, and   <tt>_symbol</tt> expressions to appear in source files. 
+        </ul>
+
+
+<p>
+<tt>forceUsed&nbsp;</tt> 
+</p>
+
+        <ul>
+
+  Force all identifiers in the basis denoted by the body of the   <tt>ann</tt> to be considered used; use in conjunction with    <tt>warnUnused&nbsp;true</tt>. 
+        </ul>
+
+
+<p>
+<tt>nonexhaustiveExnMatch&nbsp;{default|ignore}&nbsp;</tt> 
+</p>
+
+        <ul>
+
+  If <tt>ignore</tt>, suppress errors and warnings about nonexhaustive   matches that arise solely from unmatched exceptions.  If   <tt>default</tt>, follow the behavior of <tt>nonexhaustiveMatch</tt>.  
+        </ul>
+
+
+<p>
+<tt>nonexhaustiveMatch&nbsp;{warn|error|ignore}&nbsp;</tt> 
+</p>
+
+        <ul>
+
+  If <tt>error</tt> or <tt>warn</tt>, report nonexhaustive matches.  (An   error will abort a compile, while a warning will not.) 
+        </ul>
+
+
+<p>
+<tt>redundantMatch&nbsp;{warn|error|ignore}&nbsp;</tt> 
+</p>
+
+        <ul>
+
+  If <tt>error</tt> or <tt>warn</tt>, report redundant matches.  (An   error will abort a compile, while a warning will not.) 
+        </ul>
+
+
+<p>
+<tt>sequenceNonUnit&nbsp;{ignore|error|warn}&nbsp;</tt> 
+</p>
+
+        <ul>
+
+  If <tt>error</tt> or <tt>warn</tt>, report when <tt>e1</tt> is not of type   <tt>unit</tt> in the sequence expression <tt>(e1;&nbsp;e2)</tt>.  This can be   helpful in detecting curried applications that are mistakenly not   fully applied.  To silence spurious messages, you can use    <tt>ignore&nbsp;e1</tt>. 
+        </ul>
+
+
+<p>
+<tt>warnUnused&nbsp;{false|true}&nbsp;</tt> 
+</p>
+
+        <ul>
+
+  Report unused identifiers. 
+        </ul>
+
+
+<h2 id="head-3f170caead65df254d786032a409a6f6d204bca6">Next Steps</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="MLBasisAnnotationExamples">MLBasisAnnotationExamples</a> 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-07 22:07:24 by <span title="pool-71-243-10-187.bos.east.verizon.net"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MLBasisAvailableLibraries
===================================================================
--- mlton/trunk/doc/guide/MLBasisAvailableLibraries	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MLBasisAvailableLibraries	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,201 @@
+<!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>MLBasisAvailableLibraries - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MLBasisAvailableLibraries
+    <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">
+MLton comes with the following <a href="MLBasis">ML Basis</a> files available. <p>
+<tt>$(MLTON_ROOT)/basis/basis.mlb</tt> 
+</p>
+
+        <ul>
+
+  The <a href="BasisLibrary"> Standard ML Basis Library</a>. 
+        </ul>
+
+
+<p>
+<tt>$(MLTON_ROOT)/basis/basis-1997.mlb</tt> 
+</p>
+
+        <ul>
+
+  The (deprecated) 1997 specification of the <a href="BasisLibrary"> Standard ML Basis Library</a>. 
+        </ul>
+
+
+<p>
+<tt>$(MLTON_ROOT)/basis/mlton.mlb</tt> 
+</p>
+
+        <ul>
+
+  The <a href="MLtonStructure">MLton</a> structure and signatures. 
+        </ul>
+
+
+<p>
+<tt>$(MLTON_ROOT)/basis/sml-nj.mlb</tt> 
+</p>
+
+        <ul>
+
+  The <a href="SMLofNJStructure">SMLofNJ</a> structure and signature. 
+        </ul>
+
+
+<p>
+<tt>$(MLTON_ROOT)/basis/unsafe.mlb</tt> 
+</p>
+
+        <ul>
+
+  The <a href="UnsafeStructure">Unsafe</a> structure and signature. 
+        </ul>
+
+
+<p>
+<tt>$(MLTON_ROOT)/mlyacc-lib/mlyacc-lib.mlb</tt> 
+</p>
+
+        <ul>
+
+  Modules used by parsers built with <a class="nonexistent" href="MLYacc">MLYacc</a>. 
+        </ul>
+
+
+<p>
+<tt>$(MLTON_ROOT)/cml/cml.mlb</tt> 
+</p>
+
+        <ul>
+
+  <a href="ConcurrentML">ConcurrentML</a>, a library for message-passing concurrency. 
+        </ul>
+
+
+<h2 id="head-b5773a8c56013cd129e0fe857d8a7d13604efcc0">Basis fragments</h2>
+<p>
+There are a number of specialized ML Basis files for importing fragments of the <a href="BasisLibrary"> Basis Library</a> that can not be expressed within SML. 
+</p>
+<p>
+<tt>$(MLTON_ROOT)/basis/pervasive-types.mlb</tt> 
+</p>
+
+        <ul>
+
+  The top-level types and constructors] of the Basis Library. 
+        </ul>
+
+
+<p>
+<tt>$(MLTON_ROOT)/basis/pervasive-exns.mlb</tt> 
+</p>
+
+        <ul>
+
+  The top-level exception constructors of the Basis Library. 
+        </ul>
+
+
+<p>
+<tt>$(MLTON_ROOT)/basis/pervasive-vals.mlb</tt> 
+</p>
+
+        <ul>
+
+  The top-level values of the Basis Library, without infix status. 
+        </ul>
+
+
+<p>
+<tt>$(MLTON_ROOT)/basis/overloads.mlb</tt> 
+</p>
+
+        <ul>
+
+  The top-level overloaded values of the Basis Library, without infix   status. 
+        </ul>
+
+
+<p>
+<tt>$(MLTON_ROOT)/basis/equal.mlb</tt> 
+</p>
+
+        <ul>
+
+  The polymorphic equality <tt>=</tt> and inequality <tt>&lt;&gt;</tt> values,   without infix status.  
+        </ul>
+
+
+<p>
+<tt>$(MLTON_ROOT)/basis/infixes.mlb</tt> 
+</p>
+
+        <ul>
+
+  The infix declarations of the Basis Library. 
+        </ul>
+
+
+<p>
+<tt>$(MLTON_ROOT)/basis/pervasive.mlb</tt> 
+</p>
+
+        <ul>
+
+  The entire top-level environment of the Basis Library, with infix   status.  </ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-28 21:46:15 by <span title="cfs36.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MLBasisExamples
===================================================================
--- mlton/trunk/doc/guide/MLBasisExamples	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MLBasisExamples	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,273 @@
+<!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>MLBasisExamples - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MLBasisExamples
+    <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">
+Here are some example uses of <a href="MLBasis">ML Basis</a> files. <h2 id="head-47367b6e18a7e13a70299d934342eaad85f98a84">Complete program</h2>
+Suppose your complete program consists of the files <tt>file1.sml</tt>, ..., <tt>filen.sml</tt>, which depend upon libraries <tt>lib1.mlb</tt>, ..., <tt>libm.mlb</tt>. 
+<pre>(* import libraries *)
+lib1.mlb
+...
+libm.mlb
+
+(* program files *)
+file1.sml
+...
+filen.sml
+</pre><p>
+The bases denoted by <tt>lib1.mlb</tt>, ..., <tt>libm.mlb</tt> are merged (bindings of names in later bases take precedence over bindings of the same name in earlier bases), producing a basis in which <tt>file1.sml</tt>, ..., <tt>filen.sml</tt> are elaborated, possibly adding additional bindings to the basis. 
+</p>
+<h2 id="head-bbdea99ed8fa0bf96f01819de00940a9a5bd15df">Export filter</h2>
+<p>
+Suppose you only want to export certain structures, signatures, and functors from a collection of files. 
+</p>
+
+<pre>local
+  file1.sml
+  ...
+  filen.sml
+in
+  (* export filter here *)
+  functor F
+  structure S
+end
+</pre><p>
+While <tt>file1.sml</tt>, ..., <tt>filen.sml</tt> may declare top-level identifiers in addition to <tt>F</tt> and <tt>S</tt>, such names are not accessible to programs and libraries that import this <tt>.mlb</tt>. 
+</p>
+<h2 id="head-109e200ced2bf5d4c6ce6619a4e1f67caf0b81a5">Export filter with renaming</h2>
+<p>
+Suppose you want an export filter, but want to rename one of the modules. 
+</p>
+
+<pre>local
+  file1.sml
+  ...
+  filen.sml
+in
+  (* export filter, with renaming, here *)
+  functor F
+  structure S' = S
+end
+</pre><p>
+Note that <tt>functor&nbsp;F</tt> is an abbreviation for <tt>functor&nbsp;F&nbsp;=&nbsp;F</tt>, which simply exports an identifier under the same name. 
+</p>
+<h2 id="head-f266e8ecbc717ff659224d8ad3a7d4a937429adb">Import filter</h2>
+<p>
+Suppose you only want to import a functor <tt>F</tt> from one library and a structure <tt>S</tt> from another library. 
+</p>
+
+<pre>local
+  lib1.mlb
+in
+  (* import filter here *)
+  functor F
+end
+local
+  lib2.mlb
+in
+  (* import filter here *)
+  structure S
+end
+file1.sml
+...
+filen.sml
+</pre><h2 id="head-90f8bc63c1e2a572a4d5c05af4cd2c6c8ebd0080">Import filter with renaming</h2>
+<p>
+Suppose you want to import a structure <tt>S</tt> from one library and another structure <tt>S</tt> from another library. 
+</p>
+
+<pre>local
+  lib1.mlb
+in
+  (* import filter, with renaming, here *)
+  structure S1 = S
+end
+local
+  lib2.mlb
+in
+  (* import filter, with renaming, here *)
+  structure S2 = S
+end
+file1.sml
+...
+filen.sml
+</pre><h2 id="head-b0df1400a6248030b137c5676e8feb1a2195343d">Full Basis</h2>
+<p>
+Since the Modules level of SML is the natural means for organizing program and library components, MLB files provide convenient syntax for renaming Modules level identifiers (in fact, renaming of functor identifiers provides a mechanism that is not available in SML). However, please note that <tt>.mlb</tt> files elaborate to full bases including top-level types and values (including infix status), in addition to structures, signatures, and functors.  For example, suppose you wished to extend the <a href="BasisLibrary"> SML Basis Library</a> with an <tt>('a,&nbsp;'b)&nbsp;either</tt> datatype corresponding to a disjoint sum; the type and some operations should be available at the top-level; additionally, a signature and structure provide the complete interface. 
+</p>
+<p>
+We could use the following files. 
+</p>
+<p>
+<tt>either-sigs.sml</tt> 
+</p>
+
+    <ul>
+
+ 
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> EITHER_GLOBAL =
+  <B><FONT COLOR="#0000FF">sig</FONT></B>
+    <B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> ('a, 'b) either </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">Left</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> 'a </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">Right</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> 'b
+    </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> &amp;  : ('a -&gt; 'c) * ('b -&gt; 'c) -&gt; ('a, 'b) either -&gt; 'c
+    <B><FONT COLOR="#A020F0">val</FONT></B> &amp;&amp; : ('a -&gt; 'c) * ('b -&gt; 'd) -&gt; ('a, 'b) either -&gt; ('c, 'd) either
+  <B><FONT COLOR="#0000FF">end</FONT></B>
+
+<B><FONT COLOR="#0000FF">signature</FONT></B> EITHER =
+  <B><FONT COLOR="#0000FF">sig</FONT></B>
+    <B><FONT COLOR="#0000FF">include</FONT></B> EITHER_GLOBAL
+    <B><FONT COLOR="#A020F0">val</FONT></B> isLeft  : ('a, 'b) either -&gt; bool
+    <B><FONT COLOR="#A020F0">val</FONT></B> isRight : ('a, 'b) either -&gt; bool
+    ...
+  <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+
+    </ul>
+
+
+<p>
+<tt>either-strs.sml</tt> 
+</p>
+
+    <ul>
+
+ 
+<pre class=code>
+<B><FONT COLOR="#0000FF">structure</FONT></B> Either : EITHER =
+  <B><FONT COLOR="#0000FF">struct</FONT></B>
+    <B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> ('a, 'b) either </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">Left</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> 'a </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">Right</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> 'b
+    </FONT></B><B><FONT COLOR="#A020F0">fun</FONT></B> f &amp; g = <B><FONT COLOR="#A020F0">fn</FONT></B> x =&gt;
+      <B><FONT COLOR="#A020F0">case</FONT></B> x <B><FONT COLOR="#A020F0">of</FONT></B> Left z =&gt; f z | Right z =&gt; g z
+    <B><FONT COLOR="#A020F0">fun</FONT></B> f &amp;&amp; g = <B><FONT COLOR="#A020F0">fn</FONT></B> x =&gt;
+      ((Left o f) &amp; (Right o g)) x
+    <B><FONT COLOR="#A020F0">fun</FONT></B> isLeft x = ((<B><FONT COLOR="#A020F0">fn</FONT></B> _ =&gt; true) &amp; (<B><FONT COLOR="#A020F0">fn</FONT></B> _ =&gt; false)) x
+    <B><FONT COLOR="#A020F0">fun</FONT></B> isRight x = (not o isLeft) x
+    ...
+  <B><FONT COLOR="#0000FF">end</FONT></B>
+<B><FONT COLOR="#0000FF">structure</FONT></B> EitherGlobal : EITHER_GLOBAL = Either
+</PRE>
+<p>
+ 
+</p>
+
+    </ul>
+
+
+<p>
+<tt>either-infixes.sml</tt> 
+</p>
+
+    <ul>
+
+ 
+<pre class=code>
+<B><FONT COLOR="#A020F0">infixr</FONT></B> 3 &amp; &amp;&amp;
+</PRE>
+<p>
+ 
+</p>
+
+    </ul>
+
+
+<p>
+<tt>either-open.sml</tt> 
+</p>
+
+    <ul>
+
+ 
+<pre class=code>
+<B><FONT COLOR="#0000FF">open</FONT></B> EitherGlobal
+</PRE>
+<p>
+ 
+</p>
+
+    </ul>
+
+
+<p>
+<tt>either.mlb</tt> 
+</p>
+
+    <ul>
+
+ 
+<pre>local
+  (* import Basis Library *)
+  $(SML_LIB)/basis/basis.mlb
+
+  either-sigs.sml
+  either-infixes.sml
+  either-strs.sml
+in
+  signature EITHER
+  structure Either
+  either-infixes.sml
+  either-open.sml
+end
+</pre>
+    </ul>
+
+
+<p>
+A client that imports <tt>either.mlb</tt> will have access to neither <tt>EITHER_GLOBAL</tt> nor <tt>EitherGlobal</tt>, but will have access to the type <tt>either</tt> and the values <tt>&amp;</tt> and <tt>&amp;&amp;</tt> (with infix status) in the top-level environment.  Note that the infix directive in <tt>either-infixes.sml</tt> is repeated, because <tt>local</tt> limits limits the scope of the directive.  Although the repetition is unfortunate, it is preferable to repeat <tt>either-infixes.sml</tt> in <tt>either.mlb</tt>, rather than require every client of <tt>either.mlb</tt> to also import <tt>either-infixes.sml</tt>. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-28 21:46:04 by <span title="cfs36.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MLBasisPathMap
===================================================================
--- mlton/trunk/doc/guide/MLBasisPathMap	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MLBasisPathMap	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,77 @@
+<!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>MLBasisPathMap - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MLBasisPathMap
+    <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">
+An <a href="MLBasis">ML Basis</a> <em>path map</em> describes a map from ML Basis path variables (of the form <tt>$(VAR)</tt>) to file system paths.  ML Basis path variables to provide a flexible way to refer to libraries while allowing them to be moved without changing their clients. <p>
+The format of an <tt>mlb-path-map</tt> file is a sequence of lines; each line consists of two, white-space delimited tokens.  The first token is a path variable <tt>VAR</tt> and the second token is the path to which the variable is mapped.  The path may include path variables, which are recursively expanded. 
+</p>
+<p>
+The mapping from path variables to paths is initialized by reading  a system-wide configuration file: <tt>/usr/lib/mlton/mlb-path-map</tt>. Additional path maps can be specified with <tt>-mlb-path-map</tt>. Configuration files are processed from first to last and from top to bottom, later mappings take precedence over earlier mappings. 
+</p>
+<p>
+The system-wide configuration file makes the following path variables available. 
+</p>
+
+<pre>LIB_MLTON_DIR   /usr/lib/mlton
+SML_LIB         $(LIB_MLTON_DIR)/sml
+</pre><h2 id="head-a283e7658f43ceca065ff16e5fc5a2383c955359">Changes since the current public release</h2>
+<p>
+Since the release of MLton 20041109, we have switched from <tt>MLTON_ROOT</tt> to <tt>SML_LIB</tt>, to use a more compiler neutral name, since at least one other SML compiler (the <a href="MLKit">MLKit</a>) is in the process of adding support for MLB files.  You can add an entry like the following to either your personal path map or to the system-wide path map, and begin to migrate to the new name immediately. 
+</p>
+
+<pre>SML_LIB $(MLTON_ROOT)
+</pre></div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-09-05 21:54:46 by <span title="adsl-64-166-225-193.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MLBasisSyntaxAndSemantics
===================================================================
--- mlton/trunk/doc/guide/MLBasisSyntaxAndSemantics	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MLBasisSyntaxAndSemantics	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,159 @@
+<!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>MLBasisSyntaxAndSemantics - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MLBasisSyntaxAndSemantics
+    <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">
+An <a href="MLBasis">ML Basis</a> (MLB) file describes a library or program.  An MLB file should have the <tt>.mlb</tt> suffix and should contain a basis declaration, which must be one of the following forms. 
+    <ul>
+
+    <li>
+<p>
+ <tt>basis&nbsp;</tt><em>basid<tt>&nbsp;=&nbsp;</tt>basexp</em>  (<tt>and&nbsp;</tt><em>basid</em><tt>&nbsp;=&nbsp;</tt><em>basexp</em>)* 
+</p>
+</li>
+    <li>
+<p>
+ <tt>open&nbsp;</tt><em>basid<sub>1</sub></em> ... <em>basid<sub>n</sub></em> 
+</p>
+</li>
+    <li>
+<p>
+ <tt>local&nbsp;</tt><em>basdec</em><tt>&nbsp;in&nbsp;</tt><em>basdec</em><tt>&nbsp;end</tt> 
+</p>
+</li>
+    <li>
+<p>
+ <em>basdec</em> [<tt>;</tt>] <em>basdec</em> 
+</p>
+</li>
+    <li>
+<p>
+ <tt>structure&nbsp;</tt><em>strid</em> [<tt>=&nbsp;</tt><em>strid</em>]  (<tt>and&nbsp;</tt><em>strid</em>[<tt>=&nbsp;</tt><em>strid</em>])* 
+</p>
+</li>
+    <li>
+<p>
+ <tt>signature&nbsp;</tt><em>sigid</em> [<tt>=&nbsp;</tt><em>sigid</em>]  (<tt>and&nbsp;</tt><em>sigid</em> [<tt>=&nbsp;</tt><em>sigid</em>])* 
+</p>
+</li>
+    <li>
+<p>
+ <tt>functor&nbsp;</tt><em>funid</em> [<tt>=&nbsp;</tt><em>funid</em>]  (<tt>and&nbsp;</tt><em>funid</em> [<tt>=&nbsp;</tt><em>funid</em>])* 
+</p>
+</li>
+    <li>
+<p>
+ <em>path</em><tt>.sml</tt> 
+</p>
+</li>
+    <li>
+<p>
+ <em>path</em><tt>.mlb</tt> 
+</p>
+</li>
+    <li>
+<p>
+ <tt>ann&nbsp;</tt><tt>"</tt><em>ann</em><tt>"</tt><tt>&nbsp;in&nbsp;</tt><em>basdec</em><tt>&nbsp;end</tt> 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+Files of the form <em>path</em><tt>.sml</tt> and <em>path</em><tt>.mlb</tt> can  be quoted to include non-alphanumeric characters -- see below. 
+</p>
+<p>
+A basis expression <em>basexp</em> must be of one the following forms. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>bas&nbsp;</tt><em>basdec</em><tt>&nbsp;end</tt> 
+</p>
+</li>
+    <li>
+<p>
+ <em>basid</em> 
+</p>
+</li>
+    <li>
+<p>
+ <tt>let&nbsp;</tt><em>basdec</em><tt>&nbsp;in&nbsp;</tt><em>basexp</em><tt>&nbsp;end</tt> 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+Nested SML-style comments (enclosed with <tt>(*</tt> and <tt>*)</tt>) are ignored (but <a href="LineDirective">LineDirective</a>s are recognized). 
+</p>
+<p>
+Conceptually, a basis file is elaborated starting in an empty basis, and each basis declaration produces a basis as a result.  Basis expressions and basis identifiers allow binding a basis to a name; this, in turn, allows fine-grained specification of dependencies, without the need for additional MLB files.  Local declarations provide name hiding.  Sequencing of basis declarations merges the bases. Structure, signature, and functor declarations bind a module in the current basis. 
+</p>
+<p>
+References to SML source files cause the file to be elaborated in the "current" basis.  References to other ML basis files cause the basis denoted by that ML basis file to be imported.  Recall that an ML basis file is elaborated in an empty basis; hence, no bindings from the "current" basis are available to the imported basis file.  Since MLB files are elaborated in the empty basis, they need only be elaborated (and evaluated) once.  The semantics of MLB files are such that the results of elaborating (and evaluating) an MLB file are cached.  Thus, any observable effects due to evaluation are not duplicated if the MLB file is referred to multiple times. 
+</p>
+<p>
+Paths can be relative or absolute.  Relative paths are relative to the directory containing the MLB file.  Paths may include path variables and are expanded according to a <a href="MLBasisPathMap">path map</a>.  Unquoted paths may include alpha-numeric characters and the symbols "<tt>-</tt>" and "<tt>_</tt>", along with the arc separator "<tt>/</tt>" and extension separator "<tt>.</tt>".  More complicated paths, including paths with spaces, may be included by quoting the path with <tt>"</tt>.  A quoted path is lexed as a SML string constant. 
+</p>
+<p>
+Finally, <a href="MLBasisAnnotations">annotations</a> allow a library author to control options that affect the elaboration of SML source files. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-05-01 08:42:17 by <span title="adsl-64-170-112-95.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MLKit
===================================================================
--- mlton/trunk/doc/guide/MLKit	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MLKit	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,59 @@
+<!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>MLKit - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MLKit
+    <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 class="external" href="http://www.it-c.dk/research/mlkit/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ML Kit</a> is a  <a href="StandardMLImplementations">Standard ML Compiler</a>. </div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-30 20:11:56 by <span title="adsl-64-166-225-13.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MLNLFFI
===================================================================
--- mlton/trunk/doc/guide/MLNLFFI	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MLNLFFI	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,106 @@
+<!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>MLNLFFI - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MLNLFFI
+    <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">
+<a href = "References#Blume01">ML-NLFFI</a> is a no-longer-foreign-function interface library for SML. <p>
+MLton ???????? has an initial port of ML-NLFFI from SML/NJ to MLton.  All of the ML-NLFFI functionality is present. 
+</p>
+<h2 id="head-0bb18642b70b9f8a9c12ccf39487328f306b8e19">Usage</h2>
+
+    <ul>
+
+    <li>
+<p>
+ You can import the MLNLFFI Library by referencing the appropriate <tt>.mlb</tt> file: 
+</p>
+</li>
+
+        <ul>
+
+
+<div>
+<table>
+  <tr>
+<td align="center">
+MLB file</td>
+</tr>
+  <tr>
+<td>
+<tt>$(SML_LIB)/mlnlffi-lib/mlnlffi-lib.mlb</tt></td>
+</tr>
+</table>
+</div>
+
+        </ul>
+
+
+
+    </ul>
+
+
+<h2 id="head-a4bc8bf5caf54b18cea9f58e83dd4acb488deb17">Also see</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="MLNLFFIImplementation">MLNLFFIImplementation</a> 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:53:23 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MLNLFFIImplementation
===================================================================
--- mlton/trunk/doc/guide/MLNLFFIImplementation	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MLNLFFIImplementation	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,193 @@
+<!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>MLNLFFIImplementation - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MLNLFFIImplementation
+    <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">
+MLton's implementation(s) of the <a href="MLNLFFI">MLNLFFI</a> library differs from the SML/NJ implementation in two important ways: 
+    <ul>
+
+    <li>
+<p>
+ MLton cannot utilize the <tt>Unsafe.cast</tt> "cheat" described in Section 3.7 of <a href = "References#Blume01">Blume01</a>.  (MLton's representation of <a class="nonexistent" href="Closures">closures</a> and <a href="PackedRepresentation">aggressive representation</a> optimizations make an <tt>Unsafe.cast</tt> even more "unsafe" than in other implementations.)  We have considered two solutions: 
+</p>
+</li>
+
+            <ul>
+
+            <li>
+<p>
+ One solution is to utilize an additional type parameter (as described in Section 3.7 of <a href = "References#Blume01">Blume01</a>):  
+</p>
+</li>
+
+                    <ul>
+
+     
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> C = <B><FONT COLOR="#0000FF">sig</FONT></B>
+    <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> ('t, 'f, 'c) obj
+    </FONT></B><B><FONT COLOR="#A020F0">eqtype</FONT></B><FONT COLOR="#228B22"><B> ('t, 'f, 'c) obj'
+    </FONT></B>...
+    <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> ('o, 'f) ptr   
+    </FONT></B><B><FONT COLOR="#A020F0">eqtype</FONT></B><FONT COLOR="#228B22"><B> ('o, 'f) ptr'
+    </FONT></B>...
+    <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> 'f fptr
+    </FONT></B><B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> 'f ptr'
+    </FONT></B>...
+    <B><FONT COLOR="#0000FF">structure</FONT></B> T : <B><FONT COLOR="#0000FF">sig</FONT></B>
+        <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> ('t, 'f) typ
+        </FONT></B>...
+    <B><FONT COLOR="#0000FF">end</FONT></B>
+<B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ <em>The rule for <tt>('t,&nbsp;'f,&nbsp;'c)&nbsp;obj</tt>,<tt>('t,&nbsp;'f,&nbsp;'c)&nbsp;ptr</tt>, and also <tt>('t,&nbsp;'f)&nbsp;T.typ</tt> is that whenever <tt>F&nbsp;fptr</tt> occurs within the instantiation of <tt>'t</tt>, then <tt>'f</tt> must be instantiated to <tt>F</tt>.  In all other cases, <tt>'f</tt> will be instantiated to <tt>unit</tt>.</em> (In the actual MLton implementation, an abstract type <tt>naf</tt> (not-a-function) is used instead of <tt>unit</tt>.) 
+</p>
+
+                    </ul>
+
+
+   While this means that type-annotated programs may not type-check under both the SML/NJ implementation and the MLton implementation, this should not be a problem in practice.  Tools, like <tt>ml-nlffigen</tt>, which are necessarily implementation dependent (in order to make <a href="CallingFromSMLToCFunctionPointer">calls through a C function pointer</a>), may be easily extended to emit the additional type parameter.  Client code which uses such generated glue-code (e.g., Section 1 of <a href = "References#Blume01">Blume01</a>) need rarely write type-annotations, thanks to the magic of type inference.             <li class="gap">
+<p>
+ The above implementation suffers from two disadvantages.  First, it changes the MLNLFFI Library interface, meaning that the same program may not type-check under both the SML/NJ implementation and the MLton implementation (though, in light of type inference and the richer <tt>MLRep</tt> structure provided by MLton, this point is mostly moot).   
+</p>
+<p>
+   Second, it appears to unecessarily duplicate type information.  For example, an external C variable of type <tt>int&nbsp;(*&nbsp;f[3])(int)</tt> (that is, an array of three function pointers), would be represented by the SML type <tt>(((sint&nbsp;-&gt;&nbsp;sint)&nbsp;fptr,&nbsp;dec&nbsp;dg3)&nbsp;arr,&nbsp;sint&nbsp;-&gt;&nbsp;sint,&nbsp;rw)&nbsp;obj</tt>.  One might well ask why the <tt>'f</tt> instantiation (<tt>sint&nbsp;-&gt;&nbsp;sint</tt> in this case) cannot be <em>extracted</em> from the <tt>'t</tt> instantiation (<tt>((sint&nbsp;-&gt;&nbsp;sint)&nbsp;fptr,&nbsp;dec&nbsp;dg3)&nbsp;arr</tt> in this case), obviating the need for a separate <em>function-type</em> type argument.  There are a number of components to an complete answer to this question.  Foremost is the fact that <a href="StandardML"> Standard ML</a> supports neither (general) type-level functions nor intensional polymorphism.   
+</p>
+<p>
+   A more direct answer for MLNLFFI is that in the SML/NJ implemention, the definition of the types <tt>('t,&nbsp;'c)&nbsp;obj</tt> and <tt>('t,&nbsp;'c)&nbsp;ptr</tt> are made in such a way that the type variables <tt>'t</tt> and <tt>'c</tt> are <a href="PhantomType"> phantom</a> (not contributing to the run-time representation of an <tt>('t,&nbsp;'c)&nbsp;obj</tt> or <tt>('t,&nbsp;'c)&nbsp;ptr</tt> value), despite the fact that the types <tt>((sint&nbsp;-&gt;&nbsp;sint)&nbsp;fptr,&nbsp;rw)&nbsp;ptr</tt> and <tt>((double&nbsp;-&gt;&nbsp;double)&nbsp;fptr,&nbsp;rw)&nbsp;ptr</tt> necessarily carry distinct (and type incompatible) run-time (C-)type information (RTTI), corresponding to the different calling conventions of the two C functions.  The <tt>Unsafe.cast</tt> "cheat" overcomes the type incompatibility without introducing a new type variable (as in the first solution above). 
+</p>
+<p>
+   Hence, the reason that <em>function-type</em> type cannot be extracted from the <tt>'t</tt> type variable instantiation is that the type of the representation of RTTI doesn't even <em>see</em> the (phantom) <tt>'t</tt> type variable.  The solution which presents itself is to give up on the phantomness of the <tt>'t</tt> type variable, making it available to the representation of RTTI. 
+</p>
+<p>
+   This is not without some small drawbacks.  Because many of the types used to instatiate <tt>'t</tt> carry more structure than is strictly necessary for <tt>'t</tt>'s RTTI, it is sometimes necessary to wrap and unwrap RTTI to accomodate the additional structure.  (In the other implementations, the corresponding operations can pass along the RTTI unchanged.)  However, these coercions contribute miniscule overhead; in fact, in a majority of cases, MLton's optimizations will completely eliminate the RTTI from the final program. 
+</p>
+</li>
+
+            </ul>
+
+
+ The implementation distributed with MLton uses the second solution. <p>
+ Bonus question: Why can't one use a <a href="UniversalType"> universal type</a> to eliminate the use of <tt>Unsafe.cast</tt>? 
+</p>
+
+            <ul>
+
+            <li>
+<p>
+ Answer: ??? 
+</p>
+</li>
+
+            </ul>
+
+
+    <li class="gap">
+<p>
+ MLton (in both of the above implementations) provides a richer <tt>MLRep</tt> structure, utilizing <tt>Int&lt;N&gt;</tt> and <tt>Word&lt;N&gt;</tt> structures. 
+<pre class=code>
+<B><FONT COLOR="#0000FF">structure</FONT></B> MLRep = <B><FONT COLOR="#0000FF">struct</FONT></B>
+    <B><FONT COLOR="#0000FF">structure</FONT></B> Char =
+       <B><FONT COLOR="#0000FF">struct</FONT></B>
+          <B><FONT COLOR="#0000FF">structure</FONT></B> Signed = Int8
+          <B><FONT COLOR="#0000FF">structure</FONT></B> Unsigned = Word8
+          <I><FONT COLOR="#B22222">(* word-style bit-operations on integers... *)</FONT></I>
+          <B><FONT COLOR="#0000FF">structure</FONT></B> SignedBitops = IntBitOps(<B><FONT COLOR="#0000FF">structure</FONT></B> I = Signed
+                                             <B><FONT COLOR="#0000FF">structure</FONT></B> W = Unsigned)
+       <B><FONT COLOR="#0000FF">end</FONT></B>
+    <B><FONT COLOR="#0000FF">structure</FONT></B> Short =
+       <B><FONT COLOR="#0000FF">struct</FONT></B>
+          <B><FONT COLOR="#0000FF">structure</FONT></B> Signed = Int16
+          <B><FONT COLOR="#0000FF">structure</FONT></B> Unsigned = Word16
+          <I><FONT COLOR="#B22222">(* word-style bit-operations on integers... *)</FONT></I>
+          <B><FONT COLOR="#0000FF">structure</FONT></B> SignedBitops = IntBitOps(<B><FONT COLOR="#0000FF">structure</FONT></B> I = Signed
+                                             <B><FONT COLOR="#0000FF">structure</FONT></B> W = Unsigned)
+       <B><FONT COLOR="#0000FF">end</FONT></B>
+    <B><FONT COLOR="#0000FF">structure</FONT></B> Int =
+       <B><FONT COLOR="#0000FF">struct</FONT></B>
+          <B><FONT COLOR="#0000FF">structure</FONT></B> Signed = Int32
+          <B><FONT COLOR="#0000FF">structure</FONT></B> Unsigned = Word32
+          <I><FONT COLOR="#B22222">(* word-style bit-operations on integers... *)</FONT></I>
+          <B><FONT COLOR="#0000FF">structure</FONT></B> SignedBitops = IntBitOps(<B><FONT COLOR="#0000FF">structure</FONT></B> I = Signed
+                                             <B><FONT COLOR="#0000FF">structure</FONT></B> W = Unsigned)
+       <B><FONT COLOR="#0000FF">end</FONT></B>  
+    <B><FONT COLOR="#0000FF">structure</FONT></B> Long =
+       <B><FONT COLOR="#0000FF">struct</FONT></B>
+          <B><FONT COLOR="#0000FF">structure</FONT></B> Signed = Int32
+          <B><FONT COLOR="#0000FF">structure</FONT></B> Unsigned = Word32
+          <I><FONT COLOR="#B22222">(* word-style bit-operations on integers... *)</FONT></I>
+          <B><FONT COLOR="#0000FF">structure</FONT></B> SignedBitops = IntBitOps(<B><FONT COLOR="#0000FF">structure</FONT></B> I = Signed
+                                             <B><FONT COLOR="#0000FF">structure</FONT></B> W = Unsigned)
+       <B><FONT COLOR="#0000FF">end</FONT></B>
+    <B><FONT COLOR="#0000FF">structure</FONT></B> LongLong =
+       <B><FONT COLOR="#0000FF">struct</FONT></B>
+          <B><FONT COLOR="#0000FF">structure</FONT></B> Signed = Int64
+          <B><FONT COLOR="#0000FF">structure</FONT></B> Unsigned = Word64
+          <I><FONT COLOR="#B22222">(* word-style bit-operations on integers... *)</FONT></I>
+          <B><FONT COLOR="#0000FF">structure</FONT></B> SignedBitops = IntBitOps(<B><FONT COLOR="#0000FF">structure</FONT></B> I = Signed
+                                             <B><FONT COLOR="#0000FF">structure</FONT></B> W = Unsigned)
+       <B><FONT COLOR="#0000FF">end</FONT></B>
+    <B><FONT COLOR="#0000FF">structure</FONT></B> Float = Real32
+    <B><FONT COLOR="#0000FF">structure</FONT></B> Double = Real64
+<B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+ This would appear to be a better interface, even when an implementation must choose <tt>Int32</tt> and <tt>Word32</tt> as the representation for smaller C-types. 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:53:05 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MLj
===================================================================
--- mlton/trunk/doc/guide/MLj	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MLj	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,62 @@
+<!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>MLj - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MLj
+    <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">
+<a class="external" href="http://www.dcs.ed.ac.uk/home/mlj/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">MLj</a> is a  <a href="StandardMLImplementations">Standard ML Compiler</a> that targets Java bytecode.  It is no longer maintained.  It has morphed into <a href="SMLNET">SML.NET</a>. <p>
+<a href = "References#BentonEtAl98">BentonEtAl98</a> and <a href = "References#BentonKennedy99">BentonKennedy99</a> describe MLj. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-30 20:11:59 by <span title="adsl-64-166-225-13.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MLtonArray
===================================================================
--- mlton/trunk/doc/guide/MLtonArray	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MLtonArray	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,84 @@
+<!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>MLtonArray - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MLtonArray
+    <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">
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> MLTON_ARRAY =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">val</FONT></B> unfoldi: int * 'b * (int * 'b -&gt; 'a * 'b) -&gt; 'a array
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>unfoldi&nbsp;(n,&nbsp;b,&nbsp;f)</tt> 
+</p>
+</li>
+
+        <ul>
+
+  construct an array <em>a</em> of length <tt>n</tt>, whose elements <em>a<sub>i</sub></em>   are determined by the equations <em>b<sub>0</sub> = b</em> and    <em>(a<sub>i</sub>, b<sub>i+1</sub>) = f (i, b<sub>i</sub>)</em>. </ul>
+
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-02 04:20:05 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MLtonBinIO
===================================================================
--- mlton/trunk/doc/guide/MLtonBinIO	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MLtonBinIO	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,72 @@
+<!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>MLtonBinIO - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MLtonBinIO
+    <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">
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> MLTON_BIN_IO =
+   MLTON_IO
+   <B><FONT COLOR="#0000FF">where</FONT></B> <B><FONT COLOR="#0000FF">type</FONT></B><FONT COLOR="#228B22"><B> instream </FONT></B>=<FONT COLOR="#228B22"><B> BinIO.instream
+   <B><FONT COLOR="#0000FF">where</FONT></B> <B><FONT COLOR="#0000FF">type</FONT></B><FONT COLOR="#228B22"><B> outstream </FONT></B>=<FONT COLOR="#228B22"><B> BinIO.outstream
+</FONT></B></PRE>
+<p>
+ 
+</p>
+<p>
+See <a href="MLtonIO">MLtonIO</a>. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-02 04:21:33 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MLtonCont
===================================================================
--- mlton/trunk/doc/guide/MLtonCont	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MLtonCont	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,137 @@
+<!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>MLtonCont - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MLtonCont
+    <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">
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> MLTON_CONT =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> 'a t
+
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> callcc: ('a t -&gt; 'a) -&gt; 'a
+      <B><FONT COLOR="#A020F0">val</FONT></B> prepend: 'a t * ('b -&gt; 'a) -&gt; 'b t
+      <B><FONT COLOR="#A020F0">val</FONT></B> throw: 'a t * 'a -&gt; 'b
+      <B><FONT COLOR="#A020F0">val</FONT></B> throw': 'a t * (unit -&gt; 'a) -&gt; 'b
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>type&nbsp;'a&nbsp;t</tt> 
+</p>
+</li>
+
+        <ul>
+
+  the type of continuations that expect a value of type <tt>'a</tt>. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>callcc&nbsp;f</tt> 
+</p>
+</li>
+
+        <ul>
+
+  apply <tt>f</tt> to the current continuation.  Because this copies the   entire stack, <tt>callcc</tt> takes time proportional to the current   stack size. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>prepend&nbsp;(k,&nbsp;f)</tt> 
+</p>
+</li>
+
+        <ul>
+
+  compose a function <tt>f</tt> with a continuation <tt>k</tt> to create a   continuation that first does <tt>f</tt> and then does <tt>k</tt>.  This   is a constant time operation. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>throw&nbsp;(k,&nbsp;v)</tt> 
+</p>
+</li>
+
+        <ul>
+
+  throw value <tt>v</tt> to continuation <tt>k</tt>.  Because this copies the   entire stack of <tt>k</tt>, <tt>throw</tt> takes time proportional to the   size of this stack. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>throw'&nbsp;(k,&nbsp;th)</tt> 
+</p>
+</li>
+
+        <ul>
+
+  a generalization of throw that evaluates <tt>th&nbsp;()</tt> in the context   of <tt>k</tt>.  Thus, for example, if <tt>th&nbsp;()</tt> raises an exception or   grabs another continuation, it will see <tt>k</tt>, not the current   continuation. </ul>
+
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-02 04:21:52 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MLtonExn
===================================================================
--- mlton/trunk/doc/guide/MLtonExn	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MLtonExn	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,110 @@
+<!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>MLtonExn - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MLtonExn
+    <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">
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> MLTON_EXN =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">val</FONT></B> addExnMessager: (exn -&gt; string option) -&gt; unit
+      <B><FONT COLOR="#A020F0">val</FONT></B> history: exn -&gt; string list
+      <B><FONT COLOR="#A020F0">val</FONT></B> topLevelHandler: exn -&gt; 'a
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>addExnMessager&nbsp;f</tt> 
+</p>
+</li>
+
+        <ul>
+
+  adds <tt>f</tt> as a pretty-printer to be used by <tt>General.exnMessage</tt> for converting exceptions to strings.    Messagers are tried in order from most recently added to least recently added. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>history&nbsp;e</tt> 
+</p>
+</li>
+
+        <ul>
+
+  returns the file positions that have raised the exception <tt>e</tt>, in   reverse chronological order.   A <tt>handle</tt> expression that   implicitly reraises counts as a raise.  <tt>history</tt> will return   <tt>[]</tt> unless the program is compiled with <tt>-const&nbsp;'Exn.keepHistory&nbsp;true'</tt>. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>topLevelHandler&nbsp;e</tt> 
+</p>
+</li>
+
+        <ul>
+
+  behave as if the top level handler received the exception <tt>e</tt>,   that is, print out the unhandled exception message for <tt>e</tt> and   exit. </ul>
+
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-25 02:43:28 by <span title="mail.plaxo.com">ScottCruzen</span>.
+</body></html>

Added: mlton/trunk/doc/guide/MLtonFinalizable
===================================================================
--- mlton/trunk/doc/guide/MLtonFinalizable	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MLtonFinalizable	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,336 @@
+<!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>MLtonFinalizable - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MLtonFinalizable
+    <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">
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> MLTON_FINALIZABLE =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> 'a t
+
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> addFinalizer: 'a t * ('a -&gt; unit) -&gt; unit
+      <B><FONT COLOR="#A020F0">val</FONT></B> finalizeBefore: 'a t * 'b t -&gt; unit
+      <B><FONT COLOR="#A020F0">val</FONT></B> new: 'a -&gt; 'a t
+      <B><FONT COLOR="#A020F0">val</FONT></B> touch: 'a t -&gt; unit
+      <B><FONT COLOR="#A020F0">val</FONT></B> withValue: 'a t * ('a -&gt; 'b) -&gt; 'b
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<p>
+A finalizable value is a value to which <em>finalizers</em> can be attached.  A finalizer is a function that runs after a garbage collection determines that the value to which it is attached is unreachable.  Reachability is the same as with  <a href="MLtonWeak">weak pointers</a>.  The finalizer is treated like a signal handler, in that it runs asynchronously in a separate thread, with signals blocked, and will not run within a critical section (see <a href="MLtonThread">MLtonThread</a>). 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>addFinalizer&nbsp;(v,&nbsp;f)</tt> 
+</p>
+</li>
+
+        <ul>
+
+  adds <tt>f</tt> as a finalizer to <tt>v</tt>.  This means that sometime   after the last call to <tt>withValue</tt> on <tt>v</tt> completes and   <tt>v</tt> becomes unreachable, <tt>f</tt> will be called with the value of   <tt>v</tt>.  
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>finalizeBefore&nbsp;(v1,&nbsp;v2)</tt> 
+</p>
+</li>
+
+        <ul>
+
+  ensures that <tt>v1</tt> will be finalized before <tt>v2</tt>.  A cycle of   values <tt>v</tt> = <tt>v1</tt>, ..., <tt>vn</tt> = <tt>v</tt> with   <tt>finalizeBefore&nbsp;(vi,&nbsp;vi+1)</tt> will result in none of the <tt>vi</tt>   being finalized. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>new&nbsp;x</tt> 
+</p>
+</li>
+
+        <ul>
+
+  creates a new finalizable value, <tt>v</tt>, with value <tt>x</tt>.  The   finalizers of <tt>v</tt> will run sometime after the last call to   <tt>withValue</tt> on <tt>v</tt> when the garbage collector determines that   <tt>v</tt> is unreachable.  
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>touch&nbsp;v</tt> 
+</p>
+</li>
+
+        <ul>
+
+  ensures that <tt>v</tt>'s finalizers will not run before the call to   <tt>touch</tt>. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>withValue&nbsp;(v,&nbsp;f)</tt> 
+</p>
+</li>
+
+        <ul>
+
+  returns the result of applying <tt>f</tt> to the value of <tt>v</tt> and   ensures that <tt>v</tt>'s finalizers will not run before <tt>f</tt>   completes.  The call to <tt>f</tt> is a nontail call. 
+        </ul>
+
+
+
+    </ul>
+
+
+<h2 id="head-0f01ed56a1e32a05e5ef96e4d779f34784af9a96">Example</h2>
+<p>
+Suppose that <tt>finalizable.sml</tt> contains the following. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> CLIST =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t
+
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> cons: int * t -&gt; t
+      <B><FONT COLOR="#A020F0">val</FONT></B> sing: int -&gt; t
+      <B><FONT COLOR="#A020F0">val</FONT></B> sum: t -&gt; int
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+
+<B><FONT COLOR="#0000FF">functor</FONT></B> CList (<B><FONT COLOR="#0000FF">structure</FONT></B> F: MLTON_FINALIZABLE
+               <B><FONT COLOR="#0000FF">structure</FONT></B> Prim:
+                  <B><FONT COLOR="#0000FF">sig</FONT></B>
+                     <B><FONT COLOR="#A020F0">val</FONT></B> cons: int * Word32.word -&gt; Word32.word
+                     <B><FONT COLOR="#A020F0">val</FONT></B> free: Word32.word -&gt; unit
+                     <B><FONT COLOR="#A020F0">val</FONT></B> sing: int -&gt; Word32.word
+                     <B><FONT COLOR="#A020F0">val</FONT></B> sum: Word32.word -&gt; int
+                  <B><FONT COLOR="#0000FF">end</FONT></B>): CLIST =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> Word32.word F.t
+
+      </FONT></B><B><FONT COLOR="#A020F0">fun</FONT></B> cons (n: int, l: t) =
+         F.withValue
+         (l, <B><FONT COLOR="#A020F0">fn</FONT></B> w' =&gt;
+          <B><FONT COLOR="#A020F0">let</FONT></B>
+             <B><FONT COLOR="#A020F0">val</FONT></B> c = F.new (Prim.cons (n, w'))
+             <B><FONT COLOR="#A020F0">val</FONT></B> _ = F.addFinalizer (c, Prim.free)
+             <B><FONT COLOR="#A020F0">val</FONT></B> _ = F.finalizeBefore (c, l)
+          <B><FONT COLOR="#A020F0">in</FONT></B>
+             c
+          <B><FONT COLOR="#A020F0">end</FONT></B>)
+      
+      <B><FONT COLOR="#A020F0">fun</FONT></B> sing n =
+         <B><FONT COLOR="#A020F0">let</FONT></B>
+            <B><FONT COLOR="#A020F0">val</FONT></B> c = F.new (Prim.sing n)
+            <B><FONT COLOR="#A020F0">val</FONT></B> _ = F.addFinalizer (c, Prim.free)
+         <B><FONT COLOR="#A020F0">in</FONT></B>
+            c
+         <B><FONT COLOR="#A020F0">end</FONT></B>
+
+      <B><FONT COLOR="#A020F0">fun</FONT></B> sum c = F.withValue (c, Prim.sum)
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+
+<B><FONT COLOR="#0000FF">functor</FONT></B> Test (<B><FONT COLOR="#0000FF">structure</FONT></B> CList: CLIST
+              <B><FONT COLOR="#0000FF">structure</FONT></B> MLton: <B><FONT COLOR="#0000FF">sig</FONT></B>
+                                  <B><FONT COLOR="#0000FF">structure</FONT></B> GC:
+                                     <B><FONT COLOR="#0000FF">sig</FONT></B>
+                                        <B><FONT COLOR="#A020F0">val</FONT></B> collect: unit -&gt; unit
+                                     <B><FONT COLOR="#0000FF">end</FONT></B>
+                               <B><FONT COLOR="#0000FF">end</FONT></B>) =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#A020F0">fun</FONT></B> f n =
+         <B><FONT COLOR="#A020F0">if</FONT></B> n = <B><FONT COLOR="#5F9EA0">1</FONT></B>
+            <B><FONT COLOR="#A020F0">then</FONT></B> ()
+         <B><FONT COLOR="#A020F0">else</FONT></B>
+            <B><FONT COLOR="#A020F0">let</FONT></B>
+               <B><FONT COLOR="#A020F0">val</FONT></B> a = Array.tabulate (n, <B><FONT COLOR="#A020F0">fn</FONT></B> i =&gt; i)
+               <B><FONT COLOR="#A020F0">val</FONT></B> _ = Array.sub (a, <B><FONT COLOR="#5F9EA0">0</FONT></B>) + Array.sub (a, <B><FONT COLOR="#5F9EA0">1</FONT></B>)
+            <B><FONT COLOR="#A020F0">in</FONT></B>
+               f (n - <B><FONT COLOR="#5F9EA0">1</FONT></B>)
+            <B><FONT COLOR="#A020F0">end</FONT></B>
+            
+      <B><FONT COLOR="#A020F0">val</FONT></B> l = CList.sing <B><FONT COLOR="#5F9EA0">2</FONT></B>
+      <B><FONT COLOR="#A020F0">val</FONT></B> l = CList.cons (<B><FONT COLOR="#5F9EA0">2</FONT></B>,l)
+      <B><FONT COLOR="#A020F0">val</FONT></B> l = CList.cons (<B><FONT COLOR="#5F9EA0">2</FONT></B>,l)
+      <B><FONT COLOR="#A020F0">val</FONT></B> l = CList.cons (<B><FONT COLOR="#5F9EA0">2</FONT></B>,l)
+      <B><FONT COLOR="#A020F0">val</FONT></B> l = CList.cons (<B><FONT COLOR="#5F9EA0">2</FONT></B>,l)
+      <B><FONT COLOR="#A020F0">val</FONT></B> l = CList.cons (<B><FONT COLOR="#5F9EA0">2</FONT></B>,l)
+      <B><FONT COLOR="#A020F0">val</FONT></B> l = CList.cons (<B><FONT COLOR="#5F9EA0">2</FONT></B>,l)
+      <B><FONT COLOR="#A020F0">val</FONT></B> _ = MLton.GC.collect ()
+      <B><FONT COLOR="#A020F0">val</FONT></B> _ = f <B><FONT COLOR="#5F9EA0">100</FONT></B>
+      <B><FONT COLOR="#A020F0">val</FONT></B> _ = print (concat [<FONT COLOR="#BC8F8F"><B>&quot;listSum(l) = &quot;</FONT></B>,
+                             Int.toString (CList.sum l),
+                             <FONT COLOR="#BC8F8F"><B>&quot;\n&quot;</FONT></B>])
+      <B><FONT COLOR="#A020F0">val</FONT></B> _ = MLton.GC.collect ()
+      <B><FONT COLOR="#A020F0">val</FONT></B> _ = f <B><FONT COLOR="#5F9EA0">100</FONT></B>
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+
+<B><FONT COLOR="#0000FF">structure</FONT></B> CList =
+   CList (<B><FONT COLOR="#0000FF">structure</FONT></B> F = MLton.Finalizable
+          <B><FONT COLOR="#0000FF">structure</FONT></B> Prim =
+             <B><FONT COLOR="#0000FF">struct</FONT></B>
+                <B><FONT COLOR="#A020F0">val</FONT></B> cons = _import <FONT COLOR="#BC8F8F"><B>&quot;listCons&quot;</FONT></B>: int * Word32.word -&gt; Word32.word;
+                <B><FONT COLOR="#A020F0">val</FONT></B> free = _import <FONT COLOR="#BC8F8F"><B>&quot;listFree&quot;</FONT></B>: Word32.word -&gt; unit;
+                <B><FONT COLOR="#A020F0">val</FONT></B> sing = _import <FONT COLOR="#BC8F8F"><B>&quot;listSing&quot;</FONT></B>: int -&gt; Word32.word;
+                <B><FONT COLOR="#A020F0">val</FONT></B> sum = _import <FONT COLOR="#BC8F8F"><B>&quot;listSum&quot;</FONT></B>: Word32.word -&gt; int;
+             <B><FONT COLOR="#0000FF">end</FONT></B>)
+
+<B><FONT COLOR="#0000FF">structure</FONT></B> S = Test (<B><FONT COLOR="#0000FF">structure</FONT></B> CList = CList
+                    <B><FONT COLOR="#0000FF">structure</FONT></B> MLton = MLton)
+</PRE>
+<p>
+ 
+</p>
+<p>
+Suppose that <tt>cons.c</tt> contains the following. 
+<pre>#include &lt;stdio.h&gt;
+
+typedef unsigned int uint;
+
+typedef struct Cons {
+        struct Cons *next;
+        int value;
+} *Cons;
+
+Cons listCons (int n, Cons c) {
+        Cons res;
+
+        res = (Cons) malloc (sizeof(*res));
+        fprintf (stderr, "0x%08x = listCons (%d)\n", (uint)res, n);
+        res-&gt;next = c;
+        res-&gt;value = n;
+        return res;
+}
+
+Cons listSing (int n) {
+        Cons res;
+
+        res = (Cons) malloc (sizeof(*res));
+        fprintf (stderr, "0x%08x = listSing (%d)\n", (uint)res, n);
+        res-&gt;next = NULL;
+        res-&gt;value = n;
+        return res;
+}
+
+void listFree (Cons p) {
+        fprintf (stderr, "listFree (0x%08x)\n", (uint)p);
+        free (p);
+}
+
+int listSum (Cons c) {
+        int res;
+
+        fprintf (stderr, "listSum\n");
+        res = 0;
+        for (; c != NULL; c = c-&gt;next)
+                res += c-&gt;value;
+        return res;
+}
+</pre>
+</p>
+<p>
+We can compile these to create an executable with 
+<pre>% mlton -default-ann 'allowImport true' finalizable.sml cons.c
+</pre>
+</p>
+<p>
+Running this executable will create output like the following. 
+<pre>% finalizable
+0x08072890 = listSing (2)
+0x080728a0 = listCons (2)
+0x080728b0 = listCons (2)
+0x080728c0 = listCons (2)
+0x080728d0 = listCons (2)
+0x080728e0 = listCons (2)
+0x080728f0 = listCons (2)
+listSum
+listSum(l) = 14
+listFree (0x080728f0)
+listFree (0x080728e0)
+listFree (0x080728d0)
+listFree (0x080728c0)
+listFree (0x080728b0)
+listFree (0x080728a0)
+listFree (0x08072890)
+</pre>
+</p>
+<h2 id="head-1a7d780f4e551c514e4ae9523e76c5fe42784626">Synchronous Finalizers</h2>
+<p>
+Finalizers in MLton are asynchronous.  That is, they run at an unspecified time, interrupting the user program.  It is also possible, and sometimes useful, to have synchronous finalizers, where the user program explicitly decides when to run enabled finalizers.  We have considered this in MLton, and it seems possible, but there are some unresolved design issues.  See the thread at 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="http://mlton.org/pipermail/mlton/2004-September/016570.html">http://mlton.org/pipermail/mlton/2004-September/016570.html</a> 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+Also see <a href = "References#Boehm03">Boehm03</a>. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-16 00:12:27 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MLtonGC
===================================================================
--- mlton/trunk/doc/guide/MLtonGC	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MLtonGC	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,136 @@
+<!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>MLtonGC - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MLtonGC
+    <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">
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> MLTON_GC =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">val</FONT></B> collect: unit -&gt; unit
+      <B><FONT COLOR="#A020F0">val</FONT></B> pack: unit -&gt; unit
+      <B><FONT COLOR="#A020F0">val</FONT></B> setMessages: bool -&gt; unit
+      <B><FONT COLOR="#A020F0">val</FONT></B> setSummary: bool -&gt; unit
+      <B><FONT COLOR="#A020F0">val</FONT></B> unpack: unit -&gt; unit
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>collect&nbsp;()</tt> 
+</p>
+</li>
+
+        <ul>
+
+  causes a garbage collection to occur. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>pack&nbsp;()</tt> 
+</p>
+</li>
+
+        <ul>
+
+  shrinks the heap as much as possible so that other processes can use   available RAM. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>setMessages&nbsp;b</tt> 
+</p>
+</li>
+
+        <ul>
+
+  controls whether diagnostic messages are printed at the beginning and   end of each garbage collection.  It is the same as the   <tt>gc-messages</tt> runtime system option.  
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>setSummary&nbsp;b</tt> 
+</p>
+</li>
+
+        <ul>
+
+  controls whether a summary of garbage collection statistics is   printed upon termination of the program.  It is the same as the   <tt>gc-summary</tt> runtime system option.  
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>unpack&nbsp;()</tt> 
+</p>
+</li>
+
+        <ul>
+
+  resizes a packed heap to the size desired by the runtime. </ul>
+
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-02 04:24:34 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MLtonIO
===================================================================
--- mlton/trunk/doc/guide/MLtonIO	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MLtonIO	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,152 @@
+<!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>MLtonIO - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MLtonIO
+    <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">
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> MLTON_IO =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> instream
+      </FONT></B><B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> outstream
+
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> inFd: instream -&gt; Posix.IO.file_desc
+      <B><FONT COLOR="#A020F0">val</FONT></B> mkstemp: string -&gt; string * outstream
+      <B><FONT COLOR="#A020F0">val</FONT></B> mkstemps: {prefix: string, suffix: string} -&gt; string * outstream
+      <B><FONT COLOR="#A020F0">val</FONT></B> newIn: Posix.IO.file_desc * string -&gt; instream
+      <B><FONT COLOR="#A020F0">val</FONT></B> newOut: Posix.IO.file_desc * string -&gt; outstream
+      <B><FONT COLOR="#A020F0">val</FONT></B> outFd: outstream -&gt; Posix.IO.file_desc
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>inFd&nbsp;ins</tt> 
+</p>
+</li>
+
+        <ul>
+
+  return the file descriptor corresponding to <tt>ins</tt>. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>mkstemp&nbsp;s</tt> 
+</p>
+</li>
+
+        <ul>
+
+  like the C <tt>mkstemp</tt> function, generate and open a temporary   file with prefix <tt>s</tt>. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>mkstemps&nbsp;{prefix,&nbsp;suffix}&nbsp;</tt> 
+</p>
+</li>
+
+        <ul>
+
+  like <tt>mkstemp</tt>, except it has both a prefix and suffix. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>newIn&nbsp;(fd,&nbsp;name)</tt> 
+</p>
+</li>
+
+        <ul>
+
+  create a new instream from file descriptor   <tt>fd</tt>, with <tt>name</tt> used in any <tt>Io</tt> exceptions later   raised. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>newOut&nbsp;(fd,&nbsp;name)</tt> 
+</p>
+</li>
+
+        <ul>
+
+  create a new outstream from file descriptor <tt>fd</tt>, with   <tt>name</tt> used in any <tt>Io</tt> exceptions later raised. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>outFd&nbsp;out</tt>  
+</p>
+</li>
+
+        <ul>
+
+  return the file descriptor corresponding to <tt>out</tt>. </ul>
+
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-28 19:09:43 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MLtonIntInf
===================================================================
--- mlton/trunk/doc/guide/MLtonIntInf	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MLtonIntInf	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,155 @@
+<!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>MLtonIntInf - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MLtonIntInf
+    <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">
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> MLTON_INT_INF =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t
+
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> areSmall: t * t -&gt; bool
+      <B><FONT COLOR="#A020F0">val</FONT></B> gcd: t * t -&gt; t
+      <B><FONT COLOR="#A020F0">val</FONT></B> isSmall: t -&gt; bool
+      <B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> rep </FONT></B>=<FONT COLOR="#228B22"><B>
+         <FONT COLOR="#B8860B">Big</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> word vector
+       </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">Small</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> int
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> rep: t -&gt; rep
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<p>
+MLton represents an arbitrary precision integer either as an unboxed 32 bit word with the bottom bit set to 1 and the top 31 bits representing a small integer in [-2<sup>30</sup>, 2<sup>30</sup>), or as a pointer to a vector of words where the first word indicates the sign and the rest are the limbs of <a href="GnuMP">GnuMP</a> big integer. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>type&nbsp;t</tt> 
+</p>
+</li>
+
+        <ul>
+
+  the same as type <tt>IntInf.int</tt>. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>areSmall&nbsp;(a,&nbsp;b)</tt> 
+</p>
+</li>
+
+        <ul>
+
+  returns true iff both <tt>a</tt> and <tt>b</tt> are small. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>gcd&nbsp;(a,&nbsp;b)</tt> 
+</p>
+</li>
+
+        <ul>
+
+  use the GnuMP's fast gcd implementation. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>isSmall&nbsp;a</tt> 
+</p>
+</li>
+
+        <ul>
+
+  returns true iff <tt>a</tt> is small. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>datatype&nbsp;rep</tt> 
+</p>
+</li>
+
+        <ul>
+
+  the underlying representation of an <tt>IntInf.int</tt>. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>rep&nbsp;i</tt> 
+</p>
+</li>
+
+        <ul>
+
+  return the underlying representation of i. </ul>
+
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-29 20:47:58 by <span title="adsl-64-166-225-13.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MLtonItimer
===================================================================
--- mlton/trunk/doc/guide/MLtonItimer	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MLtonItimer	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,102 @@
+<!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>MLtonItimer - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MLtonItimer
+    <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">
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> MLTON_ITIMER =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B>
+         <FONT COLOR="#B8860B">Prof</FONT>
+       </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">Real</FONT>
+       </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">Virtual</FONT>
+
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> set: t * {interval: Time.time, value: Time.time} -&gt; unit
+      <B><FONT COLOR="#A020F0">val</FONT></B> signal: t -&gt; Posix.Signal.signal
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>set&nbsp;(t,&nbsp;{interval,&nbsp;value})</tt> 
+</p>
+</li>
+
+        <ul>
+
+  set the interval timer (using <tt>setitimer</tt>) specified by <tt>t</tt> to   the given <tt>interval</tt> and <tt>value</tt>. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>signal&nbsp;t</tt> 
+</p>
+</li>
+
+        <ul>
+
+  return the signal corresponding to <tt>t</tt>. </ul>
+
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-02 04:25:53 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MLtonPlatform
===================================================================
--- mlton/trunk/doc/guide/MLtonPlatform	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MLtonPlatform	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,185 @@
+<!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>MLtonPlatform - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MLtonPlatform
+    <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">
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> MLTON_PLATFORM =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#0000FF">structure</FONT></B> Arch:
+         <B><FONT COLOR="#0000FF">sig</FONT></B>
+            <B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">PowerPC</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">Sparc</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">X86</FONT>
+
+            </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> fromString: string -&gt; t option
+            <B><FONT COLOR="#A020F0">val</FONT></B> host: t
+            <B><FONT COLOR="#A020F0">val</FONT></B> toString: t -&gt; string
+         <B><FONT COLOR="#0000FF">end</FONT></B>
+         
+      <B><FONT COLOR="#0000FF">structure</FONT></B> OS:
+         <B><FONT COLOR="#0000FF">sig</FONT></B>
+            <B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">Cygwin</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">Darwin</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">FreeBSD</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">Linux</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">MinGW</FONT>
+                       </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">NetBSD</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">OpenBSD</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">Solaris</FONT>
+
+            </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> fromString: string -&gt; t option
+            <B><FONT COLOR="#A020F0">val</FONT></B> host: t
+            <B><FONT COLOR="#A020F0">val</FONT></B> toString: t -&gt; string
+         <B><FONT COLOR="#0000FF">end</FONT></B>
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>datatype&nbsp;Arch.t</tt> 
+</p>
+</li>
+
+        <ul>
+
+  the architectures to which MLton can compile. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>Arch.fromString&nbsp;a</tt> 
+</p>
+</li>
+
+        <ul>
+
+  convert from string to architecture.  Case insensitive. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>Arch.host</tt> 
+</p>
+</li>
+
+        <ul>
+
+  the architecture for which the program is compiled. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>Arch.toString</tt> 
+</p>
+</li>
+
+        <ul>
+
+  string for architecture. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>datatype&nbsp;OS.t</tt> 
+</p>
+</li>
+
+        <ul>
+
+  the operating systems to which MLton can compile. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>OS.fromString</tt> 
+</p>
+</li>
+
+        <ul>
+
+  convert from string to operating system.  Case insensitive. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>OS.host</tt> 
+</p>
+</li>
+
+        <ul>
+
+  the operating system for which the program is compiled. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>OS.toString</tt> 
+</p>
+</li>
+
+        <ul>
+
+  string for operating system. </ul>
+
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-09 22:12:46 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MLtonPointer
===================================================================
--- mlton/trunk/doc/guide/MLtonPointer	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MLtonPointer	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,196 @@
+<!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>MLtonPointer - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MLtonPointer
+    <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">
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> MLTON_POINTER =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">eqtype</FONT></B><FONT COLOR="#228B22"><B> t
+
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> add: t * word -&gt; t
+      <B><FONT COLOR="#A020F0">val</FONT></B> compare: t * t -&gt; order
+      <B><FONT COLOR="#A020F0">val</FONT></B> diff: t * t -&gt; word
+      <B><FONT COLOR="#A020F0">val</FONT></B> getInt8: t * int -&gt; Int8.int
+      <B><FONT COLOR="#A020F0">val</FONT></B> getInt16: t * int -&gt; Int16.int
+      <B><FONT COLOR="#A020F0">val</FONT></B> getInt32: t * int -&gt; Int32.int
+      <B><FONT COLOR="#A020F0">val</FONT></B> getInt64: t * int -&gt; Int64.int
+      <B><FONT COLOR="#A020F0">val</FONT></B> getPointer: t * int -&gt; t
+      <B><FONT COLOR="#A020F0">val</FONT></B> getReal32: t * int -&gt; Real32.real
+      <B><FONT COLOR="#A020F0">val</FONT></B> getReal64: t * int -&gt; Real64.real
+      <B><FONT COLOR="#A020F0">val</FONT></B> getWord8: t * int -&gt; Word8.word
+      <B><FONT COLOR="#A020F0">val</FONT></B> getWord16: t * int -&gt; Word16.word
+      <B><FONT COLOR="#A020F0">val</FONT></B> getWord32: t * int -&gt; Word32.word
+      <B><FONT COLOR="#A020F0">val</FONT></B> getWord64: t * int -&gt; Word64.word
+      <B><FONT COLOR="#A020F0">val</FONT></B> null: t
+      <B><FONT COLOR="#A020F0">val</FONT></B> setInt8: t * int * Int8.int -&gt; unit
+      <B><FONT COLOR="#A020F0">val</FONT></B> setInt16: t * int * Int16.int -&gt; unit
+      <B><FONT COLOR="#A020F0">val</FONT></B> setInt32: t * int * Int32.int -&gt; unit
+      <B><FONT COLOR="#A020F0">val</FONT></B> setInt64: t * int * Int64.int -&gt; unit
+      <B><FONT COLOR="#A020F0">val</FONT></B> setPointer: t * int * t -&gt; unit
+      <B><FONT COLOR="#A020F0">val</FONT></B> setReal32: t * int * Real32.real -&gt; unit
+      <B><FONT COLOR="#A020F0">val</FONT></B> setReal64: t * int * Real64.real -&gt; unit
+      <B><FONT COLOR="#A020F0">val</FONT></B> setWord8: t * int * Word8.word -&gt; unit
+      <B><FONT COLOR="#A020F0">val</FONT></B> setWord16: t * int * Word16.word -&gt; unit
+      <B><FONT COLOR="#A020F0">val</FONT></B> setWord32: t * int * Word32.word -&gt; unit
+      <B><FONT COLOR="#A020F0">val</FONT></B> setWord64: t * int * Word64.word -&gt; unit
+      <B><FONT COLOR="#A020F0">val</FONT></B> sub: t * word -&gt; t
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>eqtype&nbsp;t</tt> 
+</p>
+</li>
+
+        <ul>
+
+  The type of pointers, i.e. machine addresses. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>add&nbsp;(p,&nbsp;w)</tt> 
+</p>
+</li>
+
+        <ul>
+
+  returns the pointer <tt>w</tt> bytes after than <tt>p</tt>.  Does not check   for overflow. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>compare&nbsp;(p1,&nbsp;p2)</tt> 
+</p>
+</li>
+
+        <ul>
+
+  compare the pointer <tt>p1</tt> to the pointer <tt>p2</tt> (as addresses). 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>diff&nbsp;(p1,&nbsp;p2)</tt> 
+</p>
+</li>
+
+        <ul>
+
+  returns the number of bytes <tt>w</tt> such that <tt>add&nbsp;(p2,&nbsp;w)&nbsp;=&nbsp;p1</tt>.   Does not check for overflow. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>get</tt><em>X</em><tt>&nbsp;(p,&nbsp;i)</tt> 
+</p>
+</li>
+
+        <ul>
+
+  returns the object stored at index i of the array of {<em>X</em> objects   pointed to by <tt>p</tt>.  For example, <tt>getWord32&nbsp;(p,&nbsp;7)</tt> returns   the 32-bit word stored 28 bytes beyond <tt>p</tt>. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>null</tt> 
+</p>
+</li>
+
+        <ul>
+
+  the null pointer, i.e. 0. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>set</tt><em>X</em><tt>&nbsp;(p,&nbsp;i,&nbsp;v)</tt> 
+</p>
+</li>
+
+        <ul>
+
+  assigns <tt>v</tt> to the object stored at index i of the array of <em>X</em>   objects pointed to by <tt>p</tt>.  For example,   <tt>setWord32&nbsp;(p,&nbsp;7,&nbsp;w)</tt> stores the 32-bit word <tt>w</tt> at the   address 28 bytes beyond <tt>p</tt>.  
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>sub&nbsp;(p,&nbsp;w)</tt> 
+</p>
+</li>
+
+        <ul>
+
+  returns the pointer <tt>w</tt> bytes before <tt>p</tt>.  Does not check for   overflow. </ul>
+
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-02-09 06:40:25 by <span title="ip68-108-63-84.lv.lv.cox.net"><a href="ChrisClearwater">ChrisClearwater</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MLtonProcEnv
===================================================================
--- mlton/trunk/doc/guide/MLtonProcEnv	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MLtonProcEnv	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,97 @@
+<!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>MLtonProcEnv - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MLtonProcEnv
+    <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">
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> MLTON_PROC_ENV =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">val</FONT></B> setenv: {name: string, value: string} -&gt; unit
+      <B><FONT COLOR="#A020F0">val</FONT></B> setgroups: Posix.ProcEnv.gid list -&gt; unit
+  <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>setenv&nbsp;{name,&nbsp;value</tt>} 
+</p>
+</li>
+
+        <ul>
+
+  Like the C <tt>setenv</tt> function.  Does not require <tt>name</tt> or   <tt>value</tt> to be null terminated. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>setgroups&nbsp;grps</tt> 
+</p>
+</li>
+
+        <ul>
+
+  Like the C <tt>setgroups</tt> function. </ul>
+
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-07 22:14:28 by <span title="pool-71-243-10-187.bos.east.verizon.net"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MLtonProcess
===================================================================
--- mlton/trunk/doc/guide/MLtonProcess	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MLtonProcess	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,494 @@
+<!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>MLtonProcess - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MLtonProcess
+    <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">
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> MLTON_PROCESS =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> pid </FONT></B>=<FONT COLOR="#228B22"><B> Posix.Process.pid
+
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> spawn: {path: string, args: string list} -&gt; pid
+      <B><FONT COLOR="#A020F0">val</FONT></B> spawne: {path: string, args: string list, env: string list} -&gt; pid
+      <B><FONT COLOR="#A020F0">val</FONT></B> spawnp: {file: string, args: string list} -&gt; pid
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<p>
+The <tt>spawn</tt> functions provide an alternative to the <tt>fork</tt>/<tt>exec</tt> idiom that is typically used to create a new process.  On most platforms, the <tt>spawn</tt> functions are simple wrappers around <tt>fork</tt>/<tt>exec</tt>.  However, on Cygwin, the <tt>spawn</tt> functions are primitive and are both faster and more reliable than <tt>fork</tt>/<tt>exec</tt>.  All <tt>spawn</tt> functions return the process id of the spawned process.  They differ in how the executable is found and the environment that it uses. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>spawn&nbsp;{path,&nbsp;args</tt>} 
+</p>
+</li>
+
+        <ul>
+
+  Start a new process running the executable specified by <tt>path</tt>   with the arguments <tt>args</tt>.  Like <tt>Posix.Process.exec</tt>. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>spawne&nbsp;{path,&nbsp;args,&nbsp;env</tt>} 
+</p>
+</li>
+
+        <ul>
+
+  Start a new process running the executable specified by <tt>path</tt>   with the arguments <tt>args</tt> and environment <tt>env</tt>.  Like   <tt>Posix.Process.exece</tt>.  
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>spawnp&nbsp;{file,&nbsp;args</tt>} 
+</p>
+</li>
+
+        <ul>
+
+  Search the <tt>PATH</tt> environment variable for an executable named   <tt>file</tt>, and start a new process running that executable with the   arguments <tt>args</tt>.  Like <tt>Posix.Process.execp</tt>. 
+        </ul>
+
+
+
+    </ul>
+
+
+<h2 id="head-a283e7658f43ceca065ff16e5fc5a2383c955359">Changes since the current public release</h2>
+<p>
+Since the release of MLton 20041109, we have extended <tt>MLTON_PROCESS</tt> with a <tt>create</tt> function similar to <tt>Unix.executeInEnv</tt>, except that it allows more control over the input, output, and error streams. <tt>create</tt> works on all platforms, including Cygwin and MinGW where <tt>Posix.fork</tt> is unavailable. 
+</p>
+<p>
+The <tt>Unix</tt> module is implemented using <tt>MLton.Process.create</tt>. Hence, for greatest portability programs should now use the standard <tt>Unix.execute</tt>, <tt>Unix.executeInEnv</tt>, and <tt>OS.Process.system</tt>. 
+</p>
+<p>
+It is only necessary to use <tt>MLton.Process</tt> if you need the additional functionality of <tt>create</tt>.  However, for applications targetting only MLton, <tt>MLton.Process</tt> is more portable than <tt>Posix.fork</tt> which requires POSIX compliance from the host. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> MLTON_PROCESS =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> pid </FONT></B>=<FONT COLOR="#228B22"><B> Posix.Process.pid
+
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> spawn: {path: string, args: string list} -&gt; pid
+      <B><FONT COLOR="#A020F0">val</FONT></B> spawne: {path: string, args: string list, env: string list} -&gt; pid
+      <B><FONT COLOR="#A020F0">val</FONT></B> spawnp: {file: string, args: string list} -&gt; pid
+
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> ('stdin, 'stdout, 'stderr) t
+      </FONT></B><B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> none
+      </FONT></B><B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> chain
+      </FONT></B><B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> any
+
+      </FONT></B><B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> input
+      </FONT></B><B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> output
+
+      </FONT></B><B><FONT COLOR="#A020F0">exception</FONT></B><FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">MisuseOfForget</FONT>
+      </FONT></B><B><FONT COLOR="#A020F0">exception</FONT></B><FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">DoublyRedirected</FONT>
+
+      </FONT></B><B><FONT COLOR="#0000FF">structure</FONT></B> Child:
+        <B><FONT COLOR="#0000FF">sig</FONT></B>
+          <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> ('use, 'dir) t
+
+          </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> binIn: (BinIO.instream, input) t -&gt; BinIO.instream
+          <B><FONT COLOR="#A020F0">val</FONT></B> binOut: (BinIO.outstream, output) t -&gt; BinIO.outstream
+          <B><FONT COLOR="#A020F0">val</FONT></B> textIn: (TextIO.instream, input) t -&gt; TextIO.instream
+          <B><FONT COLOR="#A020F0">val</FONT></B> textOut: (TextIO.outstream, output) t -&gt; TextIO.outstream
+          <B><FONT COLOR="#A020F0">val</FONT></B> fd: (Posix.FileSys.file_desc, 'dir) t -&gt; Posix.FileSys.file_desc
+
+          <B><FONT COLOR="#A020F0">val</FONT></B> remember: (any, 'dir) t -&gt; ('use, 'dir) t
+        <B><FONT COLOR="#0000FF">end</FONT></B>
+
+      <B><FONT COLOR="#0000FF">structure</FONT></B> Param:
+        <B><FONT COLOR="#0000FF">sig</FONT></B>
+          <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> ('use, 'dir) t
+
+          </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> null: (none, 'dir) t
+          <B><FONT COLOR="#A020F0">val</FONT></B> self: (none, 'dir) t
+          <B><FONT COLOR="#A020F0">val</FONT></B> file: string -&gt; (none, 'dir) t
+          <B><FONT COLOR="#A020F0">val</FONT></B> child: (chain, 'dir) Child.t -&gt; (none, 'dir) t
+          <B><FONT COLOR="#A020F0">val</FONT></B> pipe: ('use, 'dir) t
+          <B><FONT COLOR="#A020F0">val</FONT></B> fd: Posix.FileSys.file_desc -&gt; (none, 'dir) t
+
+          <B><FONT COLOR="#A020F0">val</FONT></B> forget: ('use, 'dir) t -&gt; (any, 'dir) t
+        <B><FONT COLOR="#0000FF">end</FONT></B>
+
+      <B><FONT COLOR="#A020F0">val</FONT></B> create:
+         {args: string list,
+          path: string,
+          env: string list option,
+          stdin: ('stdin, input) Param.t,
+          stdout: ('stdout, output) Param.t}
+          stderr: ('stderr, output) Param.t,
+         -&gt; ('stdin, 'stdout, 'stderr) t
+
+      <B><FONT COLOR="#A020F0">val</FONT></B> getStdin:  ('stdin, 'stdout, 'stderr) t -&gt; ('stdin, output) Child.t
+      <B><FONT COLOR="#A020F0">val</FONT></B> getStdout: ('stdin, 'stdout, 'stderr) t -&gt; ('stdout, input) Child.t
+      <B><FONT COLOR="#A020F0">val</FONT></B> getStderr: ('stdin, 'stdout, 'stderr) t -&gt; ('stderr, input) Child.t
+
+      <B><FONT COLOR="#A020F0">val</FONT></B> kill: ('stdin, 'stdout, 'stderr) t * Posix.Signal.signal -&gt; unit
+      <B><FONT COLOR="#A020F0">val</FONT></B> reap: ('stdin, 'stdout, 'stderr) t -&gt; Posix.Process.exit_status
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>type&nbsp;('stdin,&nbsp;'stdout,&nbsp;'stderr)&nbsp;t</tt> 
+</p>
+</li>
+
+        <ul>
+
+  This type represents a handle to a child process. The three polymorphic   types capture how the named stream of the child process may be used. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>type&nbsp;none</tt> 
+</p>
+</li>
+
+        <ul>
+
+  The type <tt>none</tt> means that the child process's stream my not be used   by the parent process. This happens when the child process is connected   directly to some source. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>type&nbsp;chain</tt> 
+</p>
+</li>
+
+        <ul>
+
+  The type <tt>chain</tt> means that the child process's stream was connected   via a pipe to the parent process. The parent process may pass this pipe   in turn to another child, thus chaining them together. This use sets the   polymorphic type of the connected stream to <tt>chain</tt>. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>type&nbsp;any</tt> 
+</p>
+</li>
+
+        <ul>
+
+  In situations where an application does not want the type system to   force correct usage, this placeholder type can bypass it. See   <tt>Child.remember</tt> and <tt>Param.forget</tt>. 
+        </ul>
+
+
+
+    </ul>
+
+
+<p>
+The types <tt>BinIO.instream</tt>, <tt>BinIO.outstream</tt>, <tt>TextIO.instream</tt>, <tt>TextIO.outstream</tt>, and <tt>Posix.FileSys.file_desc</tt> are also vaild uses to which child streams may be put. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>type&nbsp;input,&nbsp;output</tt> 
+</p>
+</li>
+
+        <ul>
+
+  These two types take note of the direction a stream flows.   It is used as a part of <tt>Param.t</tt> and <tt>Child.t</tt> and is detailed   there. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>exception&nbsp;MisuseOfForget</tt> 
+</p>
+</li>
+
+        <ul>
+
+  If <tt>Child.remember</tt> and <tt>Param.forget</tt> are used to bypass the   normal type checking, this may be raised. This exception will only be   raised in cases where the <tt>forget</tt> mechanism allows a misuse that   would be impossible with the type-safe versions. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>exception&nbsp;DoublyRedirected</tt> 
+</p>
+</li>
+
+        <ul>
+
+  If a stream connected to a child process is redirected to two separate   child processes, this exception is raised. It is safe, though bad style,   to use the a <tt>Child.t</tt> with the same <tt>Child.*</tt> method repeatedly. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>('use,&nbsp;'dir)&nbsp;Child.t</tt> 
+</p>
+</li>
+
+        <ul>
+
+  This represents a handle to one of a child's standard streams. The 'dir   is viewed with respect to the parent. Thus a <tt>('a,&nbsp;input)&nbsp;Child.t</tt>   handle means that the parent may input the output from the child. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>Child.{bin,text}{In,Out</tt>} 
+</p>
+</li>
+
+        <ul>
+
+  These methods take a handle and bind it to a SML stream of the named type.   The type system will detect attempts to reverse the direction of a stream   or to use the same stream in multiple, incompatible ways. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>Child.fd</tt> 
+</p>
+</li>
+
+        <ul>
+
+  This method behaves like the other <tt>Child.*</tt> methods; it opens a   stream. However, it does not enforce that you read or write from the   handle. If you use the descriptor in an appropriate direction, the   behaviour is undefined. Furthermore, this method may potentially be   unavailable on future MLton host platforms. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>Child.remember</tt> 
+</p>
+</li>
+
+        <ul>
+
+  This method takes a stream of use <tt>any</tt> and resets the use of the   stream so that the stream may be used by <tt>Child.*</tt>. An <tt>any</tt>   stream may have had use <tt>none</tt> or <tt>'use</tt> prior to calling   <tt>Param.forget</tt>. If the stream was <tt>none</tt> and is used,   <tt>MisuseOfForget</tt> is raised. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>('use,&nbsp;'dir)&nbsp;Param.t</tt> 
+</p>
+</li>
+
+        <ul>
+
+  This is a handle to an input/output source which will be passed to the   created child processs. The <tt>'dir</tt> is relative to the child process.   Input means that the child process will read from this stream. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>Param.null</tt> 
+</p>
+</li>
+
+        <ul>
+
+  In some situations, the child process should have its output discarded.   The null param when passed as <tt>stdout</tt> or <tt>stderr</tt> does this.   When used for <tt>stdin</tt>, the child process will either receive EOF   or a failure condition if it attempts to read from <tt>stdin</tt>. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>Param.file</tt> 
+</p>
+</li>
+
+        <ul>
+
+  Open the given file and connect it to the child process. Note that the   file will be opened only when <tt>create</tt> is called. So any exceptions   will be raised there and not by this method. If used for <tt>input</tt>, the   file is opened read-only. If used for <tt>output</tt>, the file is opened   read-write. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>Param.child</tt> 
+</p>
+</li>
+
+        <ul>
+
+  Connect the stream of the new child process to the stream of a previously   created child process. A single child stream should be connected to only   one child process or else <tt>DoublyRedirected</tt> will be raised. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>Param.pipe</tt> 
+</p>
+</li>
+
+        <ul>
+
+  This will connect the input/output of the child process to a pipe which   the parent process holds. This may later form the input to one of the   <tt>Child.*</tt> methods and/or the <tt>Param.child</tt> method. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>Param.fd</tt> 
+</p>
+</li>
+
+        <ul>
+
+  This creates a stream from the provided file descriptor which will be   closed when <tt>create</tt> is called. This method may not be available on   future MLton host platforms. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>Param.forget</tt> 
+</p>
+</li>
+
+        <ul>
+
+  This hides the type of the actual parameter as <tt>any</tt>. This is useful   if you are implementing an application which conditionally attaches the   child process to files or pipes. However, you must ensure that your use   after <tt>Child.remember</tt> matches the original type. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>create</tt> 
+</p>
+</li>
+
+        <ul>
+
+  Start a child process with the given command-line <tt>args</tt> (excluding   the program name). <tt>path</tt> should be an absolute path to the executable   run in the new child process; relative paths work, but are less safe.   Optionally, the environment may be overriden with <tt>env</tt> where each   string element has the form <tt>"key=value"</tt>. The <tt>std*</tt> options   must be provided by the <tt>Param.*</tt> methods documented above. <p>
+  Processes which are <tt>create</tt>d must be either <tt>reap</tt>ed or   <tt>kill</tt>ed. 
+</p>
+
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>getStd{in,out,err</tt>} 
+</p>
+</li>
+
+        <ul>
+
+  Get a handle to the specified stream. These should be used by the   <tt>Child.*</tt> methods. Failure to use a stream connected via pipe to a   child process may result in runtime dead-lock and elicts a compiler   warning. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>kill</tt> 
+</p>
+</li>
+
+        <ul>
+
+  Terminate the child process immediately.   The signal may or may not mean anything depending on the host platform.   A good value is <tt>Posix.Signal.term</tt>. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>reap</tt> 
+</p>
+</li>
+
+        <ul>
+
+  Wait for the child process to terminate and return its exit status. 
+        </ul>
+
+
+
+    </ul>
+
+
+<h2 id="head-1bd1007a907ddfb4201460172ceb074df91cb3a0">Important usage notes</h2>
+<p>
+When building an application with many pipes between child processes, it is important to ensure that there are no cycles in the undirected pipe graph. If this property is not maintained, deadlocks are a very serious potential bug which may only appear under difficult to reproduce conditions. 
+</p>
+<p>
+The danger lies in that most operating systems implement pipes with a fixed buffer size. If process A has two output pipes which process B reads, it can happen that process A blocks writing to pipe 2 because it is full while process B blocks reading from pipe 1 because it is empty. This same situation can happen with any undirected cycle formed between processes (vertexes) and pipes  (undirected edges) in the graph. 
+</p>
+<p>
+It is possible to make this safe using low-level I/O primitives for polling. However, these primitives are not very portable and difficult to use properly. A far better approach is to make sure you never create a cycle in the first  place. 
+</p>
+<p>
+For these reasons, the Unix.executeInEnv is a very dangerous method. Be  careful when using it to ensure that the child process only operates on  either <tt>stdin</tt> or <tt>stdout</tt>, but not both. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-07 22:23:51 by <span title="ce2.hrz.tu-darmstadt.de"><a href="WesleyTerpstra">WesleyTerpstra</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MLtonProfile
===================================================================
--- mlton/trunk/doc/guide/MLtonProfile	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MLtonProfile	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,258 @@
+<!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>MLtonProfile - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MLtonProfile
+    <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">
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> MLTON_PROFILE =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#0000FF">structure</FONT></B> Data:
+         <B><FONT COLOR="#0000FF">sig</FONT></B>
+            <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t
+
+            </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> equals: t * t -&gt; bool
+            <B><FONT COLOR="#A020F0">val</FONT></B> free: t -&gt; unit
+            <B><FONT COLOR="#A020F0">val</FONT></B> malloc: unit -&gt; t
+            <B><FONT COLOR="#A020F0">val</FONT></B> write: t * string -&gt; unit
+         <B><FONT COLOR="#0000FF">end</FONT></B>
+
+      <B><FONT COLOR="#A020F0">val</FONT></B> isOn: bool
+      <B><FONT COLOR="#A020F0">val</FONT></B> withData: Data.t * (unit -&gt; 'a) -&gt; 'a
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<p>
+<tt>MLton.Profile</tt> provides <a href="Profiling">Profiling</a> control from within the program, allowing you to profile individual portions of your program. With <tt>MLton.Profile</tt>, you can create many units of profiling data (essentially, mappings from functions to counts) during a run of a program, to switch between them while the program is running, and to output multiple <tt>mlmon.out</tt> files. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>isOn</tt> 
+</p>
+</li>
+
+            <ul>
+
+   A compile-time constant that is true when compiling     <tt>-profile&nbsp;time</tt> or <tt>-profile&nbsp;alloc</tt>. 
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>type&nbsp;Data.t</tt>  
+</p>
+</li>
+
+            <ul>
+
+   The type of a unit of profiling data.    In order to most efficiently execute non-profiled programs,    when compiling <tt>-profile&nbsp;no</tt> (the default), <tt>Data.t</tt> is    equivalent to <tt>unit&nbsp;ref</tt>.  
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>Data.equals&nbsp;(x,&nbsp;y)</tt> 
+</p>
+</li>
+
+            <ul>
+
+   Returns true if the <tt>x</tt> and <tt>y</tt> are the same unit of    profiling data. 
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>Data.free&nbsp;x</tt> 
+</p>
+</li>
+
+            <ul>
+
+   Frees the memory associated with the unit of profiling data    <tt>x</tt>.  It is an error to free the current unit of profiling data    or to free a previously freed unit of profiling data.  When    compiling <tt>-profile&nbsp;no</tt>, <tt>Data.free&nbsp;x</tt> is a no-op. 
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>Data.malloc&nbsp;()</tt> 
+</p>
+</li>
+
+            <ul>
+
+   Returns a new unit of profiling data.  Each unit of profiling data    is allocated from the process address space (but is <em>not</em> in the    MLton heap) and consumes memory proportional to the number of    source functions.  When compiling <tt>-profile&nbsp;no</tt>,    <tt>Data.malloc&nbsp;()</tt> is equivalent to allocating a new <tt>unit&nbsp;ref</tt>. 
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>write&nbsp;(x,&nbsp;f)</tt> 
+</p>
+</li>
+
+            <ul>
+
+   Writes the accumulated ticks in the unit of profiling data <tt>x</tt>    to file <tt>f</tt>.  It is an error to write a previously freed unit    of profiling data.  When compiling <tt>-profile&nbsp;no</tt>,     <tt>write&nbsp;(x,&nbsp;f)</tt> is a no-op.  A profiled program will always    write the current unit of profiling data at program exit to a file    named <tt>mlmon.out</tt>.  
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>withData&nbsp;(d,&nbsp;f)</tt> 
+</p>
+</li>
+
+            <ul>
+
+   Runs <tt>f</tt> with <tt>d</tt> as the unit of profiling data, and    returns the result of <tt>f</tt> after restoring the current unit of    profiling data.  When compiling <tt>-profile&nbsp;no</tt>,     <tt>withData&nbsp;(d,&nbsp;f)</tt> is equivalent to <tt>f&nbsp;()</tt>. 
+            </ul>
+
+
+
+    </ul>
+
+
+<h2 id="head-0f01ed56a1e32a05e5ef96e4d779f34784af9a96">Example</h2>
+<p>
+Here is an example, taken from the <tt>examples/profiling</tt> directory, showing how to profile the executions of the <tt>fib</tt> and <tt>tak</tt> functions separately.  Suppose that <tt>fib-tak.sml</tt> contains the following. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">structure</FONT></B> Profile = MLton.Profile
+   
+<B><FONT COLOR="#A020F0">val</FONT></B> fibData = Profile.Data.malloc ()
+<B><FONT COLOR="#A020F0">val</FONT></B> takData = Profile.Data.malloc ()
+
+<B><FONT COLOR="#A020F0">fun</FONT></B> wrap (f, d) x =
+   Profile.withData (d, <B><FONT COLOR="#A020F0">fn</FONT></B> () =&gt; f x)
+
+<B><FONT COLOR="#A020F0">val</FONT></B> <B><FONT COLOR="#A020F0">rec</FONT></B> fib =
+   <B><FONT COLOR="#A020F0">fn</FONT></B> <B><FONT COLOR="#5F9EA0">0</FONT></B> =&gt; <B><FONT COLOR="#5F9EA0">0</FONT></B>
+    | <B><FONT COLOR="#5F9EA0">1</FONT></B> =&gt; <B><FONT COLOR="#5F9EA0">1</FONT></B>
+    | n =&gt; fib (n - <B><FONT COLOR="#5F9EA0">1</FONT></B>) + fib (n - <B><FONT COLOR="#5F9EA0">2</FONT></B>)
+<B><FONT COLOR="#A020F0">val</FONT></B> fib = wrap (fib, fibData)
+
+<B><FONT COLOR="#A020F0">fun</FONT></B> tak (x,y,z) =
+   <B><FONT COLOR="#A020F0">if</FONT></B> not (y &lt; x)
+      <B><FONT COLOR="#A020F0">then</FONT></B> z
+   <B><FONT COLOR="#A020F0">else</FONT></B> tak (tak (x - <B><FONT COLOR="#5F9EA0">1</FONT></B>, y, z),
+             tak (y - <B><FONT COLOR="#5F9EA0">1</FONT></B>, z, x),
+             tak (z - <B><FONT COLOR="#5F9EA0">1</FONT></B>, x, y))
+<B><FONT COLOR="#A020F0">val</FONT></B> tak = wrap (tak, takData)
+
+<B><FONT COLOR="#A020F0">val</FONT></B> <B><FONT COLOR="#A020F0">rec</FONT></B> f =
+   <B><FONT COLOR="#A020F0">fn</FONT></B> <B><FONT COLOR="#5F9EA0">0</FONT></B> =&gt; ()
+    | n =&gt; (fib <B><FONT COLOR="#5F9EA0">38</FONT></B>; f (n-<B><FONT COLOR="#5F9EA0">1</FONT></B>))
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = f <B><FONT COLOR="#5F9EA0">2</FONT></B>
+
+<B><FONT COLOR="#A020F0">val</FONT></B> <B><FONT COLOR="#A020F0">rec</FONT></B> g =
+   <B><FONT COLOR="#A020F0">fn</FONT></B> <B><FONT COLOR="#5F9EA0">0</FONT></B> =&gt; ()
+    | n =&gt; (tak (<B><FONT COLOR="#5F9EA0">18</FONT></B>,<B><FONT COLOR="#5F9EA0">12</FONT></B>,<B><FONT COLOR="#5F9EA0">6</FONT></B>); g (n-<B><FONT COLOR="#5F9EA0">1</FONT></B>))
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = g <B><FONT COLOR="#5F9EA0">500</FONT></B>
+
+<B><FONT COLOR="#A020F0">fun</FONT></B> done (data, file) =
+   (Profile.Data.write (data, file)
+    ; Profile.Data.free data)
+    
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = done (fibData, <FONT COLOR="#BC8F8F"><B>&quot;mlmon.fib.out&quot;</FONT></B>)
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = done (takData, <FONT COLOR="#BC8F8F"><B>&quot;mlmon.tak.out&quot;</FONT></B>)
+</PRE>
+<p>
+ 
+</p>
+<p>
+Compile and run the program. 
+</p>
+
+<pre>% mlton -profile time fib-tak.sml
+% ./fib-tak
+</pre><p>
+Separately display the profiling data for <tt>fib</tt>  
+</p>
+
+<pre>% mlprof fib-tak mlmon.fib.out
+5.77 seconds of CPU time (0.00 seconds GC)
+function   cur 
+--------- -----
+fib       96.9%
+&lt;unknown&gt;  3.1%
+</pre><p>
+and for <tt>tak</tt> 
+</p>
+
+<pre>% mlprof fib-tak mlmon.tak.out
+0.68 seconds of CPU time (0.00 seconds GC)
+function  cur  
+-------- ------
+tak      100.0%
+</pre><p>
+Combine the data for <tt>fib</tt> and <tt>tak</tt> by calling <tt>mlprof</tt> with multiple <tt>mlmon.out</tt> files. 
+</p>
+
+<pre>% mlprof fib-tak mlmon.fib.out mlmon.tak.out mlmon.out
+6.45 seconds of CPU time (0.00 seconds GC)
+function   cur 
+--------- -----
+fib       86.7%
+tak       10.5%
+&lt;unknown&gt;  2.8%
+</pre></div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-26 20:33:24 by <span title="cfs36.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MLtonRandom
===================================================================
--- mlton/trunk/doc/guide/MLtonRandom	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MLtonRandom	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,149 @@
+<!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>MLtonRandom - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MLtonRandom
+    <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">
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> MLTON_RANDOM =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">val</FONT></B> alphaNumChar: unit -&gt; char
+      <B><FONT COLOR="#A020F0">val</FONT></B> alphaNumString: int -&gt; string
+      <B><FONT COLOR="#A020F0">val</FONT></B> rand: unit -&gt; word
+      <B><FONT COLOR="#A020F0">val</FONT></B> seed: unit -&gt; word option
+      <B><FONT COLOR="#A020F0">val</FONT></B> srand: word -&gt; unit
+      <B><FONT COLOR="#A020F0">val</FONT></B> useed: unit -&gt; word option
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>alphaNumChar&nbsp;()</tt> 
+</p>
+</li>
+
+        <ul>
+
+  returns a random alphanumeric character. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>alphaNumString&nbsp;n</tt> 
+</p>
+</li>
+
+        <ul>
+
+  return a string of length <tt>n</tt> of random alphanumeric   characters.  
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>rand&nbsp;()</tt> 
+</p>
+</li>
+
+        <ul>
+
+  return the next pseudrandom number. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>seed&nbsp;()</tt> 
+</p>
+</li>
+
+        <ul>
+
+  return a random word from <tt>/dev/random</tt>.  Useful as an arg to   <tt>srand</tt>.  If <tt>/dev/random</tt> can not be read from,    <tt>seed&nbsp;()</tt> returns <tt>NONE</tt>.  A call to <tt>seed</tt> may block   until enough random bits are available. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>srand&nbsp;w</tt> 
+</p>
+</li>
+
+        <ul>
+
+  set the seed used by <tt>rand</tt> to <tt>w</tt>. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>useed&nbsp;()</tt> 
+</p>
+</li>
+
+        <ul>
+
+  return a random word from <tt>/dev/urandom</tt>.  Useful as an arg to   <tt>srand</tt>.  If <tt>/dev/urandom</tt> can not be read from,    <tt>useed&nbsp;()</tt> returns <tt>NONE</tt>.  A call to <tt>useed</tt> will never   block -- it will instead return lower quality random bits. </ul>
+
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-02 04:28:04 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MLtonRlimit
===================================================================
--- mlton/trunk/doc/guide/MLtonRlimit	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MLtonRlimit	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,153 @@
+<!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>MLtonRlimit - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MLtonRlimit
+    <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">
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> MLTON_RLIMIT =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> rlim </FONT></B>=<FONT COLOR="#228B22"><B> word
+               
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> infinity: rlim
+
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t
+               
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> coreFileSize: t        <I><FONT COLOR="#B22222">(* CORE    max core file size *)</FONT></I>
+      <B><FONT COLOR="#A020F0">val</FONT></B> cpuTime: t             <I><FONT COLOR="#B22222">(* CPU     CPU time in seconds *)</FONT></I>
+      <B><FONT COLOR="#A020F0">val</FONT></B> dataSize: t            <I><FONT COLOR="#B22222">(* DATA    max data size *)</FONT></I>
+      <B><FONT COLOR="#A020F0">val</FONT></B> fileSize: t            <I><FONT COLOR="#B22222">(* FSIZE   Maximum filesize *)</FONT></I>
+      <B><FONT COLOR="#A020F0">val</FONT></B> lockedInMemorySize: t  <I><FONT COLOR="#B22222">(* MEMLOCK max locked address space *)</FONT></I>
+      <B><FONT COLOR="#A020F0">val</FONT></B> numFiles: t            <I><FONT COLOR="#B22222">(* NOFILE  max number of open files *)</FONT></I>  
+      <B><FONT COLOR="#A020F0">val</FONT></B> numProcesses: t        <I><FONT COLOR="#B22222">(* NPROC   max number of processes *)</FONT></I>
+      <B><FONT COLOR="#A020F0">val</FONT></B> residentSetSize: t     <I><FONT COLOR="#B22222">(* RSS     max resident set size *)</FONT></I>
+      <B><FONT COLOR="#A020F0">val</FONT></B> stackSize: t           <I><FONT COLOR="#B22222">(* STACK   max stack size *)</FONT></I>
+      <B><FONT COLOR="#A020F0">val</FONT></B> virtualMemorySize: t   <I><FONT COLOR="#B22222">(* AS      virtual memory limit *)</FONT></I>
+      
+      <B><FONT COLOR="#A020F0">val</FONT></B> get: t -&gt; {hard: rlim, soft: rlim}
+      <B><FONT COLOR="#A020F0">val</FONT></B> set: t * {hard: rlim, soft: rlim} -&gt; unit
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<p>
+<tt>MLton.Rlimit</tt> provides a wrapper around the C <tt>getrlimit</tt> and <tt>setrlimit</tt> functions. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>type&nbsp;rlim</tt> 
+</p>
+</li>
+
+        <ul>
+
+  the type of resource limits. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>infinity</tt> 
+</p>
+</li>
+
+        <ul>
+
+  indicates that a resource is unlimited. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>type&nbsp;t</tt> 
+</p>
+</li>
+
+        <ul>
+
+  the types of resources that can be inspected and modified. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>get&nbsp;r</tt> 
+</p>
+</li>
+
+        <ul>
+
+  returns the current hard and soft limits for resource <tt>r</tt>. May   raise <tt>OS.SysErr</tt>. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>set&nbsp;(r,&nbsp;{hard,&nbsp;soft})</tt> 
+</p>
+</li>
+
+        <ul>
+
+  sets the hard and soft limits for resource <tt>r</tt>.  May raise   <tt>OS.SysErr</tt>.  </ul>
+
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-02 04:28:25 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MLtonRusage
===================================================================
--- mlton/trunk/doc/guide/MLtonRusage	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MLtonRusage	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,101 @@
+<!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>MLtonRusage - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MLtonRusage
+    <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">
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> MLTON_RUSAGE =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> {utime: Time.time, <I><FONT COLOR="#B22222">(* user time *)</FONT></I>
+                stime: Time.time} <I><FONT COLOR="#B22222">(* system time *)</FONT></I>
+         
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> rusage: unit -&gt; {children: t,
+                           gc: t,
+                           self: t}
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>type&nbsp;t</tt> 
+</p>
+</li>
+
+        <ul>
+
+  corresponds to a subset of the C <tt>struct&nbsp;rusage</tt>. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>rusage&nbsp;()</tt> 
+</p>
+</li>
+
+        <ul>
+
+  corresponds to the C <tt>getrusage</tt> function.  It returns the   resource usage of the exited children, the garbage collector, and   the process itself.  The process time (<tt>self</tt>) includes the gc   time.  </ul>
+
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-02 04:28:42 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MLtonSignal
===================================================================
--- mlton/trunk/doc/guide/MLtonSignal	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MLtonSignal	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,444 @@
+<!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>MLtonSignal - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MLtonSignal
+    <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">
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> MLTON_SIGNAL =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t
+      </FONT></B><B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> signal </FONT></B>=<FONT COLOR="#228B22"><B> t
+
+      </FONT></B><B><FONT COLOR="#0000FF">structure</FONT></B> Handler:
+         <B><FONT COLOR="#0000FF">sig</FONT></B>
+            <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t
+
+            </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> default: t
+            <B><FONT COLOR="#A020F0">val</FONT></B> handler: (Thread.Runnable.t -&gt; Thread.Runnable.t) -&gt; t
+            <B><FONT COLOR="#A020F0">val</FONT></B> ignore: t
+            <B><FONT COLOR="#A020F0">val</FONT></B> isDefault: t -&gt; bool
+            <B><FONT COLOR="#A020F0">val</FONT></B> isIgnore: t -&gt; bool
+            <B><FONT COLOR="#A020F0">val</FONT></B> simple: (unit -&gt; unit) -&gt; t
+         <B><FONT COLOR="#0000FF">end</FONT></B>
+
+      <B><FONT COLOR="#0000FF">structure</FONT></B> Mask:
+         <B><FONT COLOR="#0000FF">sig</FONT></B>
+            <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t
+               
+            </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> all: t
+            <B><FONT COLOR="#A020F0">val</FONT></B> allBut: signal list -&gt; t
+            <B><FONT COLOR="#A020F0">val</FONT></B> block: t -&gt; unit
+            <B><FONT COLOR="#A020F0">val</FONT></B> getBlocked: unit -&gt; t
+            <B><FONT COLOR="#A020F0">val</FONT></B> isMember: t * signal -&gt; bool
+            <B><FONT COLOR="#A020F0">val</FONT></B> none: t
+            <B><FONT COLOR="#A020F0">val</FONT></B> setBlocked: t -&gt; unit
+            <B><FONT COLOR="#A020F0">val</FONT></B> some: signal list -&gt; t
+            <B><FONT COLOR="#A020F0">val</FONT></B> unblock: t -&gt; unit
+         <B><FONT COLOR="#0000FF">end</FONT></B>
+
+      <B><FONT COLOR="#A020F0">val</FONT></B> getHandler: t -&gt; Handler.t
+      <B><FONT COLOR="#A020F0">val</FONT></B> handled: unit -&gt; Mask.t
+      <B><FONT COLOR="#A020F0">val</FONT></B> prof: t
+      <B><FONT COLOR="#A020F0">val</FONT></B> restart: bool ref
+      <B><FONT COLOR="#A020F0">val</FONT></B> setHandler: t * Handler.t -&gt; unit
+      <B><FONT COLOR="#A020F0">val</FONT></B> suspend: Mask.t -&gt; unit
+      <B><FONT COLOR="#A020F0">val</FONT></B> vtalrm: t
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<p>
+Signals handlers are functions from (runnable) threads to (runnable) threads.  When a signal arrives, the corresponding signal handler is invoked, its argument being the thread that was interrupted by the signal.  The signal handler runs asynchronously, in its own thread. The signal handler returns the thread that it would like to resume execution (this is often the thread that it was passed).  It is an error for a signal handler to raise an exception that is not handled within the signal handler itself. 
+</p>
+<p>
+A signal handler is never invoked while the running thread is in a critical section (see <a href="MLtonThread">MLtonThread</a>).  Invoking a signal handler implicitly enters a critical section and the normal return of a signal handler implicitly exits the critical section; hence, a signal handler is never interrupted by another signal handler. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>type&nbsp;t</tt> 
+</p>
+</li>
+
+        <ul>
+
+  the type of signals. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>type&nbsp;Handler.t</tt> 
+</p>
+</li>
+
+        <ul>
+
+  the type of signal handlers. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>Handler.default</tt> 
+</p>
+</li>
+
+        <ul>
+
+  handles the signal with the default action. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>Handler.handler&nbsp;f</tt> 
+</p>
+</li>
+
+        <ul>
+
+  returns a handler <tt>h</tt> such that when a signal <tt>s</tt> is handled   by <tt>h</tt>, <tt>f</tt> will be passed the thread that was interrupted by   <tt>s</tt> and should return the thread that will resume execution. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>Handler.ignore</tt> 
+</p>
+</li>
+
+        <ul>
+
+  is a handler that will ignore the signal. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>Handler.isDefault</tt> 
+</p>
+</li>
+
+        <ul>
+
+  returns true if the handler is the default handler. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>Handler.isIgnore</tt> 
+</p>
+</li>
+
+        <ul>
+
+  returns true if the handler is the ignore handler. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>Handler.simple&nbsp;f</tt> 
+</p>
+</li>
+
+        <ul>
+
+  returns a handler that executes <tt>f&nbsp;()</tt> and does not switch   threads. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>type&nbsp;Mask.t</tt> 
+</p>
+</li>
+
+        <ul>
+
+  the type of signal masks, which are sets of blocked signals. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>Mask.all</tt> 
+</p>
+</li>
+
+        <ul>
+
+  a mask of all signals. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>Mask.allBut&nbsp;l</tt> 
+</p>
+</li>
+
+        <ul>
+
+  a mask of all signals except for those in <tt>l</tt>. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>Mask.block&nbsp;m</tt> 
+</p>
+</li>
+
+        <ul>
+
+  block all signals in <tt>m</tt>. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>Mask.getBlocked&nbsp;()</tt> 
+</p>
+</li>
+
+        <ul>
+
+  get the signal mask <tt>m</tt>, i.e. a signal is blocked if and only   if it is in <tt>m</tt>. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>Mask.isMember&nbsp;(m,&nbsp;s)</tt> 
+</p>
+</li>
+
+        <ul>
+
+  returns true if the signal <tt>s</tt> is in <tt>m</tt>. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>Mask.none</tt> 
+</p>
+</li>
+
+        <ul>
+
+  a mask of no signals. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>Mask.setBlocked&nbsp;m</tt> 
+</p>
+</li>
+
+        <ul>
+
+  set the signal mask to <tt>m</tt>, i.e. a signal is blocked if and only   if it is in <tt>m</tt>. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>Mask.some&nbsp;l</tt> 
+</p>
+</li>
+
+        <ul>
+
+  a mask of the signals in <tt>l</tt>. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>Mask.unblock&nbsp;m</tt> 
+</p>
+</li>
+
+        <ul>
+
+  unblock all signals in <tt>m</tt>. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>getHandler&nbsp;s</tt> 
+</p>
+</li>
+
+        <ul>
+
+  returns the current handler for signal <tt>s</tt>. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>handled&nbsp;()</tt> 
+</p>
+</li>
+
+        <ul>
+
+  returns the signal mask <tt>m</tt> corresponding to the currently handled   signals; i.e., a signal is handled if and only if it is im <tt>m</tt>. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>prof</tt> 
+</p>
+</li>
+
+        <ul>
+
+  <tt>SIGPROF</tt>, the profiling signal. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>restart</tt> 
+</p>
+</li>
+
+        <ul>
+
+  dynamically determines the behavior of interrupted system calls; when   <tt>true</tt>, interrupted system calls are restarted; when <tt>false</tt>,   interrupted system calls raise <tt>OS.SysError</tt>. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>setHandler&nbsp;(s,&nbsp;h)</tt> 
+</p>
+</li>
+
+        <ul>
+
+  sets the handler for signal <tt>s</tt> to <tt>h</tt>. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>suspend&nbsp;m</tt> 
+</p>
+</li>
+
+        <ul>
+
+  temporarily sets the signal mask to <tt>m</tt> and suspends until an   unmasked signal is received and handled, at which point   <tt>suspend</tt> resets the mask and returns. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>vtalrm</tt> 
+</p>
+</li>
+
+        <ul>
+
+  <tt>SIGVTALRM</tt>, the signal for virtual timers. 
+        </ul>
+
+
+
+    </ul>
+
+
+<h2 id="head-f8a475209a6f55001051eae0624aca8b3a75b651">Interruptible System Calls</h2>
+<p>
+Signal handling interacts in a non-trivial way with those functions in the <a href="BasisLibrary"> SML Basis Library</a> that correspond directly to interruptible system calls (a subset of those functions that may raise <tt>OS.SysError</tt>). The desire is that these functions should have predictable semantics. The principal concerns are: 
+</p>
+
+    <ol type="1">
+
+    <li>
+<p>
+System calls that are interrupted by signals should, by default, be  restarted; the alternative is to raise   
+<pre> OS.SysError (Posix.Error.errorMsg Posix.Error.intr, 
+              SOME Posix.Error.intr)</pre> This behavior is determined dynamically by the value of <tt>Signal.restart</tt>. 
+</p>
+</li>
+    <li class="gap">
+<p>
+Signal handlers should always get a chance to run (when outside a  critical region).  If a system call is interrupted by a signal, then  the signal handler will run before the call is restarted or  <tt>OS.SysError</tt> is raised; that is, before the <tt>Signal.restart</tt>  check. 
+</p>
+</li>
+    <li class="gap">
+<p>
+A system call that must be restarted while in a critical section  will be restarted with the handled signals blocked (and the previously  blocked signals remembered).  This encourages the system call to  complete, allowing the program to make progress towards leaving the  critical section where the signal can be handled.  If the system call  completes, the set of blocked signals are restored to those previously  blocked. 
+</p>
+</li>
+</ol>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-26 20:33:02 by <span title="cfs36.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MLtonSocket
===================================================================
--- mlton/trunk/doc/guide/MLtonSocket	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MLtonSocket	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,230 @@
+<!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>MLtonSocket - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MLtonSocket
+    <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">
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> MLTON_SOCKET =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#0000FF">structure</FONT></B> Address:
+         <B><FONT COLOR="#0000FF">sig</FONT></B>
+            <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> word
+         </FONT></B><B><FONT COLOR="#0000FF">end</FONT></B>
+      <B><FONT COLOR="#0000FF">structure</FONT></B> Host:
+         <B><FONT COLOR="#0000FF">sig</FONT></B>
+            <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> {name: string}
+
+            </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> getByAddress: Address.t -&gt; t option
+            <B><FONT COLOR="#A020F0">val</FONT></B> getByName: string -&gt; t option
+         <B><FONT COLOR="#0000FF">end</FONT></B>
+      <B><FONT COLOR="#0000FF">structure</FONT></B> Port:
+         <B><FONT COLOR="#0000FF">sig</FONT></B>
+            <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> int
+         </FONT></B><B><FONT COLOR="#0000FF">end</FONT></B>
+
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t
+
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> accept: t -&gt; Address.t * Port.t * TextIO.instream * TextIO.outstream
+      <B><FONT COLOR="#A020F0">val</FONT></B> connect: string * Port.t -&gt; TextIO.instream * TextIO.outstream
+      <B><FONT COLOR="#A020F0">val</FONT></B> listen: unit -&gt; Port.t * t
+      <B><FONT COLOR="#A020F0">val</FONT></B> listenAt: Port.t -&gt; t
+      <B><FONT COLOR="#A020F0">val</FONT></B> shutdownRead: TextIO.instream -&gt; unit
+      <B><FONT COLOR="#A020F0">val</FONT></B> shutdownWrite: TextIO.outstream -&gt; unit
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<p>
+This module contains a bare minimum of functionality to do TCP/IP programming.  This module is implemented on top of the <tt>Socket</tt> module of the Standard Basis Library.  We encourage you to use the standard <tt>Socket</tt> module, since we may eliminate <tt>MLton.Socket</tt> some day. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>type&nbsp;Address.t</tt> 
+</p>
+</li>
+
+        <ul>
+
+  the type of IP addresses. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>Host.getByAddress&nbsp;a</tt> 
+</p>
+</li>
+
+        <ul>
+
+  lookup the hostname (using <tt>gethostbyaddr</tt>) corresponding to   <tt>a</tt>.  
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>Host.getByName&nbsp;s</tt> 
+</p>
+</li>
+
+        <ul>
+
+  lookup the hostname (using <tt>gethostbyname</tt>) corresponding to   <tt>s</tt>.  
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>type&nbsp;Port.t</tt> 
+</p>
+</li>
+
+        <ul>
+
+  the type of TCP ports. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>type&nbsp;t</tt> 
+</p>
+</li>
+
+        <ul>
+
+  the type of sockets. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>accept&nbsp;s</tt> 
+</p>
+</li>
+
+        <ul>
+
+  accept a connection on socket <tt>s</tt> and return the address and   port of the connecting socket, as well as streams corresponding to   the connection. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>connect&nbsp;(h,&nbsp;p)</tt> 
+</p>
+</li>
+
+        <ul>
+
+  connect to host <tt>h</tt> on port <tt>p</tt>, returning the streams   corresponding to the connection. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>listen&nbsp;()</tt> 
+</p>
+</li>
+
+        <ul>
+
+  listen to a port chosen by the system.  Returns the port and the socket. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>listenAt&nbsp;p</tt> 
+</p>
+</li>
+
+        <ul>
+
+  listen to port <tt>p</tt>.  Returns the socket. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>shutdownRead&nbsp;ins</tt> 
+</p>
+</li>
+
+        <ul>
+
+  cause the read part of the socket associated with <tt>ins</tt> to be   shutdown.  
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>shutdownWrite&nbsp;out</tt> 
+</p>
+</li>
+
+        <ul>
+
+  cause the write part of the socket associated with <tt>out</tt> to be   shutdown.  </ul>
+
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-02 04:29:32 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MLtonStructure
===================================================================
--- mlton/trunk/doc/guide/MLtonStructure	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MLtonStructure	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,345 @@
+<!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>MLtonStructure - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MLtonStructure
+    <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 <tt>MLton</tt> structure contains a lot of functionality that is not available in the <a href="BasisLibrary"> SML Basis Library</a>.  As a warning, please keep in mind that the <tt>MLton</tt> structure and its substructures do change from release to release of MLton. 
+<pre class=code>
+<B><FONT COLOR="#0000FF">structure</FONT></B> MLton:
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">val</FONT></B> eq: 'a * 'a -&gt; bool
+      <B><FONT COLOR="#A020F0">val</FONT></B> isMLton: bool
+      <B><FONT COLOR="#A020F0">val</FONT></B> share: 'a -&gt; unit
+      <B><FONT COLOR="#A020F0">val</FONT></B> shareAll: unit -&gt; unit
+      <B><FONT COLOR="#A020F0">val</FONT></B> size: 'a -&gt; int
+
+      <B><FONT COLOR="#0000FF">structure</FONT></B> Array: MLTON_ARRAY
+      <B><FONT COLOR="#0000FF">structure</FONT></B> BinIO: MLTON_BIN_IO
+      <B><FONT COLOR="#0000FF">structure</FONT></B> Cont: MLTON_CONT
+      <B><FONT COLOR="#0000FF">structure</FONT></B> Exn: MLTON_EXN
+      <B><FONT COLOR="#0000FF">structure</FONT></B> Finalizable: MLTON_FINALIZABLE
+      <B><FONT COLOR="#0000FF">structure</FONT></B> GC: MLTON_GC
+      <B><FONT COLOR="#0000FF">structure</FONT></B> IntInf: MLTON_INT_INF
+      <B><FONT COLOR="#0000FF">structure</FONT></B> Itimer: MLTON_ITIMER
+      <B><FONT COLOR="#0000FF">structure</FONT></B> Platform: MLTON_PLATFORM
+      <B><FONT COLOR="#0000FF">structure</FONT></B> Pointer: MLTON_POINTER
+      <B><FONT COLOR="#0000FF">structure</FONT></B> ProcEnv: MLTON_PROC_ENV
+      <B><FONT COLOR="#0000FF">structure</FONT></B> Process: MLTON_PROCESS
+      <B><FONT COLOR="#0000FF">structure</FONT></B> Profile: MLTON_PROFILE
+      <B><FONT COLOR="#0000FF">structure</FONT></B> Random: MLTON_RANDOM
+      <B><FONT COLOR="#0000FF">structure</FONT></B> Rlimit: MLTON_RLIMIT
+      <B><FONT COLOR="#0000FF">structure</FONT></B> Rusage: MLTON_RUSAGE
+      <B><FONT COLOR="#0000FF">structure</FONT></B> Signal: MLTON_SIGNAL
+      <B><FONT COLOR="#0000FF">structure</FONT></B> Socket: MLTON_SOCKET
+      <B><FONT COLOR="#0000FF">structure</FONT></B> Syslog: MLTON_SYSLOG
+      <B><FONT COLOR="#0000FF">structure</FONT></B> TextIO: MLTON_TEXT_IO
+      <B><FONT COLOR="#0000FF">structure</FONT></B> Thread: MLTON_THREAD
+      <B><FONT COLOR="#0000FF">structure</FONT></B> Vector: MLTON_VECTOR
+      <B><FONT COLOR="#0000FF">structure</FONT></B> Weak: MLTON_WEAK
+      <B><FONT COLOR="#0000FF">structure</FONT></B> Word: MLTON_WORD <B><FONT COLOR="#0000FF">where</FONT></B> <B><FONT COLOR="#0000FF">type</FONT></B><FONT COLOR="#228B22"><B> word </FONT></B>=<FONT COLOR="#228B22"><B> Word.word
+      </FONT></B><B><FONT COLOR="#0000FF">structure</FONT></B> Word8: MLTON_WORD <B><FONT COLOR="#0000FF">where</FONT></B> <B><FONT COLOR="#0000FF">type</FONT></B><FONT COLOR="#228B22"><B> word </FONT></B>=<FONT COLOR="#228B22"><B> Word8.word
+      </FONT></B><B><FONT COLOR="#0000FF">structure</FONT></B> World: MLTON_WORLD
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<h2 id="head-58b7888b27adca6d197bc42df58e8c0c70fe97d0">Substructures</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="MLtonArray">MLtonArray</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="MLtonBinIO">MLtonBinIO</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="MLtonCont">MLtonCont</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="MLtonExn">MLtonExn</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="MLtonFinalizable">MLtonFinalizable</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="MLtonGC">MLtonGC</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="MLtonIntInf">MLtonIntInf</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="MLtonIO">MLtonIO</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="MLtonItimer">MLtonItimer</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="MLtonPlatform">MLtonPlatform</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="MLtonPointer">MLtonPointer</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="MLtonProcEnv">MLtonProcEnv</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="MLtonProcess">MLtonProcess</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="MLtonRandom">MLtonRandom</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="MLtonRlimit">MLtonRlimit</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="MLtonRusage">MLtonRusage</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="MLtonSignal">MLtonSignal</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="MLtonSocket">MLtonSocket</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="MLtonSyslog">MLtonSyslog</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="MLtonTextIO">MLtonTextIO</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="MLtonThread">MLtonThread</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="MLtonVector">MLtonVector</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="MLtonWeak">MLtonWeak</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="MLtonWord">MLtonWord</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="MLtonWorld">MLtonWorld</a> 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-b1564f6b1512cbfa3cfcebc9a5badb6b239954f1">Values</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>eq&nbsp;(x,&nbsp;y)</tt>  returns true if <tt>x</tt> and <tt>y</tt> are equal as pointers.  For simple  types like <tt>char</tt>, <tt>int</tt>, and <tt>word</tt>, this is the same as  equals.  For arrays, datatypes, strings, tuples, and vectors, this is  a simple pointer equality.  The semantics is a bit murky. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <tt>isMLton</tt>  is always true in a MLton implementation, and is always false in a  stub implementation. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <tt>share&nbsp;x</tt>  maximizes sharing in the heap for the object graph reachable from <tt>x</tt>. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <tt>shareAll&nbsp;()</tt>  maximizes sharing in the heap by sharing space for equivalent  immutable objects.  A call to <tt>shareAll</tt> performs a major garbage  collection, and takes time proportional to the size of the heap. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <tt>size&nbsp;x</tt>  return the amount of heap space (in bytes) taken by the value of  <tt>x</tt>, including all objects reachable from <tt>x</tt> by following   pointers.  It takes time proportional to the size of <tt>x</tt>.  For an  example, see <a href="#size">below</a>. 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-48c21e9f702d3a4e4ebc0ce38e1d6c7f6bf73f5b">Example of MLton.size</h2>
+<a id="size"></a> <p>
+This example, <tt>size.sml</tt>, demonstrates the application of <tt>MLton.size</tt> to many different kinds of objects. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">fun</FONT></B> <FONT COLOR="#228B22"><B>'a</FONT></B> printSize (name: string, min: int, value: 'a): unit=
+   <B><FONT COLOR="#A020F0">if</FONT></B> MLton.size value &gt;= min
+      <B><FONT COLOR="#A020F0">then</FONT></B>
+         (print <FONT COLOR="#BC8F8F"><B>&quot;The size of &quot;</FONT></B>
+          ; print name
+          ; print <FONT COLOR="#BC8F8F"><B>&quot; is &gt;= &quot;</FONT></B>
+          ; print (Int.toString min)
+          ; print <FONT COLOR="#BC8F8F"><B>&quot; bytes.\n&quot;</FONT></B>)
+   <B><FONT COLOR="#A020F0">else</FONT></B> ()
+
+<B><FONT COLOR="#A020F0">val</FONT></B> l = [<B><FONT COLOR="#5F9EA0">1</FONT></B>, <B><FONT COLOR="#5F9EA0">2</FONT></B>, <B><FONT COLOR="#5F9EA0">3</FONT></B>, <B><FONT COLOR="#5F9EA0">4</FONT></B>]
+
+<B><FONT COLOR="#A020F0">val</FONT></B> _ =
+   (
+    printSize (<FONT COLOR="#BC8F8F"><B>&quot;a char&quot;</FONT></B>, <B><FONT COLOR="#5F9EA0">0</FONT></B>, #<FONT COLOR="#BC8F8F"><B>&quot;c&quot;</FONT></B>)
+    ; printSize (<FONT COLOR="#BC8F8F"><B>&quot;an int list of length 4&quot;</FONT></B>, <B><FONT COLOR="#5F9EA0">48</FONT></B>, l)
+    ; printSize (<FONT COLOR="#BC8F8F"><B>&quot;a string of length 10&quot;</FONT></B>, <B><FONT COLOR="#5F9EA0">24</FONT></B>, <FONT COLOR="#BC8F8F"><B>&quot;0123456789&quot;</FONT></B>)
+    ; printSize (<FONT COLOR="#BC8F8F"><B>&quot;an int array of length 10&quot;</FONT></B>, <B><FONT COLOR="#5F9EA0">52</FONT></B>, Array.tabulate (<B><FONT COLOR="#5F9EA0">10</FONT></B>, <B><FONT COLOR="#A020F0">fn</FONT></B> _ =&gt; <B><FONT COLOR="#5F9EA0">0</FONT></B>))
+    ; printSize (<FONT COLOR="#BC8F8F"><B>&quot;a double array of length 10&quot;</FONT></B>,
+                 <B><FONT COLOR="#5F9EA0">92</FONT></B>, Array.tabulate (<B><FONT COLOR="#5F9EA0">10</FONT></B>, <B><FONT COLOR="#A020F0">fn</FONT></B> _ =&gt; <B><FONT COLOR="#5F9EA0">0.0</FONT></B>))
+    ; printSize (<FONT COLOR="#BC8F8F"><B>&quot;an array of length 10 of 2-ples of ints&quot;</FONT></B>,
+                 <B><FONT COLOR="#5F9EA0">92</FONT></B>, Array.tabulate (<B><FONT COLOR="#5F9EA0">10</FONT></B>, <B><FONT COLOR="#A020F0">fn</FONT></B> i =&gt; (i, i + <B><FONT COLOR="#5F9EA0">1</FONT></B>)))
+    ; printSize (<FONT COLOR="#BC8F8F"><B>&quot;a useless function&quot;</FONT></B>, <B><FONT COLOR="#5F9EA0">0</FONT></B>, <B><FONT COLOR="#A020F0">fn</FONT></B> _ =&gt; <B><FONT COLOR="#5F9EA0">13</FONT></B>)
+    )
+
+<I><FONT COLOR="#B22222">(* This is here so that the list is &quot;useful&quot;.
+ * If it were removed, then the optimizer (remove-unused-constructors)
+ * would remove l entirely.
+ *)</FONT></I>
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = <B><FONT COLOR="#A020F0">if</FONT></B> <B><FONT COLOR="#5F9EA0">10</FONT></B> = foldl (<B><FONT COLOR="#A020F0">op</FONT></B> +) <B><FONT COLOR="#5F9EA0">0</FONT></B> l
+           <B><FONT COLOR="#A020F0">then</FONT></B> ()
+        <B><FONT COLOR="#A020F0">else</FONT></B> <B><FONT COLOR="#A020F0">raise</FONT></B> Fail <FONT COLOR="#BC8F8F"><B>&quot;bug&quot;</FONT></B>
+   
+<B><FONT COLOR="#0000FF">local</FONT></B>
+   <B><FONT COLOR="#0000FF">open</FONT></B> MLton.Cont
+<B><FONT COLOR="#0000FF">in</FONT></B>
+   <B><FONT COLOR="#A020F0">val</FONT></B> rc: int option t option ref = ref NONE
+   <B><FONT COLOR="#A020F0">val</FONT></B> _ =
+      <B><FONT COLOR="#A020F0">case</FONT></B> callcc (<B><FONT COLOR="#A020F0">fn</FONT></B> k: int option t =&gt; (rc := SOME k; throw (k, NONE))) <B><FONT COLOR="#A020F0">of</FONT></B>
+         NONE =&gt; ()
+       | SOME i =&gt; print (concat [Int.toString i, <FONT COLOR="#BC8F8F"><B>&quot;\n&quot;</FONT></B>])
+<B><FONT COLOR="#0000FF">end</FONT></B>
+
+<B><FONT COLOR="#A020F0">val</FONT></B> _ =
+   (print <FONT COLOR="#BC8F8F"><B>&quot;The size of a continuation option ref is &quot;</FONT></B>
+    ; <B><FONT COLOR="#A020F0">if</FONT></B> MLton.size rc &gt; <B><FONT COLOR="#5F9EA0">1000</FONT></B>
+         <B><FONT COLOR="#A020F0">then</FONT></B> print <FONT COLOR="#BC8F8F"><B>&quot;&gt; 1000.\n&quot;</FONT></B>
+      <B><FONT COLOR="#A020F0">else</FONT></B> print <FONT COLOR="#BC8F8F"><B>&quot;&lt; 1000.\n&quot;</FONT></B>)
+
+<B><FONT COLOR="#A020F0">val</FONT></B> _ =
+   <B><FONT COLOR="#A020F0">case</FONT></B> !rc <B><FONT COLOR="#A020F0">of</FONT></B>
+      NONE =&gt; ()
+    | SOME k =&gt; (rc := NONE; MLton.Cont.throw (k, SOME <B><FONT COLOR="#5F9EA0">13</FONT></B>))
+</PRE>
+<p>
+ 
+</p>
+<p>
+Compile and run as usual. 
+<pre>% mlton size.sml
+% ./size
+The size of a char is &gt;= 0 bytes.
+The size of an int list of length 4 is &gt;= 48 bytes.
+The size of a string of length 10 is &gt;= 24 bytes.
+The size of an int array of length 10 is &gt;= 52 bytes.
+The size of a double array of length 10 is &gt;= 92 bytes.
+The size of an array of length 10 of 2-ples of ints is &gt;= 92 bytes.
+The size of a useless function is &gt;= 0 bytes.
+The size of a continuation option ref is &gt; 1000.
+13
+The size of a continuation option ref is &lt; 1000.
+</pre>
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-28 21:45:34 by <span title="cfs36.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MLtonSyslog
===================================================================
--- mlton/trunk/doc/guide/MLtonSyslog	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MLtonSyslog	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,152 @@
+<!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>MLtonSyslog - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MLtonSyslog
+    <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">
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> MLTON_SYSLOG =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> openflag
+         
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> CONS     : openflag
+      <B><FONT COLOR="#A020F0">val</FONT></B> NDELAY   : openflag
+      <B><FONT COLOR="#A020F0">val</FONT></B> PERROR   : openflag
+      <B><FONT COLOR="#A020F0">val</FONT></B> PID      : openflag
+
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> facility
+
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> AUTHPRIV : facility
+      <B><FONT COLOR="#A020F0">val</FONT></B> CRON     : facility
+      <B><FONT COLOR="#A020F0">val</FONT></B> DAEMON   : facility
+      <B><FONT COLOR="#A020F0">val</FONT></B> KERN     : facility
+      <B><FONT COLOR="#A020F0">val</FONT></B> LOCAL0   : facility
+      <B><FONT COLOR="#A020F0">val</FONT></B> LOCAL1   : facility
+      <B><FONT COLOR="#A020F0">val</FONT></B> LOCAL2   : facility
+      <B><FONT COLOR="#A020F0">val</FONT></B> LOCAL3   : facility
+      <B><FONT COLOR="#A020F0">val</FONT></B> LOCAL4   : facility
+      <B><FONT COLOR="#A020F0">val</FONT></B> LOCAL5   : facility
+      <B><FONT COLOR="#A020F0">val</FONT></B> LOCAL6   : facility
+      <B><FONT COLOR="#A020F0">val</FONT></B> LOCAL7   : facility
+      <B><FONT COLOR="#A020F0">val</FONT></B> LPR      : facility
+      <B><FONT COLOR="#A020F0">val</FONT></B> MAIL     : facility
+      <B><FONT COLOR="#A020F0">val</FONT></B> NEWS     : facility
+      <B><FONT COLOR="#A020F0">val</FONT></B> SYSLOG   : facility
+      <B><FONT COLOR="#A020F0">val</FONT></B> USER     : facility
+      <B><FONT COLOR="#A020F0">val</FONT></B> UUCP     : facility
+
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> loglevel
+
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> EMERG    : loglevel
+      <B><FONT COLOR="#A020F0">val</FONT></B> ALERT    : loglevel
+      <B><FONT COLOR="#A020F0">val</FONT></B> CRIT     : loglevel
+      <B><FONT COLOR="#A020F0">val</FONT></B> ERR      : loglevel
+      <B><FONT COLOR="#A020F0">val</FONT></B> WARNING  : loglevel
+      <B><FONT COLOR="#A020F0">val</FONT></B> NOTICE   : loglevel
+      <B><FONT COLOR="#A020F0">val</FONT></B> INFO     : loglevel
+      <B><FONT COLOR="#A020F0">val</FONT></B> DEBUG    : loglevel
+
+      <B><FONT COLOR="#A020F0">val</FONT></B> closelog: unit -&gt; unit
+      <B><FONT COLOR="#A020F0">val</FONT></B> log: loglevel * string -&gt; unit
+      <B><FONT COLOR="#A020F0">val</FONT></B> openlog: string * openflag list * facility -&gt; unit
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<p>
+<tt>MLton.Syslog</tt> is a complete interface to the system logging facilities.  See <tt>man&nbsp;3&nbsp;syslog</tt> for more details. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>closelog&nbsp;()</tt> 
+</p>
+</li>
+
+        <ul>
+
+  close the connection to the system logger. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>log&nbsp;(l,&nbsp;s)</tt> 
+</p>
+</li>
+
+        <ul>
+
+  log message <tt>s</tt> at a loglevel <tt>l</tt>. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>openlog&nbsp;(name,&nbsp;flags,&nbsp;facility)</tt> 
+</p>
+</li>
+
+        <ul>
+
+  open a connection to the system logger. <tt>name</tt> will be prefixed   to each message, and is typically set to the program name. </ul>
+
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-02 04:29:56 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MLtonTextIO
===================================================================
--- mlton/trunk/doc/guide/MLtonTextIO	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MLtonTextIO	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,72 @@
+<!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>MLtonTextIO - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MLtonTextIO
+    <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">
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> MLTON_TEXT_IO =
+   MLTON_IO
+   <B><FONT COLOR="#0000FF">where</FONT></B> <B><FONT COLOR="#0000FF">type</FONT></B><FONT COLOR="#228B22"><B> instream </FONT></B>=<FONT COLOR="#228B22"><B> TextIO.instream
+   <B><FONT COLOR="#0000FF">where</FONT></B> <B><FONT COLOR="#0000FF">type</FONT></B><FONT COLOR="#228B22"><B> outstream </FONT></B>=<FONT COLOR="#228B22"><B> TextIO.outstream
+</FONT></B></PRE>
+<p>
+ 
+</p>
+<p>
+See <a href="MLtonIO">MLtonIO</a>. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-02 04:30:21 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MLtonThread
===================================================================
--- mlton/trunk/doc/guide/MLtonThread	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MLtonThread	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,441 @@
+<!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>MLtonThread - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MLtonThread
+    <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">
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> MLTON_THREAD =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#0000FF">structure</FONT></B> AtomicState :
+         <B><FONT COLOR="#0000FF">sig</FONT></B>
+            <B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">NonAtomic</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">Atomic</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> int
+         </FONT></B><B><FONT COLOR="#0000FF">end</FONT></B>
+      <B><FONT COLOR="#A020F0">val</FONT></B> atomicBegin: unit -&gt; unit
+      <B><FONT COLOR="#A020F0">val</FONT></B> atomicEnd: unit -&gt; unit
+      <B><FONT COLOR="#A020F0">val</FONT></B> atomically: (unit -&gt; 'a) -&gt; 'a
+      <B><FONT COLOR="#A020F0">val</FONT></B> atomicState: unit -&gt; AtomicState.t
+
+      <B><FONT COLOR="#0000FF">structure</FONT></B> Runnable :
+         <B><FONT COLOR="#0000FF">sig</FONT></B>
+            <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t
+         </FONT></B><B><FONT COLOR="#0000FF">end</FONT></B>
+
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> 'a t
+
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> new: ('a -&gt; unit) -&gt; 'a t
+      <B><FONT COLOR="#A020F0">val</FONT></B> prepend: 'a t * ('b -&gt; 'a) -&gt; 'b t
+      <B><FONT COLOR="#A020F0">val</FONT></B> prepare: 'a t * 'a -&gt; Runnable.t
+      <B><FONT COLOR="#A020F0">val</FONT></B> switch: ('a t -&gt; Runnable.t) -&gt; 'a
+      <B><FONT COLOR="#A020F0">val</FONT></B> atomicSwitch: ('a t -&gt; Runnable.t) -&gt; 'a
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<p>
+<tt>MLton.Thread</tt> provides access to MLton's user-level thread implementation (i.e. not OS-level threads).  Threads are lightweight data structures that represent a paused computation.  Runnable threads are threads that will begin or continue computing when <tt>switch</tt>ed to.  <tt>MLton.Thread</tt> does not include a default scheduling mechanism, but it can be used to implement both preemptive and non-preemptive threads. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>type&nbsp;AtomicState.t</tt> 
+</p>
+</li>
+
+        <ul>
+
+  the type of atomic states. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>atomicBegin&nbsp;()</tt> 
+</p>
+</li>
+
+        <ul>
+
+  begin a critical section. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>atomicEnd&nbsp;()</tt> 
+</p>
+</li>
+
+        <ul>
+
+  end a critical section. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>atomically&nbsp;f</tt> 
+</p>
+</li>
+
+        <ul>
+
+  runs <tt>f</tt> in a critical section. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>atomicState&nbsp;()</tt> 
+</p>
+</li>
+
+        <ul>
+
+  return the current atomic state. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>type&nbsp;Runnable.t</tt> 
+</p>
+</li>
+
+        <ul>
+
+  the type of threads that can be resumed. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>type&nbsp;'a&nbsp;t</tt> 
+</p>
+</li>
+
+        <ul>
+
+  the type of threads that expect a value of type <tt>'a</tt>. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>new&nbsp;f</tt> 
+</p>
+</li>
+
+        <ul>
+
+  create a new thread that, when run, applies <tt>f</tt> to the value   given to the thread.  <tt>f</tt> must terminate by <tt>switch</tt>ing to   another thread or exiting the process. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>prepend&nbsp;(t,&nbsp;f)</tt> 
+</p>
+</li>
+
+        <ul>
+
+  create a new thread (destroying <tt>t</tt> in the process) that first   applies <tt>f</tt> to the value given to the thread and then continues   with <tt>t</tt>.  This is a constant time operation. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>prepare&nbsp;(t,&nbsp;v)</tt> 
+</p>
+</li>
+
+        <ul>
+
+  prepare a new runnable thread (destroying <tt>t</tt> in the process)   that will evaluate <tt>t</tt> on <tt>v</tt>. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>switch&nbsp;f</tt> 
+</p>
+</li>
+
+        <ul>
+
+  apply <tt>f</tt> to the current thread to get <tt>rt</tt>, and then start   running thread <tt>rt</tt>.  It is an error for <tt>f</tt> to perform   another <tt>switch</tt>.  <tt>f</tt> is guaranteed to run atomically. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>atomicSwitch&nbsp;f</tt> 
+</p>
+</li>
+
+        <ul>
+
+  as <tt>switch</tt>, but assumes an atomic calling context.  Upon   <tt>switch</tt>ing back to the current thread, an implicit   <tt>atomicEnd</tt> is performed. 
+        </ul>
+
+
+
+    </ul>
+
+
+<h2 id="head-b59f5a84d311ffa9c081e150b9d22e77bb539300">Example of non-preemptive threads</h2>
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">structure</FONT></B> Queue:
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> 'a t
+
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> new: unit -&gt; 'a t
+      <B><FONT COLOR="#A020F0">val</FONT></B> enque: 'a t * 'a -&gt; unit
+      <B><FONT COLOR="#A020F0">val</FONT></B> deque: 'a t -&gt; 'a option
+   <B><FONT COLOR="#0000FF">end</FONT></B> =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> 'a t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">T</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> {front: 'a list ref, back: 'a list ref}
+
+      </FONT></B><B><FONT COLOR="#A020F0">fun</FONT></B> new() = T{front = ref [], back = ref []}
+
+      <B><FONT COLOR="#A020F0">fun</FONT></B> enque(T{back, ...}, x) = back := x :: !back
+
+      <B><FONT COLOR="#A020F0">fun</FONT></B> deque(T{front, back}) =
+         <B><FONT COLOR="#A020F0">case</FONT></B> !front <B><FONT COLOR="#A020F0">of</FONT></B>
+            [] =&gt; (<B><FONT COLOR="#A020F0">case</FONT></B> !back <B><FONT COLOR="#A020F0">of</FONT></B>
+                      [] =&gt; NONE
+                    | l =&gt; <B><FONT COLOR="#A020F0">let</FONT></B> <B><FONT COLOR="#A020F0">val</FONT></B> l = rev l
+                           <B><FONT COLOR="#A020F0">in</FONT></B> <B><FONT COLOR="#A020F0">case</FONT></B> l <B><FONT COLOR="#A020F0">of</FONT></B>
+                              [] =&gt; <B><FONT COLOR="#A020F0">raise</FONT></B> Fail <FONT COLOR="#BC8F8F"><B>&quot;deque&quot;</FONT></B>
+                            | x :: l =&gt; (back := []; front := l; SOME x)
+                           <B><FONT COLOR="#A020F0">end</FONT></B>)
+          | x :: l =&gt; (front := l; SOME x) 
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+
+<B><FONT COLOR="#0000FF">structure</FONT></B> Thread:
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">val</FONT></B> exit: unit -&gt; 'a
+      <B><FONT COLOR="#A020F0">val</FONT></B> run: unit -&gt; unit
+      <B><FONT COLOR="#A020F0">val</FONT></B> spawn: (unit -&gt; unit) -&gt; unit
+      <B><FONT COLOR="#A020F0">val</FONT></B> yield: unit -&gt; unit
+   <B><FONT COLOR="#0000FF">end</FONT></B> =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#0000FF">open</FONT></B> MLton
+      <B><FONT COLOR="#0000FF">open</FONT></B> Thread
+
+      <B><FONT COLOR="#A020F0">val</FONT></B> topLevel: Thread.Runnable.t option ref = ref NONE
+
+      <B><FONT COLOR="#A020F0">local</FONT></B>
+         <B><FONT COLOR="#A020F0">val</FONT></B> threads: Thread.Runnable.t Queue.t = Queue.new()
+      <B><FONT COLOR="#A020F0">in</FONT></B>
+         <B><FONT COLOR="#A020F0">fun</FONT></B> ready (t: Thread.Runnable.t) : unit = 
+            Queue.enque(threads, t)
+         <B><FONT COLOR="#A020F0">fun</FONT></B> next () : Thread.Runnable.t =
+            <B><FONT COLOR="#A020F0">case</FONT></B> Queue.deque threads <B><FONT COLOR="#A020F0">of</FONT></B>
+               NONE =&gt; valOf(!topLevel)
+             | SOME t =&gt; t
+      <B><FONT COLOR="#A020F0">end</FONT></B>
+   
+      <B><FONT COLOR="#A020F0">fun</FONT></B> <FONT COLOR="#228B22"><B>'a</FONT></B> exit(): 'a = switch(<B><FONT COLOR="#A020F0">fn</FONT></B> _ =&gt; next())
+      
+      <B><FONT COLOR="#A020F0">fun</FONT></B> new(f: unit -&gt; unit): Thread.Runnable.t =
+         Thread.prepare
+         (Thread.new (<B><FONT COLOR="#A020F0">fn</FONT></B> () =&gt; ((f() <B><FONT COLOR="#A020F0">handle</FONT></B> _ =&gt; exit())
+                                ; exit())),
+          ())
+         
+      <B><FONT COLOR="#A020F0">fun</FONT></B> schedule t = (ready t; next())
+
+      <B><FONT COLOR="#A020F0">fun</FONT></B> yield(): unit = switch(<B><FONT COLOR="#A020F0">fn</FONT></B> t =&gt; schedule (Thread.prepare (t, ())))
+
+      <B><FONT COLOR="#A020F0">val</FONT></B> spawn = ready o new
+
+      <B><FONT COLOR="#A020F0">fun</FONT></B> run(): unit =
+         (switch(<B><FONT COLOR="#A020F0">fn</FONT></B> t =&gt;
+                 (topLevel := SOME (Thread.prepare (t, ()))
+                  ; next()))
+          ; topLevel := NONE)
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+
+<B><FONT COLOR="#A020F0">val</FONT></B> <B><FONT COLOR="#A020F0">rec</FONT></B> loop =
+   <B><FONT COLOR="#A020F0">fn</FONT></B> <B><FONT COLOR="#5F9EA0">0</FONT></B> =&gt; ()
+    | n =&gt; (print(concat[Int.toString n, <FONT COLOR="#BC8F8F"><B>&quot;\n&quot;</FONT></B>])
+            ; Thread.yield()
+            ; loop(n - <B><FONT COLOR="#5F9EA0">1</FONT></B>))
+
+<B><FONT COLOR="#A020F0">val</FONT></B> <B><FONT COLOR="#A020F0">rec</FONT></B> loop' =
+   <B><FONT COLOR="#A020F0">fn</FONT></B> <B><FONT COLOR="#5F9EA0">0</FONT></B> =&gt; ()
+    | n =&gt; (Thread.spawn(<B><FONT COLOR="#A020F0">fn</FONT></B> () =&gt; loop n); loop'(n - <B><FONT COLOR="#5F9EA0">2</FONT></B>))
+
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = Thread.spawn(<B><FONT COLOR="#A020F0">fn</FONT></B> () =&gt; loop' <B><FONT COLOR="#5F9EA0">10</FONT></B>)
+
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = Thread.run()
+
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = print <FONT COLOR="#BC8F8F"><B>&quot;success\n&quot;</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<h2 id="head-5312b6df875ff55a1aac1703500af9a957b9a09a">Example of preemptive threads</h2>
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">structure</FONT></B> Queue:
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> 'a t
+
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> new: unit -&gt; 'a t
+      <B><FONT COLOR="#A020F0">val</FONT></B> enque: 'a t * 'a -&gt; unit
+      <B><FONT COLOR="#A020F0">val</FONT></B> deque: 'a t -&gt; 'a option
+   <B><FONT COLOR="#0000FF">end</FONT></B> =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> 'a t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">T</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> {front: 'a list ref, back: 'a list ref}
+
+      </FONT></B><B><FONT COLOR="#A020F0">fun</FONT></B> new () = T {front = ref [], back = ref []}
+
+      <B><FONT COLOR="#A020F0">fun</FONT></B> enque (T {back, ...}, x) = back := x :: !back
+
+      <B><FONT COLOR="#A020F0">fun</FONT></B> deque (T {front, back}) =
+         <B><FONT COLOR="#A020F0">case</FONT></B> !front <B><FONT COLOR="#A020F0">of</FONT></B>
+            [] =&gt; (<B><FONT COLOR="#A020F0">case</FONT></B> !back <B><FONT COLOR="#A020F0">of</FONT></B>
+                      [] =&gt; NONE
+                    | l =&gt; <B><FONT COLOR="#A020F0">let</FONT></B> <B><FONT COLOR="#A020F0">val</FONT></B> l = rev l
+                           <B><FONT COLOR="#A020F0">in</FONT></B> <B><FONT COLOR="#A020F0">case</FONT></B> l <B><FONT COLOR="#A020F0">of</FONT></B>
+                              [] =&gt; <B><FONT COLOR="#A020F0">raise</FONT></B> Fail <FONT COLOR="#BC8F8F"><B>&quot;deque&quot;</FONT></B>
+                            | x :: l =&gt; (back := []; front := l; SOME x)
+                           <B><FONT COLOR="#A020F0">end</FONT></B>)
+          | x :: l =&gt; (front := l; SOME x) 
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+
+<B><FONT COLOR="#0000FF">structure</FONT></B> Thread:
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">val</FONT></B> exit: unit -&gt; 'a
+      <B><FONT COLOR="#A020F0">val</FONT></B> run: unit -&gt; unit
+      <B><FONT COLOR="#A020F0">val</FONT></B> spawn: (unit -&gt; unit) -&gt; unit
+      <B><FONT COLOR="#A020F0">val</FONT></B> yield: unit -&gt; unit
+   <B><FONT COLOR="#0000FF">end</FONT></B> =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#0000FF">open</FONT></B> Posix.Signal
+      <B><FONT COLOR="#0000FF">open</FONT></B> MLton
+      <B><FONT COLOR="#0000FF">open</FONT></B> Itimer Signal Thread
+
+      <B><FONT COLOR="#A020F0">val</FONT></B> topLevel: Thread.Runnable.t option ref = ref NONE
+
+      <B><FONT COLOR="#A020F0">local</FONT></B>
+         <B><FONT COLOR="#A020F0">val</FONT></B> threads: Thread.Runnable.t Queue.t = Queue.new ()
+      <B><FONT COLOR="#A020F0">in</FONT></B>
+         <B><FONT COLOR="#A020F0">fun</FONT></B> ready t = Queue.enque (threads, t)
+         <B><FONT COLOR="#A020F0">fun</FONT></B> next () =
+            <B><FONT COLOR="#A020F0">case</FONT></B> Queue.deque threads <B><FONT COLOR="#A020F0">of</FONT></B>
+               NONE =&gt; valOf (!topLevel)
+             | SOME t =&gt; t
+      <B><FONT COLOR="#A020F0">end</FONT></B>
+   
+      <B><FONT COLOR="#A020F0">fun</FONT></B> <FONT COLOR="#228B22"><B>'a</FONT></B> exit (): 'a = switch (<B><FONT COLOR="#A020F0">fn</FONT></B> _ =&gt; next ())
+      
+      <B><FONT COLOR="#A020F0">fun</FONT></B> new (f: unit -&gt; unit): Thread.Runnable.t =
+         Thread.prepare
+         (Thread.new (<B><FONT COLOR="#A020F0">fn</FONT></B> () =&gt; ((f () <B><FONT COLOR="#A020F0">handle</FONT></B> _ =&gt; exit ())
+                                ; exit ())),
+          ())
+         
+      <B><FONT COLOR="#A020F0">fun</FONT></B> schedule t = (ready t; next ())
+
+      <B><FONT COLOR="#A020F0">fun</FONT></B> yield (): unit = switch (<B><FONT COLOR="#A020F0">fn</FONT></B> t =&gt; schedule (Thread.prepare (t, ())))
+
+      <B><FONT COLOR="#A020F0">val</FONT></B> spawn = ready o new
+
+      <B><FONT COLOR="#A020F0">fun</FONT></B> setItimer t =
+         Itimer.set (Itimer.Real,
+                     {value = t,
+                      interval = t})
+
+      <B><FONT COLOR="#A020F0">fun</FONT></B> run (): unit =
+         (switch (<B><FONT COLOR="#A020F0">fn</FONT></B> t =&gt;
+                  (topLevel := SOME (Thread.prepare (t, ()))
+                   ; new (<B><FONT COLOR="#A020F0">fn</FONT></B> () =&gt; (setHandler (alrm, Handler.handler schedule)
+                                    ; setItimer (Time.fromMilliseconds <B><FONT COLOR="#5F9EA0">20</FONT></B>)))))
+          ; setItimer Time.zeroTime
+          ; ignore alrm
+          ; topLevel := NONE)
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+
+<B><FONT COLOR="#A020F0">val</FONT></B> <B><FONT COLOR="#A020F0">rec</FONT></B> delay =
+   <B><FONT COLOR="#A020F0">fn</FONT></B> <B><FONT COLOR="#5F9EA0">0</FONT></B> =&gt; ()
+    | n =&gt; delay (n - <B><FONT COLOR="#5F9EA0">1</FONT></B>)
+         
+<B><FONT COLOR="#A020F0">val</FONT></B> <B><FONT COLOR="#A020F0">rec</FONT></B> loop =
+   <B><FONT COLOR="#A020F0">fn</FONT></B> <B><FONT COLOR="#5F9EA0">0</FONT></B> =&gt; ()
+    | n =&gt; (delay <B><FONT COLOR="#5F9EA0">500000</FONT></B>; loop (n - <B><FONT COLOR="#5F9EA0">1</FONT></B>))
+
+<B><FONT COLOR="#A020F0">val</FONT></B> <B><FONT COLOR="#A020F0">rec</FONT></B> loop' =
+   <B><FONT COLOR="#A020F0">fn</FONT></B> <B><FONT COLOR="#5F9EA0">0</FONT></B> =&gt; ()
+    | n =&gt; (Thread.spawn (<B><FONT COLOR="#A020F0">fn</FONT></B> () =&gt; loop n); loop' (n - <B><FONT COLOR="#5F9EA0">1</FONT></B>))
+
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = Thread.spawn (<B><FONT COLOR="#A020F0">fn</FONT></B> () =&gt; loop' <B><FONT COLOR="#5F9EA0">10</FONT></B>)
+
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = Thread.run ()
+
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = print <FONT COLOR="#BC8F8F"><B>&quot;success\n&quot;</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-28 20:18:01 by <span title="adsl-64-166-226-179.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MLtonVector
===================================================================
--- mlton/trunk/doc/guide/MLtonVector	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MLtonVector	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,84 @@
+<!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>MLtonVector - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MLtonVector
+    <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">
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> MLTON_VECTOR =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">val</FONT></B> unfoldi: int * 'b * (int * 'b -&gt; 'a * 'b) -&gt; 'a vector
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>unfoldi&nbsp;(n,&nbsp;b,&nbsp;f)</tt> 
+</p>
+</li>
+
+        <ul>
+
+  construct a vector <em>v</em> of a length <tt>n</tt>, whose elements   <em>v<sub>i</sub></em> are determined by the equations <em>b<sub>0</sub> = b</em> and   <em>(v<sub>i</sub>, b<sub>i+1</sub>) = f (i, b<sub>i</sub>)</em>. </ul>
+
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-02 04:31:26 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MLtonWeak
===================================================================
--- mlton/trunk/doc/guide/MLtonWeak	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MLtonWeak	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,114 @@
+<!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>MLtonWeak - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MLtonWeak
+    <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">
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> MLTON_WEAK =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> 'a t
+
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> get: 'a t -&gt; 'a option
+      <B><FONT COLOR="#A020F0">val</FONT></B> new: 'a -&gt; 'a t
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<p>
+A weak pointer is a pointer to an object that is nulled if the object becomes unreachable due to garbage collection.  The weak pointer does not itself cause the object it points to be retained by the garbage collector -- only other strong pointers can do that. For objects that are not allocated in the heap, like integers, a weak pointer will always be nulled.  So, if <tt>w:&nbsp;int&nbsp;Weak.t</tt> then <tt>Weak.get&nbsp;w&nbsp;=&nbsp;NONE</tt>. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>type&nbsp;'a&nbsp;t</tt> 
+</p>
+</li>
+
+        <ul>
+
+  the type of weak pointers to objects of type <tt>'a</tt> 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>get&nbsp;w</tt> 
+</p>
+</li>
+
+        <ul>
+
+  returns <tt>NONE</tt> if the object pointed to by <tt>w</tt> no longer   exists.  Otherwise, returns <tt>SOME</tt> of the object pointed to by   <tt>w</tt>. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>new&nbsp;x</tt> 
+</p>
+</li>
+
+        <ul>
+
+  returns a weak pointer to <tt>x</tt>. </ul>
+
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-02 04:31:46 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MLtonWord
===================================================================
--- mlton/trunk/doc/guide/MLtonWord	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MLtonWord	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,111 @@
+<!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>MLtonWord - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MLtonWord
+    <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">
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> MLTON_WORD =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t
+         
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> rol: t * word -&gt; t
+      <B><FONT COLOR="#A020F0">val</FONT></B> ror: t * word -&gt; t
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>type&nbsp;t</tt> 
+</p>
+</li>
+
+        <ul>
+
+  the type of words.  For <tt>MLton.Word</tt> this is <tt>Word.word</tt>,   for <tt>MLton.Word8</tt> this is <tt>Word8.word</tt>. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>rol&nbsp;(w,&nbsp;w')</tt> 
+</p>
+</li>
+
+        <ul>
+
+  rotate left (circular). 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>ror&nbsp;(w,&nbsp;w')</tt> 
+</p>
+</li>
+
+        <ul>
+
+  rotate right (circular). </ul>
+
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-02 04:32:13 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MLtonWorld
===================================================================
--- mlton/trunk/doc/guide/MLtonWorld	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MLtonWorld	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,153 @@
+<!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>MLtonWorld - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MLtonWorld
+    <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">
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> MLTON_WORLD =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> status </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">Clone</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">Original</FONT>
+
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> load: string -&gt; 'a
+      <B><FONT COLOR="#A020F0">val</FONT></B> save: string -&gt; status
+      <B><FONT COLOR="#A020F0">val</FONT></B> saveThread: string * Thread.Runnable.t -&gt; unit
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>datatype&nbsp;status</tt> 
+</p>
+</li>
+
+        <ul>
+
+  used to specify whether a world is original or restarted (a clone). 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>load&nbsp;f</tt> 
+</p>
+</li>
+
+        <ul>
+
+  load the saved computation from file <tt>f</tt>. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>save&nbsp;f</tt> 
+</p>
+</li>
+
+        <ul>
+
+  save the entire state of the computation to the file <tt>f</tt>.  The   computation can then be restarted at a later time using   <tt>World.load</tt> or the <tt>load-world</tt> runtime system option.  The   call to <tt>save</tt> in the original computation returns   <tt>Original</tt> and the call in the restarted world returns   <tt>Clone</tt>. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>saveThread&nbsp;(f,&nbsp;rt)</tt> 
+</p>
+</li>
+
+        <ul>
+
+  save the entire state of the computation to the file <tt>f</tt> that   will resume with thread <tt>rt</tt> upon restart.  
+        </ul>
+
+
+
+    </ul>
+
+
+<h2 id="head-0f01ed56a1e32a05e5ef96e4d779f34784af9a96">Example</h2>
+<p>
+Suppose that <tt>save-world.sml</tt> contains the following. 
+<pre class=code>
+<B><FONT COLOR="#0000FF">open</FONT></B> MLton.World
+<B><FONT COLOR="#A020F0">val</FONT></B> _ =
+   <B><FONT COLOR="#A020F0">case</FONT></B> save <FONT COLOR="#BC8F8F"><B>&quot;world&quot;</FONT></B> <B><FONT COLOR="#A020F0">of</FONT></B>
+      Original =&gt; print <FONT COLOR="#BC8F8F"><B>&quot;I am the original\n&quot;</FONT></B>
+    | Clone =&gt; print <FONT COLOR="#BC8F8F"><B>&quot;I am the clone\n&quot;</FONT></B>
+</PRE>
+ 
+</p>
+<p>
+Then, if we compile <tt>save-world.sml</tt> and run it, the <tt>Original</tt> branch will execute, and a file named <tt>world</tt> will be created. 
+<pre>% mlton save-world.sml
+% save-world
+I am the original
+</pre>
+</p>
+<p>
+We can then load <tt>world</tt> using the <tt>load-world</tt> <a href="RunTimeOptions">run time option</a>. 
+</p>
+
+<pre>% save-world @MLton load-world world --
+I am the clone
+</pre></div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-11 22:23:51 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Machine
===================================================================
--- mlton/trunk/doc/guide/Machine	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Machine	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,80 @@
+<!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>Machine - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Machine
+    <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">
+An <a href="IntermediateLanguage">IntermediateLanguage</a>,  translated from <a href="RSSA">RSSA</a> by <a href="ToMachine">ToMachine</a> and used as input by a <a class="nonexistent" href="Codegen">Codegen</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Machine is a <a class="nonexistent" href="Untyped">Untyped</a> <a href="IntermediateLanguage">IntermediateLanguage</a>,  corresponding to a abstract register machine. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/backend/machine.sig?view=markup">machine.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/backend/machine.fun?view=markup">machine.fun</a>
+ <h2 id="head-a6de4b535fedeaa8890bd890b60fe09f87b5f96a">Type Checking</h2>
+<p>
+The Machine <a href="IntermediateLanguage">IntermediateLanguage</a> has a primitive type checker, which only checks some liveness properties. 
+</p>
+<p>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/backend/machine.sig?view=markup">machine.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/backend/machine.fun?view=markup">machine.fun</a>
+ 
+</p>
+<h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:33:08 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/ManualPage
===================================================================
--- mlton/trunk/doc/guide/ManualPage	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/ManualPage	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,86 @@
+<!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>ManualPage - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      ManualPage
+    <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">
+<p>
+MLton is run from the command line with a collection of options followed by a file name and a list of files to compile, assemble, and link with. 
+<pre>mlton [option ...] file.{c|cm|mlb|o|sml} [file.{c|o|s|S} ...]
+</pre>The simplest case is to run <tt>mlton&nbsp;foo.sml</tt>, where <tt>foo.sml</tt> contains a valid SML program, in which case MLton compiles the program to produce an executable <tt>foo</tt>.  Since MLton does not support separate compilation, the program must be the entire program you wish to compile.  However, the program may refer to signatures and structures defined in the <a href="BasisLibrary"> SML Basis Library</a>. 
+</p>
+<p>
+Larger programs, spanning many files, may be compiled with the  <a href="MLBasis">ML Basis system</a>.  In this case, <tt>mlton&nbsp;foo.mlb</tt> will compile the complete SML program described by the basis <tt>foo.mlb</tt>, which may specify both SML files and additional bases. 
+</p>
+<p>
+MLton also supports a limited subset of <a href="CompilationManager"> SML/NJ CompilationManager (CM)</a> files.  For example, <tt>mlton&nbsp;foo.cm</tt> will compile the complete SML program consisting of the concatenation of all the SML files referred to (either directly or indirectly) by <tt>foo.cm</tt>. 
+</p>
+<h2 id="head-3f170caead65df254d786032a409a6f6d204bca6">Next Steps</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="CompileTimeOptions">CompileTimeOptions</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="RunTimeOptions">RunTimeOptions</a> 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-28 21:46:37 by <span title="cfs36.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MatchCompilation
===================================================================
--- mlton/trunk/doc/guide/MatchCompilation	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MatchCompilation	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,88 @@
+<!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>MatchCompilation - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MatchCompilation
+    <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">
+Match compilation is the process of translating an SML match into a nested tree (or dag) of simple case expressions and tests. <p>
+MLton's match compiler is described <a href="MatchCompile">here</a>. 
+</p>
+<h2 id="head-64b6c64b41ea0f1053c138ed50df2e0c3bf244a9">Match compilation in other compilers</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a href = "References#BaudinetMacqueen85">BaudinetMacqueen85</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href = "References#Leroy90">Leroy90</a>, pages 60-69. 
+</p>
+</li>
+    <li>
+<p>
+ <a href = "References#Scott00">Scott00</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href = "References#Sestoft96">Sestoft96</a> 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-07-26 18:19:23 by <span title="adsl-64-166-226-32.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MatchCompile
===================================================================
--- mlton/trunk/doc/guide/MatchCompile	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MatchCompile	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,111 @@
+<!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>MatchCompile - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MatchCompile
+    <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">
+A translation pass, agnostic in the <a href="IntermediateLanguage">IntermediateLanguage</a>s between which it translates. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+<a href="MatchCompilation">Match compilation</a> converts a case expression with nested patterns into a a case expression with flat patterns.   
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/match-compile/match-compile.sig?view=markup">match-compile.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/match-compile/match-compile.fun?view=markup">match-compile.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+
+<pre>val matchCompile:
+   {caseType: Type.t, (* type of entire expression *)
+    cases: (NestedPat.t * ((Var.t -&gt; Var.t) -&gt; Exp.t)) vector,
+    conTycon: Con.t -&gt; Tycon.t,
+    region: Region.t,
+    test: Var.t,
+    testType: Type.t,
+    tyconCons: Tycon.t -&gt; {con: Con.t, hasArg: bool} vector}
+   -&gt; Exp.t * (unit -&gt; Layout.t vector)
+</pre><p>
+<tt>matchCompile</tt> is complicated by the desire for modularity between the match compiler and its caller.  Its caller is responsible for building the right hand side of a rule <tt>p&nbsp;=&gt;&nbsp;e</tt>.  On the other hand, the match compiler is responsible for destructing the test and binding new variables to the components.  In order to connect the new variables created by the match compiler with the variables in the pattern <tt>p</tt>, the match compiler passes an environment back to its caller that maps each variable in <tt>p</tt> to the corresponding variable introduced by the match compiler. 
+</p>
+<p>
+The match compiler builds a tree of n-way case expressions by working from outside to inside and left to right in the patterns.  For example, 
+<pre>case x of
+  (_, C1 a) =&gt; e1
+| (C2 b, C3 c) =&gt; e2
+</pre>is translated to 
+<pre>let
+   fun f1 a = e1
+   fun f2 (b, c) = e2
+in 
+  case x of
+     (x1, x2) =&gt;
+       (case x1 of
+          C2 b' =&gt; (case x2 of
+                      C1 a' =&gt; f1 a'
+                    | C3 c' =&gt; f2(b',c')
+                    | _ =&gt; raise Match)
+        | _ =&gt; (case x2 of
+                  C1 a'' =&gt; f1 a''
+                | _ =&gt; raise Match))
+end
+</pre>
+</p>
+<p>
+Here you can see the necessity of abstracting out the ride hand sides of the cases in order to avoid code duplication.  Right hand sides are always abstracted.  The simplifier cleans things up.  You can also see the new (primed) variables introduced by the match compiler and how the renaming works.  Finally, you can see how the match compiler introduces the necessary default clauses in order to make a match exhaustive, i.e. cover all the cases. 
+</p>
+<p>
+The match compiler uses <tt>numCons</tt> and <tt>tyconCons</tt> to determine the exhaustivity of matches against constructors. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:32:50 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MatthewFluet
===================================================================
--- mlton/trunk/doc/guide/MatthewFluet	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MatthewFluet	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,93 @@
+<!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>MatthewFluet - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MatthewFluet
+    <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">
+Matthew Fluet ( <a class="external" href="mailto:mfluet@acm.org"><img src="moin-email.png" alt="[MAILTO]" height="10" width="14">mfluet@acm.org</a> , <a class="external" href="http://www.cs.cornell.edu/People/fluet"><img src="moin-www.png" alt="[WWW]" height="11" width="11">http://www.cs.cornell.edu/People/fluet</a> ) is a PhD student in the <a class="external" href="http://www.cs.cornell.edu"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Computer Science Department</a> at <a class="external" href="http://www.cornell.edu"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Cornell University</a>. <hr>
+ <p>
+Current MLton projects: 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ Migrating SSA optimizations to SSA2 
+</p>
+</li>
+    <li>
+<p>
+ Improving CML implementation 
+</p>
+</li>
+    <li>
+<p>
+ Porting ML-Doc 
+</p>
+</li>
+    <li>
+<p>
+ Porting ML-NLFFI 
+</p>
+</li>
+    <li>
+<p>
+ Porting ML-RISC 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-04-20 14:02:11 by <span title="cfs27.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MichaelNorrish
===================================================================
--- mlton/trunk/doc/guide/MichaelNorrish	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MichaelNorrish	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,62 @@
+<!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>MichaelNorrish - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MichaelNorrish
+    <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">
+I am a researcher at <a class="external" href="http://nicta.com.au"><img src="moin-www.png" alt="[WWW]" height="11" width="11">NICTA</a>, with a web-page <a class="external" href="http://web.rsise.anu.edu.au/~michaeln/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">here</a>. <p>
+I'm interested in MLton because of the chance that it might be a good vehicle for future implementations of the <a class="external" href="http://hol.sf.net"><img src="moin-www.png" alt="[WWW]" height="11" width="11">HOL</a> theorem-proving system. It's beginning to look as if one route forward will be to embed an SML interpreter into a MLton-compiled executable.  I don't know if an extensible interpreter of the kind we're looking for already exists. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-04-05 06:48:34 by <span title="raceme.rsise.anu.edu.au"><a href="MichaelNorrish">MichaelNorrish</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MikeThomas
===================================================================
--- mlton/trunk/doc/guide/MikeThomas	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MikeThomas	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,63 @@
+<!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>MikeThomas - 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">
+
+
+<link rel="Appendix" title="picture.jpg" href="http://mlton.org/pages/MikeThomas/attachments/picture.jpg">
+</head>
+
+<body lang="en" dir="ltr">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MikeThomas
+    <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">
+Here is a picture at home in Brisbane, Queensland, Australia, taken in January 2004.   <p>
+<img src="http://mlton.org/pages/MikeThomas/attachments/picture.jpg?ts=1098900911" alt="picture.jpg"> 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-10-27 18:15:50 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MoinMoin
===================================================================
--- mlton/trunk/doc/guide/MoinMoin	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MoinMoin	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,62 @@
+<!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>MoinMoin - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MoinMoin
+    <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">
+<a class="external" href="http://moinmoin.wikiwikiweb.de/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">MoinMoin</a> is the wiki engine used to implement this site. <p>
+You can find out technical specifics about this particular instance of MoinMoin at the <a href="SystemInfo">SystemInfo</a> page. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-10-25 20:51:11 by <span title="eponym"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Monomorphise
===================================================================
--- mlton/trunk/doc/guide/Monomorphise	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Monomorphise	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,120 @@
+<!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>Monomorphise - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Monomorphise
+    <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">
+A translation pass from the <a href="XML">XML</a> <a href="IntermediateLanguage">IntermediateLanguage</a> to the <a href="SXML">SXML</a> <a href="IntermediateLanguage">IntermediateLanguage</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Monomorphisation eliminates polymorphic values and datatype declarations by duplicating them for each type at which they are used. 
+</p>
+<p>
+Consider the following <a href="XML">XML</a> program.  
+<pre>datatype 'a t = T of 'a
+fun 'a f (x: 'a) = T x
+val a = f 1
+val b = f 2
+val z = f (3, 4)
+</pre> The result of monorphising this program is the following <a href="SXML">SXML</a> program:  
+<pre>datatype t1 = T1 of int
+datatype t2 = T2 of int * int
+fun f1 (x: t1) = T1 x
+fun f2 (x: t2) = T2 x
+val a = f1 1
+val b = f1 2
+val z = f2 (3, 4)
+</pre>
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/xml/monomorphise.sig?view=markup">monomorphise.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/xml/monomorphise.fun?view=markup">monomorphise.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+<p>
+The monomorphiser works by making one pass over the entire program. On the way down, it creates a cache for each variable declared in a polymorphic declaration that maps a lists of type arguments to a new variable name.  At a variable reference, it consults the cache (based on the types the variable is applied to).  If there is already an entry in the cache, it is used.  If not, a new entry is created.  On the way up, the monomorphiser duplicates a variable declaration for each entry in the cache. 
+</p>
+<p>
+As with variables, the monomorphiser records all of the type at which constructors are used.  After the entire program is processed, the monomorphiser duplicates each datatype declaration and its associated constructors. 
+</p>
+<p>
+The monomorphiser duplicates all of the functions declared in a <tt>fun</tt> declaration as a unit.  Consider the following program 
+<pre>fun 'a f (x: 'a) = g x
+and g (y: 'a) = f y
+val a = f 13
+val b = g 14
+val c = f (1, 2)</pre>and its monomorphisation 
+<pre>fun f1 (x: int) = g1 x
+and g1 (y: int) = f1 y
+fun f2 (x : int * int) = g2 x
+and g2 (y : int * int) = f2 y
+val a = f1 13
+val b = g1 14
+val c = f2 (1, 2)
+</pre>
+</p>
+<h2 id="head-d9df837d9182159c3848b74ca46f0a57ec960cdb">Pathological datatype declarations</h2>
+<p>
+SML allows a pathological polymorphic datatype declaration in which recursive uses of the defined type constructor are applied to different type arguments than the definition.  This has been disallowed by others on type theoretic grounds.  A canonical example is the following. 
+<pre>datatype 'a t = A of 'a | B of ('a * 'a) t
+val z : int t = B (B (A ((1, 2), (3, 4))))
+</pre>The presence of the recursion in the datatype declaration might appear to cause the need for the monomorphiser to create an infinite number of types.  However, due to the absence of polymorphic recursion in SML, there are in fact only a finite number of instances of such types in any given program.  The monomorphiser translates the above program to the following one. 
+<pre>datatype t1 = B1 of t2
+datatype t2 = B2 of t3
+datatype t3 = A3 of (int * int) * (int * int)
+val z : int t = B1 (B2 (A3 ((1, 2), (3, 4))))
+</pre>It is crucial that the monomorphiser be allowed to drop unused constructors from datatype declarations in order for the translation to terminate. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:32:32 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/MoscowML
===================================================================
--- mlton/trunk/doc/guide/MoscowML	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/MoscowML	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,59 @@
+<!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>MoscowML - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      MoscowML
+    <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">
+<a class="external" href="http://www.dina.kvl.dk/~sestoft/mosml.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Moscow ML</a> is a <a href="StandardMLImplementations">Standard ML Compiler</a>.  It is a byte-code compiler, so it compiles code quickly, but the code runs slowly.  See <a href="Performance">Performance</a>. </div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-30 20:11:52 by <span title="adsl-64-166-225-13.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Multi
===================================================================
--- mlton/trunk/doc/guide/Multi	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Multi	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,69 @@
+<!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>Multi - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Multi
+    <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">
+An analysis pass for the <a href="SSA">SSA</a> <a href="IntermediateLanguage">IntermediateLanguage</a>,  invoked from <a href="ConstantPropagation">ConstantPropagation</a> and <a href="LocalRef">LocalRef</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Analyzes the control flow of a <a href="SSA">SSA</a> program to determine when <a href="SSA">SSA</a> functions and blocks may be executed more than once or by more than one thread.  Also determines when a program uses threads and when functions and blocks directly or indirectly invoke <tt>Thread_copyCurrent</tt>. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/multi.sig?view=markup">multi.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/multi.fun?view=markup">multi.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:32:13 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Mutable
===================================================================
--- mlton/trunk/doc/guide/Mutable	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Mutable	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,59 @@
+<!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>Mutable - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Mutable
+    <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">
+Mutable is an adjective meaning can be modified.  In <a href="StandardML">Standard ML</a>, ref cells and arrays are mutable, while all other values are <a href="Immutable">immutable</a>. </div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-08 18:51:14 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/OCaml
===================================================================
--- mlton/trunk/doc/guide/OCaml	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/OCaml	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,225 @@
+<!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>OCaml - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      OCaml
+    <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">
+<a class="external" href="http://caml.inria.fr/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">OCaml</a> is a variant of <a href="ML">ML</a> and is similar to <a href="StandardML">Standard ML</a>. <h2 id="head-bdb603a1546c889e07912df83fb168fdc6469ce8">OCaml and SML</h2>
+<p>
+Here's a comparison of some aspects of the OCaml and SML languages. 
+</p>
+
+        <ul>
+
+        <li>
+<p>
+ Standard ML has a formal <a href="DefinitionOfStandardML">Definition</a>,   while OCaml is specified by its lone implementation and informal   documentation.  
+</p>
+</li>
+        <li class="gap">
+<p>
+ Standard ML has a number of <a href="StandardMLImplementations">compilers</a>,   while OCaml has only one. 
+</p>
+</li>
+        <li class="gap">
+<p>
+ OCaml has built-in support for object-oriented programming, while   Standard ML does not (however, see <a href="ObjectOrientedProgramming">ObjectOrientedProgramming</a>). 
+</p>
+</li>
+        <li class="gap">
+<p>
+ Andreas Rossberg has a   <a class="external" href="http://www.ps.uni-sb.de/~rossberg/SMLvsOcaml.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">side-by-side comparison</a>   of the syntax of SML and OCaml. 
+</p>
+</li>
+
+        </ul>
+
+
+<h2 id="head-305cf7c02f3e0da3e842ba7d0bcefe80ed2dbfd1">OCaml and MLton</h2>
+<p>
+Here's a comparison of some aspects of OCaml and MLton. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ Performance 
+</p>
+</li>
+
+        <ul>
+
+        <li>
+<p>
+ Both OCaml and MLton have excellent performance.  
+</p>
+</li>
+        <li class="gap">
+<p>
+ MLton performs extensive <a href="WholeProgramOptimization">WholeProgramOptimization</a>, which can   provide substantial improvements in large, modular programs. 
+</p>
+</li>
+        <li class="gap">
+<p>
+ MLton uses native types, like 32-bit integers, without any penalty   due to tagging or boxing.  OCaml uses 31-bit integers with a penalty   due to tagging, and 32-bit integers with a penalty due to boxing. 
+</p>
+</li>
+        <li class="gap">
+<p>
+ MLton uses native types, like 64-bit floats, without any penalty   due to boxing.  OCaml, in some situations, boxes 64-bit floats. 
+</p>
+</li>
+        <li class="gap">
+<p>
+ MLton represents arrays of all types unboxed.  In OCaml, only   arrays of 64-bit floats are unboxed, and then only when it is   syntactically apparent. 
+</p>
+</li>
+        <li class="gap">
+<p>
+ MLton represents records compactly by reordering and packing the   fields. 
+</p>
+</li>
+        <li class="gap">
+<p>
+ In MLton, polymorphic and monomorphic code have the same   performance.  In OCaml, polymorphism can introduce a performance   penalty. 
+</p>
+</li>
+        <li class="gap">
+<p>
+ In MLton, module boundaries have no impact on performance.  In   OCaml, moving code between modules can cause a performance penalty. 
+</p>
+</li>
+
+        </ul>
+
+
+    <li class="gap">
+<p>
+ MLton's <a href="ForeignFunctionInterface">ForeignFunctionInterface</a> is simpler than OCaml's. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ Tools 
+</p>
+</li>
+
+        <ul>
+
+        <li>
+<p>
+ OCaml has a debugger, while MLton does not. 
+</p>
+</li>
+        <li class="gap">
+<p>
+ OCaml supports seperate compilation, while MLton does not. 
+</p>
+</li>
+        <li class="gap">
+<p>
+ OCaml compiles faster than MLton. 
+</p>
+</li>
+        <li class="gap">
+<p>
+ MLton supports profiling of both time and allocation. 
+</p>
+</li>
+
+        </ul>
+
+
+    <li class="gap">
+<p>
+ Libraries 
+</p>
+</li>
+
+        <ul>
+
+        <li>
+<p>
+ OCaml has more available libraries. 
+</p>
+</li>
+
+        </ul>
+
+
+    <li class="gap">
+<p>
+ Community 
+</p>
+</li>
+
+        <ul>
+
+        <li>
+<p>
+ OCaml has a larger community than MLton.   
+</p>
+</li>
+        <li class="gap">
+<p>
+ MLton has a very responsive   <a class="external" href="http://www.mlton.org/mailman/listinfo/mlton"><img src="moin-www.png" alt="[WWW]" height="11" width="11">developer list</a>. 
+</p>
+</li>
+</ul>
+
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-11 12:14:37 by <span title="ip68-224-49-254.lv.lv.cox.net"><a href="ChrisClearwater">ChrisClearwater</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/ObjectOrientedProgramming
===================================================================
--- mlton/trunk/doc/guide/ObjectOrientedProgramming	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/ObjectOrientedProgramming	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,79 @@
+<!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>ObjectOrientedProgramming - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      ObjectOrientedProgramming
+    <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">
+<a href="StandardML">Standard ML</a> does not have explicit support for object-oriented programming.  Here are some papers that show how to express some object-oriented concepts in SML. 
+    <ul>
+
+    <li>
+<p>
+ <a href = "References#Berthomieu00"> OO Programming styles in ML</a> 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a href = "References#ThorupTofte94"> Object-oriented programming and Standard ML</a> 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a href = "References#LarsenNiss04"> mGTK: An SML binding of Gtk+</a> 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-26 17:35:40 by <span title="adsl-10-6-82.mia.bellsouth.net"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/OpenGL
===================================================================
--- mlton/trunk/doc/guide/OpenGL	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/OpenGL	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,88 @@
+<!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>OpenGL - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      OpenGL
+    <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">
+There are at least two interfaces to OpenGL for MLton/SML, both of which should be considered alpha quality. 
+    <ul>
+
+    <li>
+<p>
+ <a href="MikeThomas">MikeThomas</a> built a low-level interface, directly translating many  of the functions, covering GL, GLU, and GLUT.  This is available in  the MLton <a href="Sources">Sources</a>: 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/lib/opengl">opengl</a>
+.  The code contains a  number of small, standard OpenGL examples translated to SML. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a href="ChrisClearwater">ChrisClearwater</a> has written at least an interface to GL, and  possibly more.  See 
+</p>
+</li>
+
+            <ul>
+
+   <a href="http://mlton.org/pipermail/mlton/2005-January/026669.html">http://mlton.org/pipermail/mlton/2005-January/026669.html</a> 
+            </ul>
+
+
+
+    </ul>
+
+
+<p>
+<a href="Contact">Contact</a> us for more information or an update on the status of these projects. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:31:56 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/OperatorPrecedence
===================================================================
--- mlton/trunk/doc/guide/OperatorPrecedence	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/OperatorPrecedence	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,71 @@
+<!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>OperatorPrecedence - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      OperatorPrecedence
+    <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">
+<a href="StandardML">Standard ML</a> has a built in notion of precedence for certain symbols.  Every program that includes the  <a href="BasisLibrary"> SML Basis Library</a> automatically gets the following infix declarations.  Higher number indicates higher precedence. 
+<pre class=code>
+<B><FONT COLOR="#A020F0">infix</FONT></B> 7 * / mod div
+<B><FONT COLOR="#A020F0">infix</FONT></B> 6 + - ^
+<B><FONT COLOR="#A020F0">infixr</FONT></B> 5 :: @
+<B><FONT COLOR="#A020F0">infix</FONT></B> 4 = &lt;&gt; &gt; &gt;= &lt; &lt;=
+<B><FONT COLOR="#A020F0">infix</FONT></B> 3 := o
+<B><FONT COLOR="#A020F0">infix</FONT></B> 0 before
+</PRE>
+<p>
+ 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-28 21:50:54 by <span title="cfs36.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/OptionalArguments
===================================================================
--- mlton/trunk/doc/guide/OptionalArguments	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/OptionalArguments	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,299 @@
+<!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>OptionalArguments - 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">
+
+
+<link rel="Appendix" title="optionalargs.sml" href="http://mlton.org/pages/OptionalArguments/attachments/optionalargs.sml">
+</head>
+
+<body lang="en" dir="ltr">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      OptionalArguments
+    <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">
+Optional arguments are function parameters which may be omitted from applications of the function, in which case the parameters take on default values. <p>
+<a href="StandardML">Standard ML</a> does not have built-in support for optional arguments (as does <a href="OCaml">OCaml</a>).  Despite the absence of built-in support, it is easy to emulate optional arguments. 
+</p>
+<p>
+For example, consider the function 
+<pre class=code>
+<B><FONT COLOR="#A020F0">fun</FONT></B> f x {a, b, c} = a * (real c) + b * (real x)
+</PRE>
+ for which the parameters <tt>a</tt>, <tt>b</tt>, and <tt>c</tt> should take on the default values specified by 
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> defs = {a = <B><FONT COLOR="#5F9EA0">0.0</FONT></B>, b = <B><FONT COLOR="#5F9EA0">0.0</FONT></B>, c = <B><FONT COLOR="#5F9EA0">0</FONT></B>}
+</PRE>
+ We wish to provide an (optionalized) function <tt>f'</tt> and two (general) functions <tt>$</tt> and <tt>`</tt> such that 
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> X = f' <B><FONT COLOR="#5F9EA0">1</FONT></B> $
+<B><FONT COLOR="#A020F0">val</FONT></B> Y = f' <B><FONT COLOR="#5F9EA0">1</FONT></B> (` #b <B><FONT COLOR="#5F9EA0">1.0</FONT></B>) $
+<B><FONT COLOR="#A020F0">val</FONT></B> Z = f' <B><FONT COLOR="#5F9EA0">1</FONT></B> (` #a <B><FONT COLOR="#5F9EA0">1.0</FONT></B>) (` #c <B><FONT COLOR="#5F9EA0">2</FONT></B>) (` #b <B><FONT COLOR="#5F9EA0">1.0</FONT></B>) $
+<B><FONT COLOR="#A020F0">val</FONT></B> () = print (concat [<FONT COLOR="#BC8F8F"><B>&quot;X = &quot;</FONT></B>, Real.toString X, <FONT COLOR="#BC8F8F"><B>&quot;, Y = &quot;</FONT></B>, Real.toString Y, <FONT COLOR="#BC8F8F"><B>&quot;, Z = &quot;</FONT></B>, Real.toString Z, <FONT COLOR="#BC8F8F"><B>&quot;\n&quot;</FONT></B>])
+</PRE>
+ prints out the following: 
+<pre>X = 0, Y = 1, Z = 3
+</pre>
+</p>
+<p>
+Here is the signature for the two general supporting functions, as well as two additional functions: 
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> OPTIONAL =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> ('upds, 'opts, 'res) t
+      </FONT></B><B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> ('upds, 'opts, 'res, 'k) u </FONT></B>=<FONT COLOR="#228B22"><B>
+         (('upds, 'opts, 'res) t -&gt; 'k) -&gt; 'k
+
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> $ : ('upds, 'opts, 'res) t -&gt; 'res
+
+      <B><FONT COLOR="#A020F0">val</FONT></B> ` : ('upds -&gt; ('opts -&gt; 'x -&gt; 'opts)) -&gt; 
+              'x -&gt;
+              ('upds, 'opts, 'res) t -&gt;
+              ('upds, 'opts, 'res, 'k) u
+
+      <B><FONT COLOR="#A020F0">val</FONT></B> `` : 'opts -&gt;
+               ('upds, 'opts, 'res) t -&gt;
+               ('upds, 'opts, 'res, 'k) u
+
+      <B><FONT COLOR="#A020F0">val</FONT></B> make : 'upds -&gt;
+                 'opts -&gt;
+                 ('opts -&gt; 'res) -&gt;
+                 ('upds, 'opts, 'res, 'k) u
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+ Our intention is that the type <tt>('upds,&nbsp;'opts,&nbsp;'res)&nbsp;t</tt> represents the type of functions returning the type <tt>'res</tt> and whose optional arguments are given by the (record) type <tt>'opts</tt>; supporting the optional arguments is the (record) type <tt>'upds</tt> of update functions.  The function <tt>`</tt> introduces an override for an optional argument,while <tt>$</tt> marks the end of optional arguments.  The function <tt>``</tt> provides a convenient way to simultaneously set all optional arguments; it can also be useful when the <tt>'opts</tt> type is kept abstract, in which case the defining module may provide values of type <tt>'opts</tt> that may be used with <tt>``</tt> to install a new set of default values, while <tt>`</tt> may continue to be used to override these new defaults.  Finally, the <tt>make</tt> function transforms a function to use optional arguments: 
+</p>
+<p>
+A structure matching <tt>OPTIONAL</tt> could be used as follows. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">functor</FONT></B> MakeF (S: OPTIONAL) :&gt;
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> opts
+      </FONT></B><B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> 'a upd </FONT></B>=<FONT COLOR="#228B22"><B> opts -&gt; 'a -&gt; opts
+      </FONT></B><B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> upds </FONT></B>=<FONT COLOR="#228B22"><B> {a: real upd, b: real upd, c: int upd}
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> f' : int -&gt; (upds, opts, real, 'k) S.u
+      <B><FONT COLOR="#A020F0">val</FONT></B> opts_def2 : opts
+   <B><FONT COLOR="#0000FF">end</FONT></B> =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#0000FF">open</FONT></B> S
+
+      <I><FONT COLOR="#B22222">(* define the function and defaults *)</FONT></I>
+      <B><FONT COLOR="#A020F0">fun</FONT></B> f x {a, b, c} = a * (real c) + b * (real x)
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> opts </FONT></B>=<FONT COLOR="#228B22"><B> {a: real, b: real, c: int}
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> opts_def1 <I><FONT COLOR="#B22222">(* : opts *)</FONT></I> = {a = <B><FONT COLOR="#5F9EA0">0.0</FONT></B>, b = <B><FONT COLOR="#5F9EA0">0.0</FONT></B>, c = <B><FONT COLOR="#5F9EA0">0</FONT></B>}
+      <B><FONT COLOR="#A020F0">val</FONT></B> opts_def2 <I><FONT COLOR="#B22222">(* : opts *)</FONT></I> = {a = <B><FONT COLOR="#5F9EA0">1.0</FONT></B>, b = <B><FONT COLOR="#5F9EA0">1.0</FONT></B>, c = <B><FONT COLOR="#5F9EA0">1</FONT></B>}
+
+      <I><FONT COLOR="#B22222">(* define the update functions *)</FONT></I>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> 'a upd </FONT></B>=<FONT COLOR="#228B22"><B> opts -&gt; 'a -&gt; opts
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> upda <I><FONT COLOR="#B22222">(* : real upd *)</FONT></I> = <B><FONT COLOR="#A020F0">fn</FONT></B> {a, b, c} =&gt; <B><FONT COLOR="#A020F0">fn</FONT></B> a' =&gt; {a = a', b = b, c = c}
+      <B><FONT COLOR="#A020F0">val</FONT></B> updb <I><FONT COLOR="#B22222">(* : real upd *)</FONT></I> = <B><FONT COLOR="#A020F0">fn</FONT></B> {a, b, c} =&gt; <B><FONT COLOR="#A020F0">fn</FONT></B> b' =&gt; {a = a, b = b', c = c}
+      <B><FONT COLOR="#A020F0">val</FONT></B> updc <I><FONT COLOR="#B22222">(* : int upd *)</FONT></I> = <B><FONT COLOR="#A020F0">fn</FONT></B> {a, b, c} =&gt; <B><FONT COLOR="#A020F0">fn</FONT></B> c' =&gt; {a = a, b = b, c = c'}
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> upds </FONT></B>=<FONT COLOR="#228B22"><B> {a: real upd, b: real upd, c: int upd}
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> upds = {a = upda, b = updb, c = updc}
+
+      <B><FONT COLOR="#A020F0">fun</FONT></B> f' x <I><FONT COLOR="#B22222">(* : (upds, opts, real, 'k) u *)</FONT></I> = 
+         make upds opts_def1 (f x)
+
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+
+<B><FONT COLOR="#0000FF">functor</FONT></B> TestOptionalF (S: OPTIONAL) =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#0000FF">structure</FONT></B> F = MakeF (S)
+      <B><FONT COLOR="#0000FF">open</FONT></B> F S
+
+      <B><FONT COLOR="#A020F0">val</FONT></B> X = f' <B><FONT COLOR="#5F9EA0">1</FONT></B> $
+      <B><FONT COLOR="#A020F0">val</FONT></B> Y = f' <B><FONT COLOR="#5F9EA0">1</FONT></B> (` #b <B><FONT COLOR="#5F9EA0">1.0</FONT></B>) $
+      <B><FONT COLOR="#A020F0">val</FONT></B> Z = f' <B><FONT COLOR="#5F9EA0">1</FONT></B> (` #a <B><FONT COLOR="#5F9EA0">1.0</FONT></B>) (` #c <B><FONT COLOR="#5F9EA0">2</FONT></B>) (` #b <B><FONT COLOR="#5F9EA0">1.0</FONT></B>) $
+      <B><FONT COLOR="#A020F0">val</FONT></B> () = print (concat [<FONT COLOR="#BC8F8F"><B>&quot;X = &quot;</FONT></B>, Real.toString X, <FONT COLOR="#BC8F8F"><B>&quot;, Y = &quot;</FONT></B>, Real.toString Y, <FONT COLOR="#BC8F8F"><B>&quot;, Z = &quot;</FONT></B>, Real.toString Z, <FONT COLOR="#BC8F8F"><B>&quot;\n&quot;</FONT></B>])
+
+      <B><FONT COLOR="#A020F0">val</FONT></B> X = f' <B><FONT COLOR="#5F9EA0">1</FONT></B> (`` opts_def2) $
+      <B><FONT COLOR="#A020F0">val</FONT></B> Y = f' <B><FONT COLOR="#5F9EA0">1</FONT></B> (`` opts_def2) (` #b <B><FONT COLOR="#5F9EA0">1.0</FONT></B>) $
+      <B><FONT COLOR="#A020F0">val</FONT></B> Z = f' <B><FONT COLOR="#5F9EA0">1</FONT></B> (`` opts_def2) (` #a <B><FONT COLOR="#5F9EA0">1.0</FONT></B>) (` #c <B><FONT COLOR="#5F9EA0">2</FONT></B>) (` #b <B><FONT COLOR="#5F9EA0">1.0</FONT></B>) $
+      <B><FONT COLOR="#A020F0">val</FONT></B> () = print (concat [<FONT COLOR="#BC8F8F"><B>&quot;X = &quot;</FONT></B>, Real.toString X, <FONT COLOR="#BC8F8F"><B>&quot;, Y = &quot;</FONT></B>, Real.toString Y, <FONT COLOR="#BC8F8F"><B>&quot;, Z = &quot;</FONT></B>, Real.toString Z, <FONT COLOR="#BC8F8F"><B>&quot;\n&quot;</FONT></B>])
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<p>
+The implementation of <tt>OPTIONAL</tt> is actually quite straightforward: 
+<pre class=code>
+<B><FONT COLOR="#0000FF">structure</FONT></B> Optional :&gt; OPTIONAL =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> ('upds, 'opts, 'res) t </FONT></B>=<FONT COLOR="#228B22"><B>
+         'upds * 'opts * ('opts -&gt; 'res)
+      </FONT></B><B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> ('upds, 'opts, 'res, 'k) u </FONT></B>=<FONT COLOR="#228B22"><B>
+         (('upds, 'opts, 'res) t -&gt; 'k) -&gt; 'k
+         
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> make =
+         <B><FONT COLOR="#A020F0">fn</FONT></B> upds =&gt;
+         <B><FONT COLOR="#A020F0">fn</FONT></B> defs =&gt;
+         <B><FONT COLOR="#A020F0">fn</FONT></B> f =&gt;
+         <B><FONT COLOR="#A020F0">fn</FONT></B> k =&gt; k (upds, defs, f)
+
+      <B><FONT COLOR="#A020F0">fun</FONT></B> `` opts =
+         <B><FONT COLOR="#A020F0">fn</FONT></B> (upds, opts, f) =&gt;
+         <B><FONT COLOR="#A020F0">fn</FONT></B> k =&gt;
+         k (upds, opts, f)
+         
+      <B><FONT COLOR="#A020F0">fun</FONT></B> ` sel v = 
+         <B><FONT COLOR="#A020F0">fn</FONT></B> (upds, opts, f) =&gt;
+         <B><FONT COLOR="#A020F0">fn</FONT></B> k =&gt; 
+         k (upds, sel upds opts v, f)
+         
+      <B><FONT COLOR="#A020F0">val</FONT></B> $ = 
+         <B><FONT COLOR="#A020F0">fn</FONT></B> (upds, opts, f) =&gt;
+         f opts
+  <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+ 
+</p>
+<p>
+One may also mix sequences of required and optional arguments. 
+<pre class=code>
+<B><FONT COLOR="#0000FF">functor</FONT></B> MakeG (S: OPTIONAL) :&gt;
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> optsABC
+      </FONT></B><B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> 'x updABC </FONT></B>=<FONT COLOR="#228B22"><B> optsABC -&gt; 'x -&gt; optsABC
+      </FONT></B><B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> updsABC </FONT></B>=<FONT COLOR="#228B22"><B> {a: real updABC, b: real updABC, c: int updABC}
+      </FONT></B><B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> optsDEF
+      </FONT></B><B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> 'x updDEF </FONT></B>=<FONT COLOR="#228B22"><B> optsDEF -&gt; 'x -&gt; optsDEF
+      </FONT></B><B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> updsDEF </FONT></B>=<FONT COLOR="#228B22"><B> {d: int updDEF, e: int updDEF, f: real updDEF}
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> g' : int -&gt; (updsABC, optsABC,
+                       real -&gt; (updsDEF, optsDEF, string -&gt; unit, 'kDEF) S.u,
+                       'kABC) S.u
+   <B><FONT COLOR="#0000FF">end</FONT></B> =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#0000FF">open</FONT></B> S
+
+      <I><FONT COLOR="#B22222">(* define the function and defaults *)</FONT></I>
+      <B><FONT COLOR="#A020F0">fun</FONT></B> g x {a, b, c} y {d, e, f} s = 
+         <B><FONT COLOR="#A020F0">let</FONT></B>
+            <B><FONT COLOR="#A020F0">val</FONT></B> z1 = a * (real c) + b * (real x)
+            <B><FONT COLOR="#A020F0">val</FONT></B> z2 = (real d) * f + (real e) * y
+         <B><FONT COLOR="#A020F0">in</FONT></B>
+            print (concat [s, Real.toString (z1 + z2), s, <FONT COLOR="#BC8F8F"><B>&quot;\n&quot;</FONT></B>])
+         <B><FONT COLOR="#A020F0">end</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> optsABC </FONT></B>=<FONT COLOR="#228B22"><B> {a: real, b: real, c: int}
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> optsABC_def <I><FONT COLOR="#B22222">(* : optsABC *)</FONT></I> = {a = <B><FONT COLOR="#5F9EA0">0.0</FONT></B>, b = <B><FONT COLOR="#5F9EA0">0.0</FONT></B>, c = <B><FONT COLOR="#5F9EA0">0</FONT></B>}
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> optsDEF </FONT></B>=<FONT COLOR="#228B22"><B> {d: int, e: int, f: real}
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> optsDEF_def <I><FONT COLOR="#B22222">(* : optsDEF *)</FONT></I> = {d = <B><FONT COLOR="#5F9EA0">1</FONT></B>, e = <B><FONT COLOR="#5F9EA0">1</FONT></B>, f = <B><FONT COLOR="#5F9EA0">1.0</FONT></B>}
+
+      <I><FONT COLOR="#B22222">(* define the update functions *)</FONT></I>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> 'a updABC </FONT></B>=<FONT COLOR="#228B22"><B> optsABC -&gt; 'a -&gt; optsABC
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> upda <I><FONT COLOR="#B22222">(* : real updABC *)</FONT></I> = <B><FONT COLOR="#A020F0">fn</FONT></B> {a, b, c} =&gt; <B><FONT COLOR="#A020F0">fn</FONT></B> a' =&gt; {a = a', b = b, c = c}
+      <B><FONT COLOR="#A020F0">val</FONT></B> updb <I><FONT COLOR="#B22222">(* : real updABC *)</FONT></I> = <B><FONT COLOR="#A020F0">fn</FONT></B> {a, b, c} =&gt; <B><FONT COLOR="#A020F0">fn</FONT></B> b' =&gt; {a = a, b = b', c = c}
+      <B><FONT COLOR="#A020F0">val</FONT></B> updc <I><FONT COLOR="#B22222">(* : int updABC *)</FONT></I> = <B><FONT COLOR="#A020F0">fn</FONT></B> {a, b, c} =&gt; <B><FONT COLOR="#A020F0">fn</FONT></B> c' =&gt; {a = a, b = b, c = c'}
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> updsABC </FONT></B>=<FONT COLOR="#228B22"><B> {a: real updABC, b: real updABC, c: int updABC}
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> updsABC = {a = upda, b = updb, c = updc}
+
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> 'a updDEF </FONT></B>=<FONT COLOR="#228B22"><B> optsDEF -&gt; 'a -&gt; optsDEF
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> updd <I><FONT COLOR="#B22222">(* : real updDEF *)</FONT></I> = <B><FONT COLOR="#A020F0">fn</FONT></B> {d, e, f} =&gt; <B><FONT COLOR="#A020F0">fn</FONT></B> d' =&gt; {d = d', e = e, f = f}
+      <B><FONT COLOR="#A020F0">val</FONT></B> upde <I><FONT COLOR="#B22222">(* : real updDEF *)</FONT></I> = <B><FONT COLOR="#A020F0">fn</FONT></B> {d, e, f} =&gt; <B><FONT COLOR="#A020F0">fn</FONT></B> e' =&gt; {d = d, e = e', f = f}
+      <B><FONT COLOR="#A020F0">val</FONT></B> updf <I><FONT COLOR="#B22222">(* : int updDEF *)</FONT></I> = <B><FONT COLOR="#A020F0">fn</FONT></B> {d, e, f} =&gt; <B><FONT COLOR="#A020F0">fn</FONT></B> f' =&gt; {d = d, e = e, f = f'}
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> updsDEF </FONT></B>=<FONT COLOR="#228B22"><B> {d: int updDEF, e: int updDEF, f: real updDEF}
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> updsDEF = {d = updd, e = upde, f = updf}
+
+      <B><FONT COLOR="#A020F0">val</FONT></B> g' <I><FONT COLOR="#B22222">(* : (upds, opts, real, 'k) u *)</FONT></I> = (<B><FONT COLOR="#A020F0">fn</FONT></B> x =&gt;
+         make updsABC optsABC_def (<B><FONT COLOR="#A020F0">fn</FONT></B> optsABC =&gt; <B><FONT COLOR="#A020F0">fn</FONT></B> y =&gt;
+         make updsDEF optsDEF_def (<B><FONT COLOR="#A020F0">fn</FONT></B> optsDEF =&gt; <B><FONT COLOR="#A020F0">fn</FONT></B> s =&gt;
+         g x optsABC y optsDEF s)))
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+
+<B><FONT COLOR="#0000FF">functor</FONT></B> TestOptionalG (S: OPTIONAL) =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#0000FF">structure</FONT></B> G = MakeG (S)
+      <B><FONT COLOR="#0000FF">open</FONT></B> G S
+
+      <B><FONT COLOR="#A020F0">val</FONT></B> () = g' <B><FONT COLOR="#5F9EA0">1</FONT></B> (` #a <B><FONT COLOR="#5F9EA0">3.0</FONT></B>) $ <B><FONT COLOR="#5F9EA0">1.0</FONT></B> (` #e <B><FONT COLOR="#5F9EA0">2</FONT></B>) $ <FONT COLOR="#BC8F8F"><B>&quot; ** &quot;</FONT></B>
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+ 
+</p>
+<p>
+To make a complete program and test the above code, we can apply the <tt>TestOptionalF</tt> and <tt>TestOptionalG</tt> functors to our implemenation. 
+<pre class=code>
+<B><FONT COLOR="#0000FF">structure</FONT></B> TestF = TestOptionalF (Optional)
+<B><FONT COLOR="#0000FF">structure</FONT></B> TestG = TestOptionalG (Optional)
+</PRE>
+ 
+</p>
+<p>
+Running the complete code prints out the following. 
+<pre>X = 0, Y = 1, Z = 3
+X = 2, Y = 2, Z = 3
+ ** 3 ** 
+</pre>
+</p>
+<h2 id="head-a479c9c34e878d07b4d67a73a48f432ad7dc53c8">Download</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="http://mlton.org/pages/OptionalArguments/attachments/optionalargs.sml">optionalargs.sml</a> 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-70440046a3dc2e079f23ee1c57dfa76669b732aa">Notes</h2>
+
+    <ul>
+
+    <li>
+<p>
+ The ability to pass a record selector as a first-class function value is key to the succinctness of this technique. 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-30 23:56:31 by <span title="cfs38.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/OrphanedPages
===================================================================
--- mlton/trunk/doc/guide/OrphanedPages	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/OrphanedPages	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,85 @@
+<!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>OrphanedPages - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      OrphanedPages
+    <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">
+Pages that no other page links to.   Also see <a href="WantedPages">WantedPages</a>. <p>
+<ol>
+<li>
+<a href="EXene">EXene</a></li>
+<li>
+<a href="Identifier">Identifier</a></li>
+<li>
+<a href="LanguageChanges">LanguageChanges</a></li>
+<li>
+<a href="Serialization">Serialization</a></li>
+<li>
+<a href="Survey">Survey</a></li>
+<li>
+<a href="SurveyDone">SurveyDone</a></li>
+<li>
+<a href="Swerve">Swerve</a></li>
+<li>
+<a href="http://mlton.org/TemporaryBugExamples">TemporaryBugExamples</a></li>
+<li>
+<a href="Variant">Variant</a></li>
+<li>
+<a href="ZZZOrphanedPages">ZZZOrphanedPages</a></li>
+</ol>
+
+ 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-09 14:46:17 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/OtherSites
===================================================================
--- mlton/trunk/doc/guide/OtherSites	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/OtherSites	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,104 @@
+<!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>OtherSites - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      OtherSites
+    <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">
+Other sites that have a MLton page (or more). 
+    <ul>
+
+    <li>
+<p>
+ <a class="external" href="http://www.advogato.org/proj/mlton/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Advogato</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a class="external" href="http://packages.debian.org/mlton"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Debian GNU/Linux</a>  (<a class="external" href="http://packages.qa.debian.org/m/mlton.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">developer</a>) 
+</p>
+</li>
+    <li>
+<p>
+ <a class="external" href="http://www.freebsd.org/cgi/ports.cgi?query=mlton&amp;stype=all"><img src="moin-www.png" alt="[WWW]" height="11" width="11">FreeBSD</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a class="external" href="http://freshmeat.net/projects/mlton/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">freshmeat</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a class="external" href="http://www.freshports.org/lang/mlton/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">freshports</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a class="external" href="http://www.gnu.org/directory/all/mlton.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">GNU</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="http://www.icewalkers.com/">http://www.icewalkers.com/</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a class="external" href="http://en.wikipedia.org/wiki/MLton"><img src="moin-www.png" alt="[WWW]" height="11" width="11">wikipedi</a> 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-15 21:52:42 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Overloading
===================================================================
--- mlton/trunk/doc/guide/Overloading	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Overloading	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,159 @@
+<!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>Overloading - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Overloading
+    <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">
+In <a href="StandardML">Standard ML</a>, constants (like <tt>13</tt>, <tt>0w13</tt>, <tt>13.0</tt>) are overloaded, meaning that they can denote a constant of the appropriate type as determined by context.  SML defines the overloading classes Int, Real, and Word, which denote the sets of types that integer, real, and word constants may take on.  In MLton, these are defined as follows. 
+    <ul>
+
+
+<div>
+<table>
+ <tr>
+<td>
+ Int </td>
+<td>
+ <tt>Int2.int</tt>, <tt>Int3.int</tt>, ... <tt>Int32.int</tt>, <tt>Int64.int</tt>, <tt>LargeInt.int</tt>, <tt>IntInf.int</tt> </td>
+</tr>
+ <tr>
+<td>
+ Real </td>
+<td>
+ <tt>Real32.real</tt>, <tt>Real64.real</tt>, <tt>LargeReal.real</tt> </td>
+</tr>
+ <tr>
+<td>
+ Word </td>
+<td>
+ <tt>Word2.word</tt>, <tt>Word3.word</tt>, ... <tt>Word32.word</tt>, <tt>Word64.int</tt>, <tt>LargeWord.word</tt> </td>
+</tr>
+</table>
+</div>
+
+    </ul>
+
+
+<p>
+The <a href="DefinitionOfStandardML">Definition</a> allows flexibility in how much context is used to resolve overloading.  It says that the context is <em>no larger than the smallest enclosing structure-level declaration</em>, but that <em>an implementation may require that a smaller context determines the type</em>.  MLton uses the largest possible context allowed by SML in resolving overloading.  If the type of a constant is not determined by context, then it takes on a default type.  In MLton, these are defined as follows. 
+</p>
+
+    <ul>
+
+
+<div>
+<table>
+ <tr>
+<td>
+ Int </td>
+<td>
+ Int32.int </td>
+</tr>
+ <tr>
+<td>
+ Real </td>
+<td>
+ Real64.real </td>
+</tr>
+ <tr>
+<td>
+ Word </td>
+<td>
+ Word64.word </td>
+</tr>
+</table>
+</div>
+
+    </ul>
+
+
+<p>
+Other implementations may use a smaller context or different default types. 
+</p>
+<h2 id="head-a4bc8bf5caf54b18cea9f58e83dd4acb488deb17">Also see</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a class="external" href="http://mlton.org/basis/top-level-chapter.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">discussion of overloading in the SML Basis Library</a> 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-eb01bf04c9a0e8a71c45816513df424f1c7ffedb">Examples</h2>
+
+    <ul>
+
+    <li>
+<p>
+ The following program is rejected. 
+<pre class=code>
+<B><FONT COLOR="#0000FF">structure</FONT></B> S: 
+   <B><FONT COLOR="#0000FF">sig</FONT></B> 
+      <B><FONT COLOR="#A020F0">val</FONT></B> x: Word8.word 
+   <B><FONT COLOR="#0000FF">end</FONT></B> =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#A020F0">val</FONT></B> x = <B><FONT COLOR="#5F9EA0">0w0</FONT></B>
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+  The smallest enclosing structure declaration for <tt>0w0</tt> is   <tt>val&nbsp;x&nbsp;=&nbsp;0w0</tt>.  Hence, <tt>0w0</tt> receives the default type for  words, which is <tt>Word32.word</tt>. 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-28 21:55:49 by <span title="roam59-224.fas.harvard.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/PackedRepresentation
===================================================================
--- mlton/trunk/doc/guide/PackedRepresentation	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/PackedRepresentation	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,72 @@
+<!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>PackedRepresentation - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      PackedRepresentation
+    <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">
+An analysis pass for the <a href="SSA2">SSA2</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="ToRSSA">ToRSSA</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Analyzes a <a href="SSA2">SSA2</a> program to compute a packed representation for each object. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/backend/representation.sig?view=markup">representation.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/backend/packed-representation.fun?view=markup">packed-representation.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+<p>
+Has a special case to make sure that <tt>true</tt> is represented as <tt>1</tt> and <tt>false</tt> is represented as <tt>0</tt>. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:31:42 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/PageSize
===================================================================
--- mlton/trunk/doc/guide/PageSize	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/PageSize	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,673 @@
+<!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>PageSize - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      PageSize
+    <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">
+<p>
+List of all pages, sorted by their size: <ol>
+<li>
+<tt>&nbsp;17241 </tt><a href="References">References</a></li>
+<li>
+<tt>&nbsp;13891 </tt><a href="BasisLibrary">BasisLibrary</a></li>
+<li>
+<tt>&nbsp;11878 </tt><a href="Performance">Performance</a></li>
+<li>
+<tt>&nbsp;11333 </tt><a href="MLtonProcess">MLtonProcess</a></li>
+<li>
+<tt>&nbsp;11110 </tt><a href="CommonArg">CommonArg</a></li>
+<li>
+<tt>&nbsp;10762 </tt><a href="ConcurrentMLImplementation">ConcurrentMLImplementation</a></li>
+<li>
+<tt>&nbsp;&nbsp;8485 </tt><a href="ValueRestriction">ValueRestriction</a></li>
+<li>
+<tt>&nbsp;&nbsp;8291 </tt><a href="PrintfGentle">PrintfGentle</a></li>
+<li>
+<tt>&nbsp;&nbsp;8246 </tt><a href="SyntacticConventions">SyntacticConventions</a></li>
+<li>
+<tt>&nbsp;&nbsp;7972 </tt><a href="InfixingOperators">InfixingOperators</a></li>
+<li>
+<tt>&nbsp;&nbsp;7661 </tt><a href="http://mlton.org/StephenWeeks_2fMoinEditorBackup">StephenWeeks/MoinEditorBackup</a></li>
+<li>
+<tt>&nbsp;&nbsp;7621 </tt><a href="OptionalArguments">OptionalArguments</a></li>
+<li>
+<tt>&nbsp;&nbsp;7556 </tt><a href="CompileTimeOptions">CompileTimeOptions</a></li>
+<li>
+<tt>&nbsp;&nbsp;6716 </tt><a href="MLtonThread">MLtonThread</a></li>
+<li>
+<tt>&nbsp;&nbsp;6604 </tt><a href="SMLNJDeviations">SMLNJDeviations</a></li>
+<li>
+<tt>&nbsp;&nbsp;6422 </tt><a href="MLNLFFIImplementation">MLNLFFIImplementation</a></li>
+<li>
+<tt>&nbsp;&nbsp;6175 </tt><a href="http://mlton.org/VesaKarvonen_2fMoinEditorBackup">VesaKarvonen/MoinEditorBackup</a></li>
+<li>
+<tt>&nbsp;&nbsp;6122 </tt><a href="Bugs20041109">Bugs20041109</a></li>
+<li>
+<tt>&nbsp;&nbsp;6066 </tt><a href="FunctionalRecordUpdate">FunctionalRecordUpdate</a></li>
+<li>
+<tt>&nbsp;&nbsp;6036 </tt><a href="http://mlton.org/WesleyTerpstra_2fMoinEditorBackup">WesleyTerpstra/MoinEditorBackup</a></li>
+<li>
+<tt>&nbsp;&nbsp;5953 </tt><a href="PolymorphicEquality">PolymorphicEquality</a></li>
+<li>
+<tt>&nbsp;&nbsp;5938 </tt><a href="Elaborate">Elaborate</a></li>
+<li>
+<tt>&nbsp;&nbsp;5853 </tt><a href="AdmitsEquality">AdmitsEquality</a></li>
+<li>
+<tt>&nbsp;&nbsp;5830 </tt><a href="ForLoops">ForLoops</a></li>
+<li>
+<tt>&nbsp;&nbsp;5829 </tt><a href="PortingMLton">PortingMLton</a></li>
+<li>
+<tt>&nbsp;&nbsp;5758 </tt><a href="MLtonFinalizable">MLtonFinalizable</a></li>
+<li>
+<tt>&nbsp;&nbsp;5550 </tt><a href="MLtonSignal">MLtonSignal</a></li>
+<li>
+<tt>&nbsp;&nbsp;5280 </tt><a href="CompilationManager">CompilationManager</a></li>
+<li>
+<tt>&nbsp;&nbsp;5155 </tt><a href="XML">XML</a></li>
+<li>
+<tt>&nbsp;&nbsp;5093 </tt><a href="Features">Features</a></li>
+<li>
+<tt>&nbsp;&nbsp;5083 </tt><a href="MLtonStructure">MLtonStructure</a></li>
+<li>
+<tt>&nbsp;&nbsp;4914 </tt><a href="TypeChecking">TypeChecking</a></li>
+<li>
+<tt>&nbsp;&nbsp;4707 </tt><a href="Regions">Regions</a></li>
+<li>
+<tt>&nbsp;&nbsp;4690 </tt><a href="CallGraph">CallGraph</a></li>
+<li>
+<tt>&nbsp;&nbsp;4660 </tt><a href="MLBasisExamples">MLBasisExamples</a></li>
+<li>
+<tt>&nbsp;&nbsp;4469 </tt><a href="SMLNJLibrary">SMLNJLibrary</a></li>
+<li>
+<tt>&nbsp;&nbsp;4372 </tt><a href="TypeVariableScope">TypeVariableScope</a></li>
+<li>
+<tt>&nbsp;&nbsp;4357 </tt><a href="Credits">Credits</a></li>
+<li>
+<tt>&nbsp;&nbsp;4332 </tt><a href="SelfCompiling">SelfCompiling</a></li>
+<li>
+<tt>&nbsp;&nbsp;4238 </tt><a href="MLtonProfile">MLtonProfile</a></li>
+<li>
+<tt>&nbsp;&nbsp;3961 </tt><a href="UniversalType">UniversalType</a></li>
+<li>
+<tt>&nbsp;&nbsp;3560 </tt><a href="Printf">Printf</a></li>
+<li>
+<tt>&nbsp;&nbsp;3506 </tt><a href="EqualityTypeVariable">EqualityTypeVariable</a></li>
+<li>
+<tt>&nbsp;&nbsp;3501 </tt><a href="Enscript">Enscript</a></li>
+<li>
+<tt>&nbsp;&nbsp;3280 </tt><a href="Users">Users</a></li>
+<li>
+<tt>&nbsp;&nbsp;3274 </tt><a href="ForeignFunctionInterfaceTypes">ForeignFunctionInterfaceTypes</a></li>
+<li>
+<tt>&nbsp;&nbsp;3090 </tt><a href="RunTimeOptions">RunTimeOptions</a></li>
+<li>
+<tt>&nbsp;&nbsp;3026 </tt><a href="MLBasisSyntaxAndSemantics">MLBasisSyntaxAndSemantics</a></li>
+<li>
+<tt>&nbsp;&nbsp;2967 </tt><a href="FirstClassPolymorphism">FirstClassPolymorphism</a></li>
+<li>
+<tt>&nbsp;&nbsp;2949 </tt><a href="Monomorphise">Monomorphise</a></li>
+<li>
+<tt>&nbsp;&nbsp;2885 </tt><a href="HowProfilingWorks">HowProfilingWorks</a></li>
+<li>
+<tt>&nbsp;&nbsp;2821 </tt><a href="PropertyList">PropertyList</a></li>
+<li>
+<tt>&nbsp;&nbsp;2574 </tt><a href="CompilerOverview">CompilerOverview</a></li>
+<li>
+<tt>&nbsp;&nbsp;2558 </tt><a href="ForeignFunctionInterfaceSyntax">ForeignFunctionInterfaceSyntax</a></li>
+<li>
+<tt>&nbsp;&nbsp;2542 </tt><a href="UnresolvedBugs">UnresolvedBugs</a></li>
+<li>
+<tt>&nbsp;&nbsp;2493 </tt><a href="GenerativeException">GenerativeException</a></li>
+<li>
+<tt>&nbsp;&nbsp;2480 </tt><a href="CrossCompiling">CrossCompiling</a></li>
+<li>
+<tt>&nbsp;&nbsp;2455 </tt><a href="MatchCompile">MatchCompile</a></li>
+<li>
+<tt>&nbsp;&nbsp;2450 </tt><a href="http://mlton.org/ChrisClearwater_2fMoinEditorBackup">ChrisClearwater/MoinEditorBackup</a></li>
+<li>
+<tt>&nbsp;&nbsp;2378 </tt><a href="ShowBasis">ShowBasis</a></li>
+<li>
+<tt>&nbsp;&nbsp;2377 </tt><a href="CallingFromCToSML">CallingFromCToSML</a></li>
+<li>
+<tt>&nbsp;&nbsp;2355 </tt><a href="OCaml">OCaml</a></li>
+<li>
+<tt>&nbsp;&nbsp;2288 </tt><a href="MLBasisAnnotations">MLBasisAnnotations</a></li>
+<li>
+<tt>&nbsp;&nbsp;2288 </tt><a href="History">History</a></li>
+<li>
+<tt>&nbsp;&nbsp;2285 </tt><a href="http://mlton.org/Download">Download</a></li>
+<li>
+<tt>&nbsp;&nbsp;2271 </tt><a href="Installation">Installation</a></li>
+<li>
+<tt>&nbsp;&nbsp;2238 </tt><a href="MLtonPointer">MLtonPointer</a></li>
+<li>
+<tt>&nbsp;&nbsp;2198 </tt><a href="ProfilingTime">ProfilingTime</a></li>
+<li>
+<tt>&nbsp;&nbsp;2188 </tt><a href="RefFlatten">RefFlatten</a></li>
+<li>
+<tt>&nbsp;&nbsp;2125 </tt><a href="LanguageChanges">LanguageChanges</a></li>
+<li>
+<tt>&nbsp;&nbsp;2124 </tt><a href="MLBasisAnnotationExamples">MLBasisAnnotationExamples</a></li>
+<li>
+<tt>&nbsp;&nbsp;2106 </tt><a href="CKitLibrary">CKitLibrary</a></li>
+<li>
+<tt>&nbsp;&nbsp;2075 </tt><a href="ProfilingCounts">ProfilingCounts</a></li>
+<li>
+<tt>&nbsp;&nbsp;2045 </tt><a href="MLtonSocket">MLtonSocket</a></li>
+<li>
+<tt>&nbsp;&nbsp;1999 </tt><a href="Libraries">Libraries</a></li>
+<li>
+<tt>&nbsp;&nbsp;1982 </tt><a href="MLBasis">MLBasis</a></li>
+<li>
+<tt>&nbsp;&nbsp;1951 </tt><a href="SimplifyTypes">SimplifyTypes</a></li>
+<li>
+<tt>&nbsp;&nbsp;1923 </tt><a href="http://mlton.org/JesperLouisAndersen_2fMoinEditorBackup">JesperLouisAndersen/MoinEditorBackup</a></li>
+<li>
+<tt>&nbsp;&nbsp;1919 </tt><a href="WikiTool">WikiTool</a></li>
+<li>
+<tt>&nbsp;&nbsp;1893 </tt><a href="XMLShrink">XMLShrink</a></li>
+<li>
+<tt>&nbsp;&nbsp;1888 </tt><a href="FAQ">FAQ</a></li>
+<li>
+<tt>&nbsp;&nbsp;1880 </tt><a href="Defunctorize">Defunctorize</a></li>
+<li>
+<tt>&nbsp;&nbsp;1877 </tt><a href="Emacs">Emacs</a></li>
+<li>
+<tt>&nbsp;&nbsp;1851 </tt><a href="SMLofNJStructure">SMLofNJStructure</a></li>
+<li>
+<tt>&nbsp;&nbsp;1826 </tt><a href="DefineTypeBeforeUse">DefineTypeBeforeUse</a></li>
+<li>
+<tt>&nbsp;&nbsp;1814 </tt><a href="RunningOnNetBSD">RunningOnNetBSD</a></li>
+<li>
+<tt>&nbsp;&nbsp;1808 </tt><a href="CallingFromSMLToC">CallingFromSMLToC</a></li>
+<li>
+<tt>&nbsp;&nbsp;1795 </tt><a href="Overloading">Overloading</a></li>
+<li>
+<tt>&nbsp;&nbsp;1751 </tt><a href="JesperLouisAndersen">JesperLouisAndersen</a></li>
+<li>
+<tt>&nbsp;&nbsp;1719 </tt><a href="MLBasisAvailableLibraries">MLBasisAvailableLibraries</a></li>
+<li>
+<tt>&nbsp;&nbsp;1665 </tt><a href="CallingFromSMLToCFunctionPointer">CallingFromSMLToCFunctionPointer</a></li>
+<li>
+<tt>&nbsp;&nbsp;1628 </tt><a href="SSA2">SSA2</a></li>
+<li>
+<tt>&nbsp;&nbsp;1596 </tt><a href="MLtonSyslog">MLtonSyslog</a></li>
+<li>
+<tt>&nbsp;&nbsp;1539 </tt><a href="MLBasisPathMap">MLBasisPathMap</a></li>
+<li>
+<tt>&nbsp;&nbsp;1491 </tt><a href="ScopeInference">ScopeInference</a></li>
+<li>
+<tt>&nbsp;&nbsp;1475 </tt><a href="Shrink">Shrink</a></li>
+<li>
+<tt>&nbsp;&nbsp;1460 </tt><a href="MLtonWorld">MLtonWorld</a></li>
+<li>
+<tt>&nbsp;&nbsp;1452 </tt><a href="Zone">Zone</a></li>
+<li>
+<tt>&nbsp;&nbsp;1447 </tt><a href="MLtonRlimit">MLtonRlimit</a></li>
+<li>
+<tt>&nbsp;&nbsp;1442 </tt><a href="Contact">Contact</a></li>
+<li>
+<tt>&nbsp;&nbsp;1439 </tt><a href="EqualityType">EqualityType</a></li>
+<li>
+<tt>&nbsp;&nbsp;1432 </tt><a href="ProductType">ProductType</a></li>
+<li>
+<tt>&nbsp;&nbsp;1423 </tt><a href="Experimental">Experimental</a></li>
+<li>
+<tt>&nbsp;&nbsp;1417 </tt><a href="KnownCase">KnownCase</a></li>
+<li>
+<tt>&nbsp;&nbsp;1412 </tt><a href="SSA">SSA</a></li>
+<li>
+<tt>&nbsp;&nbsp;1411 </tt><a href="Sources">Sources</a></li>
+<li>
+<tt>&nbsp;&nbsp;1389 </tt><a href="LocalRef">LocalRef</a></li>
+<li>
+<tt>&nbsp;&nbsp;1377 </tt><a href="RunningOnCygwin">RunningOnCygwin</a></li>
+<li>
+<tt>&nbsp;&nbsp;1364 </tt><a href="ConcurrentML">ConcurrentML</a></li>
+<li>
+<tt>&nbsp;&nbsp;1318 </tt><a href="TypeConstructor">TypeConstructor</a></li>
+<li>
+<tt>&nbsp;&nbsp;1314 </tt><a href="http://mlton.org/Preferences">Preferences</a></li>
+<li>
+<tt>&nbsp;&nbsp;1312 </tt><a href="ProfilingAllocation">ProfilingAllocation</a></li>
+<li>
+<tt>&nbsp;&nbsp;1311 </tt><a href="Projects">Projects</a></li>
+<li>
+<tt>&nbsp;&nbsp;1288 </tt><a href="ToMachine">ToMachine</a></li>
+<li>
+<tt>&nbsp;&nbsp;1219 </tt><a href="ManualPage">ManualPage</a></li>
+<li>
+<tt>&nbsp;&nbsp;1209 </tt><a href="WebSite">WebSite</a></li>
+<li>
+<tt>&nbsp;&nbsp;1207 </tt><a href="ProfilingTheStack">ProfilingTheStack</a></li>
+<li>
+<tt>&nbsp;&nbsp;1206 </tt><a href="StandardMLPortability">StandardMLPortability</a></li>
+<li>
+<tt>&nbsp;&nbsp;1206 </tt><a href="Restore">Restore</a></li>
+<li>
+<tt>&nbsp;&nbsp;1203 </tt><a href="Useless">Useless</a></li>
+<li>
+<tt>&nbsp;&nbsp;1182 </tt><a href="ImplementSuffix">ImplementSuffix</a></li>
+<li>
+<tt>&nbsp;&nbsp;1139 </tt><a href="SSASimplify">SSASimplify</a></li>
+<li>
+<tt>&nbsp;&nbsp;1127 </tt><a href="MLtonPlatform">MLtonPlatform</a></li>
+<li>
+<tt>&nbsp;&nbsp;1121 </tt><a href="MLtonCont">MLtonCont</a></li>
+<li>
+<tt>&nbsp;&nbsp;1116 </tt><a href="Lazy">Lazy</a></li>
+<li>
+<tt>&nbsp;&nbsp;1103 </tt><a href="Closure">Closure</a></li>
+<li>
+<tt>&nbsp;&nbsp;1097 </tt><a href="MLtonIO">MLtonIO</a></li>
+<li>
+<tt>&nbsp;&nbsp;1096 </tt><a href="MLtonRandom">MLtonRandom</a></li>
+<li>
+<tt>&nbsp;&nbsp;1088 </tt><a href="CommonBlock">CommonBlock</a></li>
+<li>
+<tt>&nbsp;&nbsp;1086 </tt><a href="LambdaFree">LambdaFree</a></li>
+<li>
+<tt>&nbsp;&nbsp;1044 </tt><a href="WikiMacros">WikiMacros</a></li>
+<li>
+<tt>&nbsp;&nbsp;1040 </tt><a href="RSSA">RSSA</a></li>
+<li>
+<tt>&nbsp;&nbsp;1034 </tt><a href="SXML">SXML</a></li>
+<li>
+<tt>&nbsp;&nbsp;1002 </tt><a href="http://mlton.org/WikiSandBox">WikiSandBox</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;998 </tt><a href="WholeProgramOptimization">WholeProgramOptimization</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;964 </tt><a href="MLtonIntInf">MLtonIntInf</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;954 </tt><a href="CommonSubexp">CommonSubexp</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;949 </tt><a href="DeadCode">DeadCode</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;946 </tt><a href="UnsafeStructure">UnsafeStructure</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;940 </tt><a href="Identifier">Identifier</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;907 </tt><a href="PolyEqual">PolyEqual</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;891 </tt><a href="MLtonExn">MLtonExn</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;863 </tt><a href="RemoveUnused">RemoveUnused</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;860 </tt><a href="MLtonGC">MLtonGC</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;853 </tt><a href="StandardML">StandardML</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;847 </tt><a href="MLtonWeak">MLtonWeak</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;836 </tt><a href="GnuMP">GnuMP</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;835 </tt><a href="VesaKarvonen">VesaKarvonen</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;827 </tt><a href="SXMLSimplify">SXMLSimplify</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;826 </tt><a href="LineDirective">LineDirective</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;823 </tt><a href="Flatten">Flatten</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;813 </tt><a href="SSA2Simplify">SSA2Simplify</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;784 </tt><a href="WesleyTerpstra">WesleyTerpstra</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;784 </tt><a href="TalkMLtonHistory">TalkMLtonHistory</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;757 </tt><a href="GenerativeDatatype">GenerativeDatatype</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;752 </tt><a href="XMLSimplifyTypes">XMLSimplifyTypes</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;751 </tt><a href="Profiling">Profiling</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;748 </tt><a href="RunningOnSparc">RunningOnSparc</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;736 </tt><a href="Inline">Inline</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;721 </tt><a href="RayRacine">RayRacine</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;709 </tt><a href="Contify">Contify</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;707 </tt><a href="Documentation">Documentation</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;700 </tt><a href="License">License</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;686 </tt><a href="http://mlton.org/RayRacine_2fMoinEditorBackup">RayRacine/MoinEditorBackup</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;680 </tt><a href="GarbageCollection">GarbageCollection</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;676 </tt><a href="RSSASimplify">RSSASimplify</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;672 </tt><a href="RunningOnSolaris">RunningOnSolaris</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;670 </tt><a href="Drawbacks">Drawbacks</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;665 </tt><a href="Redundant">Redundant</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;664 </tt><a href="AST">AST</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;662 </tt><a href="mGTK">mGTK</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;660 </tt><a href="http://mlton.org/SureshJagannathan_2fMoinEditorBackup">SureshJagannathan/MoinEditorBackup</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;659 </tt><a href="IntroduceLoops">IntroduceLoops</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;645 </tt><a href="EditingPages">EditingPages</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;644 </tt><a href="CompilerPassTemplate">CompilerPassTemplate</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;615 </tt><a href="OpenGL">OpenGL</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;614 </tt><a href="StandardMLBooks">StandardMLBooks</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;610 </tt><a href="ReleaseChecklist">ReleaseChecklist</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;608 </tt><a href="ToSSA2">ToSSA2</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;607 </tt><a href="XMLSimplify">XMLSimplify</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;596 </tt><a href="Swerve">Swerve</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;590 </tt><a href="DefinitionOfStandardML">DefinitionOfStandardML</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;589 </tt><a href="RunningOnMinGW">RunningOnMinGW</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;586 </tt><a href="MLtonRusage">MLtonRusage</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;583 </tt><a href="http://mlton.org/MichaelNorrish_2fMoinEditorBackup">MichaelNorrish/MoinEditorBackup</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;571 </tt><a href="Developers">Developers</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;570 </tt><a href="ForeignFunctionInterface">ForeignFunctionInterface</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;564 </tt><a href="Machine">Machine</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;551 </tt><a href="SureshJagannathan">SureshJagannathan</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;547 </tt><a href="FrontEnd">FrontEnd</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;531 </tt><a href="RedundantTests">RedundantTests</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;527 </tt><a href="Multi">Multi</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;523 </tt><a href="RunningOnOpenBSD">RunningOnOpenBSD</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;523 </tt><a href="Bug">Bug</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;521 </tt><a href="IntermediateLanguage">IntermediateLanguage</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;520 </tt><a href="OtherSites">OtherSites</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;505 </tt><a href="SMLNJ">SMLNJ</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;505 </tt><a href="CreatingPages">CreatingPages</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;499 </tt><a href="PhantomType">PhantomType</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;495 </tt><a href="AccessControl">AccessControl</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;481 </tt><a href="ClosureConvert">ClosureConvert</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;480 </tt><a href="MichaelNorrish">MichaelNorrish</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;475 </tt><a href="DeepFlatten">DeepFlatten</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;463 </tt><a href="Chunkify">Chunkify</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;454 </tt><a href="MLtonItimer">MLtonItimer</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;450 </tt><a href="StandardMLImplementations">StandardMLImplementations</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;448 </tt><a href="CoreML">CoreML</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;447 </tt><a href="PlatformSpecificNotes">PlatformSpecificNotes</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;443 </tt><a href="PackedRepresentation">PackedRepresentation</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;436 </tt><a href="LoopInvariant">LoopInvariant</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;426 </tt><a href="RSSAShrink">RSSAShrink</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;426 </tt><a href="MatthewFluet">MatthewFluet</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;414 </tt><a href="MLNLFFI">MLNLFFI</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;412 </tt><a href="LocalFlatten">LocalFlatten</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;412 </tt><a href="StandardMLTutorials">StandardMLTutorials</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;410 </tt><a href="http://mlton.org/AndreiFormiga_2fMoinEditorBackup">AndreiFormiga/MoinEditorBackup</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;409 </tt><a href="Globalize">Globalize</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;405 </tt><a href="ConstantPropagation">ConstantPropagation</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;400 </tt><a href="http://mlton.org/RecentChanges">RecentChanges</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;400 </tt><a href="TalkStandardML">TalkStandardML</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;397 </tt><a href="TalkMLtonFeatures">TalkMLtonFeatures</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;379 </tt><a href="Home">Home</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;371 </tt><a href="MLtonWord">MLtonWord</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;369 </tt><a href="TalkWholeProgram">TalkWholeProgram</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;369 </tt><a href="OperatorPrecedence">OperatorPrecedence</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;368 </tt><a href="MLtonProcEnv">MLtonProcEnv</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;361 </tt><a href="ObjectOrientedProgramming">ObjectOrientedProgramming</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;359 </tt><a href="Development">Development</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;354 </tt><a href="RunningOnPowerPC">RunningOnPowerPC</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;353 </tt><a href="PrecedenceParse">PrecedenceParse</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;351 </tt><a href="Polyvariance">Polyvariance</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;351 </tt><a href="RunningOnFreeBSD">RunningOnFreeBSD</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;340 </tt><a href="MatchCompilation">MatchCompilation</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;337 </tt><a href="ToRSSA">ToRSSA</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;336 </tt><a href="ParallelMove">ParallelMove</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;329 </tt><a href="ImperativeTypeVariable">ImperativeTypeVariable</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;323 </tt><a href="SXMLShrink">SXMLShrink</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;321 </tt><a href="MLtonVector">MLtonVector</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;318 </tt><a href="MLtonArray">MLtonArray</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;314 </tt><a href="http://mlton.org/HenryCejtin_2fMoinEditorBackup">HenryCejtin/MoinEditorBackup</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;309 </tt><a href="AndreiFormiga">AndreiFormiga</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;306 </tt><a href="TalkMLtonApproach">TalkMLtonApproach</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;305 </tt><a href="ImplementHandlers">ImplementHandlers</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;296 </tt><a href="http://mlton.org/MatthewFluet_2fMoinEditorBackup">MatthewFluet/MoinEditorBackup</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;291 </tt><a href="AllocateRegisters">AllocateRegisters</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;286 </tt><a href="ImplementProfiling">ImplementProfiling</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;279 </tt><a href="ImplementExceptions">ImplementExceptions</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;278 </tt><a href="Eclipse">Eclipse</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;277 </tt><a href="TalkFolkLore">TalkFolkLore</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;270 </tt><a href="TalkHowHigherOrder">TalkHowHigherOrder</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;267 </tt><a href="InsertSignalChecks">InsertSignalChecks</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;265 </tt><a href="ML">ML</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;265 </tt><a href="InsertLimitChecks">InsertLimitChecks</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;263 </tt><a href="Subversion">Subversion</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;262 </tt><a href="Pronounce">Pronounce</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;261 </tt><a href="MLj">MLj</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;257 </tt><a href="SMLNET">SMLNET</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;254 </tt><a href="StandardMLHistory">StandardMLHistory</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;244 </tt><a href="TalkFromSMLTo">TalkFromSMLTo</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;242 </tt><a href="TalkHowPolymorphism">TalkHowPolymorphism</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;241 </tt><a href="HaMLet">HaMLet</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;234 </tt><a href="EXene">EXene</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;230 </tt><a href="Immutable">Immutable</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;230 </tt><a href="TalkHowModules">TalkHowModules</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;220 </tt><a href="CoreMLSimplify">CoreMLSimplify</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;218 </tt><a href="MoscowML">MoscowML</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;217 </tt><a href="HenryCejtin">HenryCejtin</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;211 </tt><a href="http://mlton.org/TemporaryUpload">TemporaryUpload</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;201 </tt><a href="Serialization">Serialization</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;200 </tt><a href="Talk">Talk</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;196 </tt><a href="MoinMoin">MoinMoin</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;186 </tt><a href="Variant">Variant</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;184 </tt><a href="SpaceSafety">SpaceSafety</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;184 </tt><a href="ZZZOrphanedPages">ZZZOrphanedPages</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;176 </tt><a href="StephenWeeks">StephenWeeks</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;175 </tt><a href="JohnnyAndersen">JohnnyAndersen</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;174 </tt><a href="WikiName">WikiName</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;167 </tt><a href="TalkDiveIn">TalkDiveIn</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;165 </tt><a href="Mutable">Mutable</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;161 </tt><a href="RunningOnDarwin">RunningOnDarwin</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;160 </tt><a href="MLtonTextIO">MLtonTextIO</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;157 </tt><a href="MLtonBinIO">MLtonBinIO</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;152 </tt><a href="StyleGuide">StyleGuide</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;151 </tt><a href="Unicode">Unicode</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;136 </tt><a href="Survey">Survey</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;136 </tt><a href="TalkTemplate">TalkTemplate</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;125 </tt><a href="WantedPages">WantedPages</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;118 </tt><a href="Alice">Alice</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;112 </tt><a href="MikeThomas">MikeThomas</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;106 </tt><a href="MLKit">MLKit</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;103 </tt><a href="TILT">TILT</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;100 </tt><a href="TrustedGroup">TrustedGroup</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;&nbsp;90 </tt><a href="PolyML">PolyML</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;&nbsp;86 </tt><a href="http://mlton.org/OldPages">OldPages</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;&nbsp;78 </tt><a href="OrphanedPages">OrphanedPages</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;&nbsp;69 </tt><a href="PageSize">PageSize</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;&nbsp;46 </tt><a href="RunningOnLinux">RunningOnLinux</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;&nbsp;45 </tt><a href="SurveyDone">SurveyDone</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;&nbsp;31 </tt><a href="ChrisClearwater">ChrisClearwater</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;&nbsp;30 </tt><a href="SystemInfo">SystemInfo</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;&nbsp;23 </tt><a href="UserGuide">UserGuide</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;&nbsp;21 </tt><a href="http://mlton.org/TemporaryBugExamples">TemporaryBugExamples</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;&nbsp;20 </tt><a href="Papers">Papers</a></li>
+<li>
+<tt>&nbsp;&nbsp;&nbsp;&nbsp;15 </tt><a href="Index">Index</a></li>
+</ol>
+
+ 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+(last modified 2004-10-25 16:35:07)
+</body></html>

Added: mlton/trunk/doc/guide/Papers
===================================================================
--- mlton/trunk/doc/guide/Papers	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Papers	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,61 @@
+<!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>Papers - 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">
+
+
+<link rel="Appendix" title="00-esop.ps.gz" href="http://mlton.org/pages/Papers/attachments/00-esop.ps.gz">
+<link rel="Appendix" title="01-icfp.ps.gz" href="http://mlton.org/pages/Papers/attachments/01-icfp.ps.gz">
+</head>
+
+<body lang="en" dir="ltr">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Papers
+    <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">
+See <a href="References">References</a>. </div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-05 18:51:41 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/ParallelMove
===================================================================
--- mlton/trunk/doc/guide/ParallelMove	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/ParallelMove	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,69 @@
+<!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>ParallelMove - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      ParallelMove
+    <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">
+A rewrite pass, agnostic in the <a href="IntermediateLanguage">IntermediateLanguage</a> which it producs. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Computes a sequence of individual moves to effect a parallel move (with possibly overlapping froms and tos). 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/backend/parallel-move.sig?view=markup">parallel-move.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/backend/parallel-move.fun?view=markup">parallel-move.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:31:29 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Performance
===================================================================
--- mlton/trunk/doc/guide/Performance	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Performance	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,2020 @@
+<!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>Performance - 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">
+
+
+<link rel="Appendix" title="DLXSimulator.sml" href="http://mlton.org/pages/Performance/attachments/DLXSimulator.sml">
+<link rel="Appendix" title="barnes-hut.sml" href="http://mlton.org/pages/Performance/attachments/barnes-hut.sml">
+<link rel="Appendix" title="boyer.sml" href="http://mlton.org/pages/Performance/attachments/boyer.sml">
+<link rel="Appendix" title="checksum.sml" href="http://mlton.org/pages/Performance/attachments/checksum.sml">
+<link rel="Appendix" title="chess.gml" href="http://mlton.org/pages/Performance/attachments/chess.gml">
+<link rel="Appendix" title="count-graphs.sml" href="http://mlton.org/pages/Performance/attachments/count-graphs.sml">
+<link rel="Appendix" title="fft.sml" href="http://mlton.org/pages/Performance/attachments/fft.sml">
+<link rel="Appendix" title="fib.sml" href="http://mlton.org/pages/Performance/attachments/fib.sml">
+<link rel="Appendix" title="flat-array.sml" href="http://mlton.org/pages/Performance/attachments/flat-array.sml">
+<link rel="Appendix" title="fxp.sml" href="http://mlton.org/pages/Performance/attachments/fxp.sml">
+<link rel="Appendix" title="hamlet-input.sml" href="http://mlton.org/pages/Performance/attachments/hamlet-input.sml">
+<link rel="Appendix" title="hamlet.sml" href="http://mlton.org/pages/Performance/attachments/hamlet.sml">
+<link rel="Appendix" title="hello.sml" href="http://mlton.org/pages/Performance/attachments/hello.sml">
+<link rel="Appendix" title="imp-for.sml" href="http://mlton.org/pages/Performance/attachments/imp-for.sml">
+<link rel="Appendix" title="knuth-bendix.sml" href="http://mlton.org/pages/Performance/attachments/knuth-bendix.sml">
+<link rel="Appendix" title="lexgen.sml" href="http://mlton.org/pages/Performance/attachments/lexgen.sml">
+<link rel="Appendix" title="life.sml" href="http://mlton.org/pages/Performance/attachments/life.sml">
+<link rel="Appendix" title="logic.sml" href="http://mlton.org/pages/Performance/attachments/logic.sml">
+<link rel="Appendix" title="mandelbrot.sml" href="http://mlton.org/pages/Performance/attachments/mandelbrot.sml">
+<link rel="Appendix" title="matrix-multiply.sml" href="http://mlton.org/pages/Performance/attachments/matrix-multiply.sml">
+<link rel="Appendix" title="md5.sml" href="http://mlton.org/pages/Performance/attachments/md5.sml">
+<link rel="Appendix" title="merge.sml" href="http://mlton.org/pages/Performance/attachments/merge.sml">
+<link rel="Appendix" title="ml.grm" href="http://mlton.org/pages/Performance/attachments/ml.grm">
+<link rel="Appendix" title="ml.lex" href="http://mlton.org/pages/Performance/attachments/ml.lex">
+<link rel="Appendix" title="mlyacc.sml" href="http://mlton.org/pages/Performance/attachments/mlyacc.sml">
+<link rel="Appendix" title="model-elimination.sml" href="http://mlton.org/pages/Performance/attachments/model-elimination.sml">
+<link rel="Appendix" title="mpuz.sml" href="http://mlton.org/pages/Performance/attachments/mpuz.sml">
+<link rel="Appendix" title="ndotprod.s" href="http://mlton.org/pages/Performance/attachments/ndotprod.s">
+<link rel="Appendix" title="nucleic.sml" href="http://mlton.org/pages/Performance/attachments/nucleic.sml">
+<link rel="Appendix" title="output1.sml" href="http://mlton.org/pages/Performance/attachments/output1.sml">
+<link rel="Appendix" title="peek.sml" href="http://mlton.org/pages/Performance/attachments/peek.sml">
+<link rel="Appendix" title="psdes-random.sml" href="http://mlton.org/pages/Performance/attachments/psdes-random.sml">
+<link rel="Appendix" title="ratio-regions.sml" href="http://mlton.org/pages/Performance/attachments/ratio-regions.sml">
+<link rel="Appendix" title="ray" href="http://mlton.org/pages/Performance/attachments/ray">
+<link rel="Appendix" title="ray.sml" href="http://mlton.org/pages/Performance/attachments/ray.sml">
+<link rel="Appendix" title="raytrace.sml" href="http://mlton.org/pages/Performance/attachments/raytrace.sml">
+<link rel="Appendix" title="simple.sml" href="http://mlton.org/pages/Performance/attachments/simple.sml">
+<link rel="Appendix" title="smith-normal-form.sml" href="http://mlton.org/pages/Performance/attachments/smith-normal-form.sml">
+<link rel="Appendix" title="tailfib.sml" href="http://mlton.org/pages/Performance/attachments/tailfib.sml">
+<link rel="Appendix" title="tak.sml" href="http://mlton.org/pages/Performance/attachments/tak.sml">
+<link rel="Appendix" title="tensor.sml" href="http://mlton.org/pages/Performance/attachments/tensor.sml">
+<link rel="Appendix" title="tsp.sml" href="http://mlton.org/pages/Performance/attachments/tsp.sml">
+<link rel="Appendix" title="tyan.sml" href="http://mlton.org/pages/Performance/attachments/tyan.sml">
+<link rel="Appendix" title="vector-concat.sml" href="http://mlton.org/pages/Performance/attachments/vector-concat.sml">
+<link rel="Appendix" title="vector-rev.sml" href="http://mlton.org/pages/Performance/attachments/vector-rev.sml">
+<link rel="Appendix" title="vliw.sml" href="http://mlton.org/pages/Performance/attachments/vliw.sml">
+<link rel="Appendix" title="wc-input1.sml" href="http://mlton.org/pages/Performance/attachments/wc-input1.sml">
+<link rel="Appendix" title="wc-scanStream.sml" href="http://mlton.org/pages/Performance/attachments/wc-scanStream.sml">
+<link rel="Appendix" title="zebra.sml" href="http://mlton.org/pages/Performance/attachments/zebra.sml">
+<link rel="Appendix" title="zern.sml" href="http://mlton.org/pages/Performance/attachments/zern.sml">
+</head>
+
+<body lang="en" dir="ltr">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Performance
+    <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 class="external" href="http://shootout.alioth.debian.org/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Computer Language Shootout</a> has a <a class="external" href="http://shootout.alioth.debian.org/benchmark.php?test=all&amp;lang=all&amp;sort=cpu"><img src="moin-www.png" alt="[WWW]" height="11" width="11">performance comparison</a> of many different languages, including  <a class="external" href="http://shootout.alioth.debian.org/benchmark.php?test=all&amp;lang=mlton&amp;sort=cpu"><img src="moin-www.png" alt="[WWW]" height="11" width="11">MLton</a>. <p>
+This page compares the performance of the following SML compilers on a range of benchmarks. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="Home">MLton</a> 20041109 
+</p>
+</li>
+    <li>
+<p>
+ <a href="MLKit">ML Kit</a> 4.1.1 
+</p>
+</li>
+    <li>
+<p>
+ <a href="MoscowML">Moscow ML</a> 2.00 
+</p>
+</li>
+    <li>
+<p>
+ <a href="PolyML">Poly/ML</a> 4.1.3 
+</p>
+</li>
+    <li>
+<p>
+ <a href="SMLNJ">SML/NJ</a> 110.49 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+There are tables for <a href="#RunTime">run time</a>, <a href="#CompileTime">compile time</a>, and <a href="#CodeSize">code size</a>. 
+</p>
+<h2 id="head-cdd7bb2816b7a8f88bce0e47be39943bc369516b">Setup</h2>
+<p>
+All benchmarks were compiled and run on a 1.6 GHz dual Athlon with 4G of RAM.  The benchmarks were compiled with the default settings for all the compilers, except for Moscow ML, which was passed the <tt>-orthodox&nbsp;-standalone&nbsp;-toplevel</tt> switches.  The Poly/ML executables were produced by <tt>use</tt>ing the file, followed by a <tt>PolyML.commit</tt>.  The SML/NJ executables were produced by wrapping the entire program in a <tt>local</tt> declaration whose body performs an <tt>SMLofNJ.exportFn</tt>. 
+</p>
+<p>
+For more details, or if you want to run the benchmarks yourself, please see the <tt>benchmark</tt> directory of the MLton <a href="Sources">Sources</a>. 
+</p>
+<p>
+All of the benchmarks are available for download from this page.  Some of the benchmarks were obtained from the SML/NJ benchmark suite.  Some of the benchmarks expect certain input files to exist in the <tt>DATA</tt> subdirectory. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="http://mlton.org/pages/Performance/attachments/hamlet.sml">hamlet.sml</a> (<a href="http://mlton.org/pages/Performance/attachments/hamlet-input.sml">hamlet-input.sml</a>) 
+</p>
+</li>
+    <li>
+<p>
+ <a href="http://mlton.org/pages/Performance/attachments/ray.sml">ray.sml</a> (<a href="http://mlton.org/pages/Performance/attachments/ray">ray</a>) 
+</p>
+</li>
+    <li>
+<p>
+ <a href="http://mlton.org/pages/Performance/attachments/raytrace.sml">raytrace.sml</a> (<a href="http://mlton.org/pages/Performance/attachments/chess.gml">chess.gml</a>) 
+</p>
+</li>
+    <li>
+<p>
+ <a href="http://mlton.org/pages/Performance/attachments/vliw.sml">vliw.sml</a> (<a href="http://mlton.org/pages/Performance/attachments/ndotprod.s">ndotprod.s</a>) 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-0d8c3c34477c6b6a2354e16ff6f963d5d82b8d18">Run-time ratio</h2>
+<a id="RunTime"></a> <p>
+The following table gives the ratio of the run time of each benchmark when compiled by another compiler to the run time when compiled by MLton.  That is, the larger the number, the slower the generated code runs.  A number larger than one indicates that the corresponding compiler produces code that runs more slowly than MLton.  If an entry is *, that means that the corresponding compiler failed to compile the benchmark or that the benchmark failed to run. 
+</p>
+
+<div>
+<table>
+<tr>
+<td>
+benchmark</td>
+<td>
+MLton</td>
+<td>
+ML-Kit</td>
+<td>
+Moscow-ML</td>
+<td>
+Poly/ML</td>
+<td>
+SML/NJ</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/barnes-hut.sml">barnes-hut</a></td>
+<td>
+1.0</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+1.1</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/boyer.sml">boyer</a></td>
+<td>
+1.0</td>
+<td>
+*</td>
+<td>
+9.0</td>
+<td>
+2.3</td>
+<td>
+3.0</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/checksum.sml">checksum</a></td>
+<td>
+1.0</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+*</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/count-graphs.sml">count-graphs</a></td>
+<td>
+1.0</td>
+<td>
+7.6</td>
+<td>
+44.6</td>
+<td>
+7.8</td>
+<td>
+2.9</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/DLXSimulator.sml">DLXSimulator</a></td>
+<td>
+1.0</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+*</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/fft.sml">fft</a></td>
+<td>
+1.0</td>
+<td>
+2.7</td>
+<td>
+*</td>
+<td>
+46.4</td>
+<td>
+1.0</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/fib.sml">fib</a></td>
+<td>
+1.0</td>
+<td>
+1.3</td>
+<td>
+5.4</td>
+<td>
+1.0</td>
+<td>
+1.3</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/flat-array.sml">flat-array</a></td>
+<td>
+1.0</td>
+<td>
+1.4</td>
+<td>
+10.8</td>
+<td>
+130.1</td>
+<td>
+4.2</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/hamlet.sml">hamlet</a></td>
+<td>
+1.0</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+2.2</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/imp-for.sml">imp-for</a></td>
+<td>
+1.0</td>
+<td>
+4.2</td>
+<td>
+66.1</td>
+<td>
+10.7</td>
+<td>
+6.0</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/knuth-bendix.sml">knuth-bendix</a></td>
+<td>
+1.0</td>
+<td>
+*</td>
+<td>
+18.6</td>
+<td>
+8.5</td>
+<td>
+3.6</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/lexgen.sml">lexgen</a></td>
+<td>
+1.0</td>
+<td>
+2.2</td>
+<td>
+6.2</td>
+<td>
+2.1</td>
+<td>
+1.7</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/life.sml">life</a></td>
+<td>
+1.0</td>
+<td>
+2.8</td>
+<td>
+25.9</td>
+<td>
+10.2</td>
+<td>
+1.5</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/logic.sml">logic</a></td>
+<td>
+1.0</td>
+<td>
+*</td>
+<td>
+6.6</td>
+<td>
+1.5</td>
+<td>
+1.1</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/mandelbrot.sml">mandelbrot</a></td>
+<td>
+1.0</td>
+<td>
+13.9</td>
+<td>
+45.5</td>
+<td>
+71.3</td>
+<td>
+1.5</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/matrix-multiply.sml">matrix-multiply</a></td>
+<td>
+1.0</td>
+<td>
+5.3</td>
+<td>
+49.7</td>
+<td>
+16.0</td>
+<td>
+5.2</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/md5.sml">md5</a></td>
+<td>
+1.0</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+*</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/merge.sml">merge</a></td>
+<td>
+1.0</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+1.5</td>
+<td>
+5.8</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/mlyacc.sml">mlyacc</a></td>
+<td>
+1.0</td>
+<td>
+*</td>
+<td>
+6.2</td>
+<td>
+1.3</td>
+<td>
+1.4</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/model-elimination.sml">model-elimination</a></td>
+<td>
+1.0</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+1.7</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/mpuz.sml">mpuz</a></td>
+<td>
+1.0</td>
+<td>
+2.5</td>
+<td>
+53.3</td>
+<td>
+5.5</td>
+<td>
+3.4</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/nucleic.sml">nucleic</a></td>
+<td>
+1.0</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+22.9</td>
+<td>
+0.6</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/output1.sml">output1</a></td>
+<td>
+1.0</td>
+<td>
+20.9</td>
+<td>
+33.2</td>
+<td>
+3.1</td>
+<td>
+7.2</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/peek.sml">peek</a></td>
+<td>
+1.0</td>
+<td>
+21.5</td>
+<td>
+127.2</td>
+<td>
+20.8</td>
+<td>
+15.7</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/psdes-random.sml">psdes-random</a></td>
+<td>
+1.0</td>
+<td>
+7.7</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+3.4</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/ratio-regions.sml">ratio-regions</a></td>
+<td>
+1.0</td>
+<td>
+2.2</td>
+<td>
+25.7</td>
+<td>
+2.8</td>
+<td>
+4.8</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/ray.sml">ray</a></td>
+<td>
+1.0</td>
+<td>
+*</td>
+<td>
+22.4</td>
+<td>
+35.8</td>
+<td>
+1.4</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/raytrace.sml">raytrace</a></td>
+<td>
+1.0</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+2.8</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/simple.sml">simple</a></td>
+<td>
+1.0</td>
+<td>
+1.9</td>
+<td>
+14.4</td>
+<td>
+7.4</td>
+<td>
+1.6</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/smith-normal-form.sml">smith-normal-form</a></td>
+<td>
+1.0</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+<a href="#snf-note">&gt;3000</a></td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/tailfib.sml">tailfib</a></td>
+<td>
+1.0</td>
+<td>
+1.3</td>
+<td>
+35.5</td>
+<td>
+2.4</td>
+<td>
+2.4</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/tak.sml">tak</a></td>
+<td>
+1.0</td>
+<td>
+2.4</td>
+<td>
+9.6</td>
+<td>
+0.8</td>
+<td>
+1.6</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/tensor.sml">tensor</a></td>
+<td>
+1.0</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+15.6</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/tsp.sml">tsp</a></td>
+<td>
+1.0</td>
+<td>
+3.4</td>
+<td>
+25.9</td>
+<td>
+*</td>
+<td>
+56.7</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/tyan.sml">tyan</a></td>
+<td>
+1.0</td>
+<td>
+*</td>
+<td>
+14.0</td>
+<td>
+1.6</td>
+<td>
+0.9</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/vector-concat.sml">vector-concat</a></td>
+<td>
+1.0</td>
+<td>
+1.7</td>
+<td>
+16.4</td>
+<td>
+1.7</td>
+<td>
+9.6</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/vector-rev.sml">vector-rev</a></td>
+<td>
+1.0</td>
+<td>
+2.1</td>
+<td>
+21.8</td>
+<td>
+3.0</td>
+<td>
+73.0</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/vliw.sml">vliw</a></td>
+<td>
+1.0</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+1.3</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/wc-input1.sml">wc-input1</a></td>
+<td>
+1.0</td>
+<td>
+14.8</td>
+<td>
+*</td>
+<td>
+6.6</td>
+<td>
+8.7</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/wc-scanStream.sml">wc-scanStream</a></td>
+<td>
+1.0</td>
+<td>
+21.4</td>
+<td>
+*</td>
+<td>
+352.5</td>
+<td>
+9.4</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/zebra.sml">zebra</a></td>
+<td>
+1.0</td>
+<td>
+7.0</td>
+<td>
+30.6</td>
+<td>
+7.2</td>
+<td>
+8.6</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/zern.sml">zern</a></td>
+<td>
+1.0</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+2.8</td>
+</tr>
+</table>
+</div>
+<p>
+<a id="snf-note"></a> Note: for SML/NJ, the smith-normal-form benchmark was killed after running for over 60,000 seconds. 
+</p>
+<h2 id="head-1e1a89ad1603af312775f4f486bcf8b9d6ef4f76">Compile time</h2>
+<a id="CompileTime"></a> <p>
+The following table gives the compile time of each benchmark in seconds.  A * in an entry means that the compiler failed to compile the benchmark. 
+</p>
+
+<div>
+<table>
+<tr>
+<td>
+benchmark</td>
+<td>
+MLton</td>
+<td>
+ML-Kit</td>
+<td>
+Moscow-ML</td>
+<td>
+Poly/ML</td>
+<td>
+SML/NJ</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/barnes-hut.sml">barnes-hut</a></td>
+<td>
+7.06</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+1.09</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/boyer.sml">boyer</a></td>
+<td>
+8.08</td>
+<td>
+9.73</td>
+<td>
+0.39</td>
+<td>
+0.14</td>
+<td>
+3.46</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/checksum.sml">checksum</a></td>
+<td>
+4.96</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+*</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/count-graphs.sml">count-graphs</a></td>
+<td>
+5.73</td>
+<td>
+2.17</td>
+<td>
+0.13</td>
+<td>
+0.08</td>
+<td>
+0.72</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/DLXSimulator.sml">DLXSimulator</a></td>
+<td>
+7.67</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+*</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/fft.sml">fft</a></td>
+<td>
+5.00</td>
+<td>
+1.54</td>
+<td>
+0.12</td>
+<td>
+0.06</td>
+<td>
+0.66</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/fib.sml">fib</a></td>
+<td>
+4.67</td>
+<td>
+0.91</td>
+<td>
+0.04</td>
+<td>
+0.03</td>
+<td>
+0.16</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/flat-array.sml">flat-array</a></td>
+<td>
+4.60</td>
+<td>
+0.91</td>
+<td>
+0.03</td>
+<td>
+0.02</td>
+<td>
+0.18</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/hamlet.sml">hamlet</a></td>
+<td>
+46.86</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+53.12</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/imp-for.sml">imp-for</a></td>
+<td>
+4.63</td>
+<td>
+0.99</td>
+<td>
+0.04</td>
+<td>
+0.02</td>
+<td>
+0.19</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/knuth-bendix.sml">knuth-bendix</a></td>
+<td>
+6.12</td>
+<td>
+4.21</td>
+<td>
+0.18</td>
+<td>
+0.15</td>
+<td>
+1.36</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/lexgen.sml">lexgen</a></td>
+<td>
+9.09</td>
+<td>
+6.47</td>
+<td>
+0.38</td>
+<td>
+0.33</td>
+<td>
+3.22</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/life.sml">life</a></td>
+<td>
+5.09</td>
+<td>
+2.43</td>
+<td>
+0.09</td>
+<td>
+0.07</td>
+<td>
+0.53</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/logic.sml">logic</a></td>
+<td>
+6.52</td>
+<td>
+4.77</td>
+<td>
+0.21</td>
+<td>
+0.11</td>
+<td>
+1.43</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/mandelbrot.sml">mandelbrot</a></td>
+<td>
+4.63</td>
+<td>
+0.97</td>
+<td>
+0.05</td>
+<td>
+0.03</td>
+<td>
+0.23</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/matrix-multiply.sml">matrix-multiply</a></td>
+<td>
+4.68</td>
+<td>
+1.03</td>
+<td>
+0.06</td>
+<td>
+0.03</td>
+<td>
+0.26</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/md5.sml">md5</a></td>
+<td>
+5.26</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+*</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/merge.sml">merge</a></td>
+<td>
+4.64</td>
+<td>
+0.93</td>
+<td>
+0.07</td>
+<td>
+0.01</td>
+<td>
+0.24</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/mlyacc.sml">mlyacc</a></td>
+<td>
+22.42</td>
+<td>
+36.94</td>
+<td>
+3.63</td>
+<td>
+1.45</td>
+<td>
+14.63</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/model-elimination.sml">model-elimination</a></td>
+<td>
+23.07</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+24.06</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/mpuz.sml">mpuz</a></td>
+<td>
+4.75</td>
+<td>
+1.27</td>
+<td>
+0.06</td>
+<td>
+0.04</td>
+<td>
+0.35</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/nucleic.sml">nucleic</a></td>
+<td>
+65.13</td>
+<td>
+31.26</td>
+<td>
+*</td>
+<td>
+0.48</td>
+<td>
+2.56</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/output1.sml">output1</a></td>
+<td>
+5.28</td>
+<td>
+0.94</td>
+<td>
+0.04</td>
+<td>
+0.02</td>
+<td>
+0.17</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/peek.sml">peek</a></td>
+<td>
+5.19</td>
+<td>
+0.97</td>
+<td>
+0.04</td>
+<td>
+0.03</td>
+<td>
+0.19</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/psdes-random.sml">psdes-random</a></td>
+<td>
+4.65</td>
+<td>
+0.99</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+65.07</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/ratio-regions.sml">ratio-regions</a></td>
+<td>
+5.73</td>
+<td>
+3.80</td>
+<td>
+0.19</td>
+<td>
+0.13</td>
+<td>
+1.38</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/ray.sml">ray</a></td>
+<td>
+7.94</td>
+<td>
+3.21</td>
+<td>
+0.13</td>
+<td>
+0.10</td>
+<td>
+0.81</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/raytrace.sml">raytrace</a></td>
+<td>
+12.32</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+5.16</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/simple.sml">simple</a></td>
+<td>
+10.03</td>
+<td>
+11.79</td>
+<td>
+0.43</td>
+<td>
+0.27</td>
+<td>
+3.19</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/smith-normal-form.sml">smith-normal-form</a></td>
+<td>
+8.45</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+0.13</td>
+<td>
+2.39</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/tailfib.sml">tailfib</a></td>
+<td>
+4.59</td>
+<td>
+0.92</td>
+<td>
+0.04</td>
+<td>
+0.02</td>
+<td>
+0.18</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/tak.sml">tak</a></td>
+<td>
+4.60</td>
+<td>
+0.89</td>
+<td>
+0.04</td>
+<td>
+0.01</td>
+<td>
+0.17</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/tensor.sml">tensor</a></td>
+<td>
+7.34</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+2.06</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/tsp.sml">tsp</a></td>
+<td>
+5.51</td>
+<td>
+2.40</td>
+<td>
+0.14</td>
+<td>
+*</td>
+<td>
+0.51</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/tyan.sml">tyan</a></td>
+<td>
+7.38</td>
+<td>
+5.87</td>
+<td>
+0.27</td>
+<td>
+0.20</td>
+<td>
+1.97</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/vector-concat.sml">vector-concat</a></td>
+<td>
+4.66</td>
+<td>
+0.91</td>
+<td>
+0.04</td>
+<td>
+0.03</td>
+<td>
+0.19</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/vector-rev.sml">vector-rev</a></td>
+<td>
+4.62</td>
+<td>
+0.93</td>
+<td>
+0.04</td>
+<td>
+0.02</td>
+<td>
+0.18</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/vliw.sml">vliw</a></td>
+<td>
+16.68</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+13.44</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/wc-input1.sml">wc-input1</a></td>
+<td>
+5.86</td>
+<td>
+0.96</td>
+<td>
+0.05</td>
+<td>
+0.02</td>
+<td>
+0.21</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/wc-scanStream.sml">wc-scanStream</a></td>
+<td>
+6.10</td>
+<td>
+0.96</td>
+<td>
+0.05</td>
+<td>
+0.03</td>
+<td>
+0.21</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/zebra.sml">zebra</a></td>
+<td>
+7.01</td>
+<td>
+2.57</td>
+<td>
+0.09</td>
+<td>
+0.06</td>
+<td>
+0.64</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/zern.sml">zern</a></td>
+<td>
+5.21</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+0.50</td>
+</tr>
+</table>
+</div>
+<h2 id="head-555486354ddf034c3d6b020cb86ba59bc82c76d5">Code size</h2>
+<a id="CodeSize"></a> <p>
+The following table gives the code size of each benchmark in bytes. The size for MLton and the ML Kit is the sum of text and data for the standalone executable as reported by <tt>size</tt>.  The size for Moscow ML is the size in bytes of the executable <tt>a.out</tt>.  The size for Poly/ML is the difference in size of the database before the session start and after the commit.  The size for SML/NJ is the size of the heap file created by <tt>exportFn</tt> and does not include the size of the SML/NJ runtime system (approximately 100K).  A * in an entry means that the compiler failed to compile the benchmark. 
+</p>
+
+<div>
+<table>
+<tr>
+<td>
+benchmark</td>
+<td>
+MLton</td>
+<td>
+ML-Kit</td>
+<td>
+Moscow-ML</td>
+<td>
+Poly/ML</td>
+<td>
+SML/NJ</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/barnes-hut.sml">barnes-hut</a></td>
+<td>
+157,305</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+422,976</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/boyer.sml">boyer</a></td>
+<td>
+154,559</td>
+<td>
+156,737</td>
+<td>
+116,300</td>
+<td>
+122,880</td>
+<td>
+516,136</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/checksum.sml">checksum</a></td>
+<td>
+70,489</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+*</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/count-graphs.sml">count-graphs</a></td>
+<td>
+81,555</td>
+<td>
+88,601</td>
+<td>
+84,613</td>
+<td>
+98,304</td>
+<td>
+450,680</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/DLXSimulator.sml">DLXSimulator</a></td>
+<td>
+185,925</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+*</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/fft.sml">fft</a></td>
+<td>
+79,955</td>
+<td>
+85,433</td>
+<td>
+84,046</td>
+<td>
+65,536</td>
+<td>
+424,016</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/fib.sml">fib</a></td>
+<td>
+64,227</td>
+<td>
+16,101</td>
+<td>
+79,892</td>
+<td>
+49,152</td>
+<td>
+405,248</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/flat-array.sml">flat-array</a></td>
+<td>
+64,271</td>
+<td>
+24,413</td>
+<td>
+80,034</td>
+<td>
+49,152</td>
+<td>
+416,528</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/hamlet.sml">hamlet</a></td>
+<td>
+1,301,021</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+1,411,336</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/imp-for.sml">imp-for</a></td>
+<td>
+64,115</td>
+<td>
+16,869</td>
+<td>
+80,040</td>
+<td>
+57,344</td>
+<td>
+390,184</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/knuth-bendix.sml">knuth-bendix</a></td>
+<td>
+160,857</td>
+<td>
+97,177</td>
+<td>
+88,439</td>
+<td>
+180,224</td>
+<td>
+420,904</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/lexgen.sml">lexgen</a></td>
+<td>
+258,994</td>
+<td>
+215,729</td>
+<td>
+104,883</td>
+<td>
+196,608</td>
+<td>
+491,584</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/life.sml">life</a></td>
+<td>
+81,591</td>
+<td>
+79,253</td>
+<td>
+83,390</td>
+<td>
+65,536</td>
+<td>
+404,520</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/logic.sml">logic</a></td>
+<td>
+125,587</td>
+<td>
+115,217</td>
+<td>
+87,251</td>
+<td>
+114,688</td>
+<td>
+430,120</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/mandelbrot.sml">mandelbrot</a></td>
+<td>
+64,175</td>
+<td>
+77,905</td>
+<td>
+81,340</td>
+<td>
+57,344</td>
+<td>
+394,280</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/matrix-multiply.sml">matrix-multiply</a></td>
+<td>
+65,435</td>
+<td>
+96,137</td>
+<td>
+82,417</td>
+<td>
+57,344</td>
+<td>
+422,968</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/md5.sml">md5</a></td>
+<td>
+129,249</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+*</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/merge.sml">merge</a></td>
+<td>
+65,835</td>
+<td>
+25,601</td>
+<td>
+80,090</td>
+<td>
+49,152</td>
+<td>
+390,192</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/mlyacc.sml">mlyacc</a></td>
+<td>
+558,018</td>
+<td>
+502,081</td>
+<td>
+148,286</td>
+<td>
+2,850,816</td>
+<td>
+801,904</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/model-elimination.sml">model-elimination</a></td>
+<td>
+686,584</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+1,028,344</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/mpuz.sml">mpuz</a></td>
+<td>
+66,895</td>
+<td>
+75,925</td>
+<td>
+82,382</td>
+<td>
+81,920</td>
+<td>
+398,376</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/nucleic.sml">nucleic</a></td>
+<td>
+218,271</td>
+<td>
+268,237</td>
+<td>
+*</td>
+<td>
+221,184</td>
+<td>
+477,240</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/output1.sml">output1</a></td>
+<td>
+139,243</td>
+<td>
+61,465</td>
+<td>
+80,187</td>
+<td>
+49,152</td>
+<td>
+405,248</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/peek.sml">peek</a></td>
+<td>
+133,953</td>
+<td>
+60,829</td>
+<td>
+81,621</td>
+<td>
+57,344</td>
+<td>
+409,392</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/psdes-random.sml">psdes-random</a></td>
+<td>
+64,851</td>
+<td>
+25,529</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+411,704</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/ratio-regions.sml">ratio-regions</a></td>
+<td>
+89,779</td>
+<td>
+98,489</td>
+<td>
+87,482</td>
+<td>
+73,728</td>
+<td>
+433,208</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/ray.sml">ray</a></td>
+<td>
+239,069</td>
+<td>
+112,309</td>
+<td>
+89,859</td>
+<td>
+147,456</td>
+<td>
+483,472</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/raytrace.sml">raytrace</a></td>
+<td>
+321,782</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+605,360</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/simple.sml">simple</a></td>
+<td>
+276,608</td>
+<td>
+202,561</td>
+<td>
+94,396</td>
+<td>
+475,136</td>
+<td>
+746,600</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/smith-normal-form.sml">smith-normal-form</a></td>
+<td>
+239,321</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+131,072</td>
+<td>
+547,984</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/tailfib.sml">tailfib</a></td>
+<td>
+63,899</td>
+<td>
+16,301</td>
+<td>
+79,943</td>
+<td>
+57,344</td>
+<td>
+405,248</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/tak.sml">tak</a></td>
+<td>
+64,311</td>
+<td>
+16,093</td>
+<td>
+79,908</td>
+<td>
+57,344</td>
+<td>
+401,152</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/tensor.sml">tensor</a></td>
+<td>
+155,108</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+440,432</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/tsp.sml">tsp</a></td>
+<td>
+133,549</td>
+<td>
+99,497</td>
+<td>
+86,146</td>
+<td>
+*</td>
+<td>
+414,784</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/tyan.sml">tyan</a></td>
+<td>
+192,229</td>
+<td>
+146,101</td>
+<td>
+91,586</td>
+<td>
+196,608</td>
+<td>
+467,032</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/vector-concat.sml">vector-concat</a></td>
+<td>
+65,483</td>
+<td>
+24,517</td>
+<td>
+80,194</td>
+<td>
+49,152</td>
+<td>
+416,528</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/vector-rev.sml">vector-rev</a></td>
+<td>
+64,735</td>
+<td>
+24,697</td>
+<td>
+80,078</td>
+<td>
+57,344</td>
+<td>
+416,528</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/vliw.sml">vliw</a></td>
+<td>
+445,446</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+730,280</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/wc-input1.sml">wc-input1</a></td>
+<td>
+160,129</td>
+<td>
+132,765</td>
+<td>
+85,771</td>
+<td>
+49,152</td>
+<td>
+394,280</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/wc-scanStream.sml">wc-scanStream</a></td>
+<td>
+163,633</td>
+<td>
+133,261</td>
+<td>
+85,947</td>
+<td>
+49,152</td>
+<td>
+407,296</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/zebra.sml">zebra</a></td>
+<td>
+176,181</td>
+<td>
+44,741</td>
+<td>
+83,422</td>
+<td>
+90,112</td>
+<td>
+409,656</td>
+</tr>
+<tr>
+<td>
+<a href="http://mlton.org/pages/Performance/attachments/zern.sml">zern</a></td>
+<td>
+146,473</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+*</td>
+<td>
+468,120</td>
+</tr>
+</table>
+</div>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-06 04:28:40 by <span title="adsl-64-166-225-13.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/PhantomType
===================================================================
--- mlton/trunk/doc/guide/PhantomType	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/PhantomType	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,109 @@
+<!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>PhantomType - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      PhantomType
+    <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">
+A phantom type is a type that has no run-time representation, but is used to force the type checker to ensure invariants at compile time. This is done by augmenting a type with additional arguments (phantom type variables) and expressing constraints by choosing phantom types to stand for the phantom types in the types of values. <h2 id="head-5d20d0fee3b91643dd8d272ac33d01ca95179d82">References</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a href = "References#Blume01">Blume01</a> 
+</p>
+</li>
+
+        <ul>
+
+        <li>
+<p>
+ dimensions 
+</p>
+</li>
+        <li>
+<p>
+ C type system 
+</p>
+</li>
+
+        </ul>
+
+
+    <li>
+<p>
+ <a href = "References#FluetPucella02">FluetPucella02</a> 
+</p>
+</li>
+
+        <ul>
+
+        <li>
+<p>
+ subtyping 
+</p>
+</li>
+
+        </ul>
+
+
+    <li>
+<p>
+ socket module in <a href="BasisLibrary"> SML Basis Library</a> 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-30 23:56:38 by <span title="cfs38.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/PlatformSpecificNotes
===================================================================
--- mlton/trunk/doc/guide/PlatformSpecificNotes	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/PlatformSpecificNotes	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,136 @@
+<!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>PlatformSpecificNotes - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      PlatformSpecificNotes
+    <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">
+Notes about running MLton is available on the following specific platforms. <h2 id="head-fe3daeee99f491988f6fd6066389c8167a7797fd">Operating Systems</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="RunningOnCygwin">Cygwin</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="RunningOnDarwin">Darwin</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="RunningOnFreeBSD">FreeBSD</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="RunningOnLinux">Linux</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="RunningOnMinGW">MinGW</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="RunningOnNetBSD">NetBSD</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="RunningOnOpenBSD">OpenBSD</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="RunningOnSolaris">Solaris</a> 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-a10f3b5aa08c9646632d8e35bf3374804be6df80">Architectures</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="RunningOnPowerPC">PowerPC</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="RunningOnSparc">Sparc</a> 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-a4bc8bf5caf54b18cea9f58e83dd4acb488deb17">Also see</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="PortingMLton">PortingMLton</a> 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-26 19:15:46 by <span title="adsl-64-166-225-13.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/PolyEqual
===================================================================
--- mlton/trunk/doc/guide/PolyEqual	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/PolyEqual	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,102 @@
+<!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>PolyEqual - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      PolyEqual
+    <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">
+<p>
+An optimization pass for the <a href="SSA">SSA</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="SSASimplify">SSASimplify</a>. 
+</p>
+<h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Implements polymorphic equality. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/poly-equal.sig?view=markup">poly-equal.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/poly-equal.fun?view=markup">poly-equal.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+<p>
+For each datatype, tycon, and vector type, it builds and equality function and translates calls to <tt>MLton_equal</tt> into calls to that function. 
+</p>
+<p>
+Also generates calls to <tt>IntInf_equal</tt> and <tt>Word_equal</tt>. 
+</p>
+<p>
+For tuples, it does the equality test inline; i.e., it does not create a separate equality function for each tuple type. 
+</p>
+<p>
+All equality functions are created if necesary, i.e., if equality is actually used at a type. 
+</p>
+<p>
+Optimizations: 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ for datatypes that are enumerations, do not build a case dispatch, just use <tt>MLton_eq</tt>, as the backend will represent these as ints 
+</p>
+</li>
+    <li>
+<p>
+ deep equality always does an <tt>MLton_eq</tt> test first 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:31:13 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/PolyML
===================================================================
--- mlton/trunk/doc/guide/PolyML	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/PolyML	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,59 @@
+<!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>PolyML - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      PolyML
+    <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">
+<a class="external" href="http://www.polyml.org/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Poly/ML</a>  is a <a href="StandardMLImplementations">Standard ML Compiler</a>. </div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-30 20:11:39 by <span title="adsl-64-166-225-13.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/PolymorphicEquality
===================================================================
--- mlton/trunk/doc/guide/PolymorphicEquality	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/PolymorphicEquality	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,256 @@
+<!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>PolymorphicEquality - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      PolymorphicEquality
+    <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">
+Polymorphic equality is a built in function in  <a href="StandardML">Standard ML</a> that compares two values of the same type for equality.  It is specified as 
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> = : ''a * ''a -&gt; bool
+</PRE>
+<p>
+ 
+</p>
+<p>
+The <tt>''a</tt> in the specification are  <a href="EqualityTypeVariable">equality type variables</a>, and indicate that polymorphic equality can only be applied to values of an <a href="EqualityType">equality type</a>.  It is not allowed in SML to rebind <tt>=</tt>, so a programmer is guaranteed that <tt>=</tt> always denotes polymorphic equality. 
+</p>
+<p>
+<ol>
+<li>
+<a href="#head-7a35baa02601d966253d4cd11022720d3c7c85b6">Equality of ground types</a></li>
+<li>
+<a href="#head-0f3dde7404010ce2eb8acb56157248e74f28e7ac">Equality of reals</a></li>
+<li>
+<a href="#head-16f64cbf7b943934e1a83e690a579efe57383553">Equality of functions</a></li>
+<li>
+<a href="#head-57e4aca10e4c8110f7108e37c8e03ee3ceab6eb0">Equality of immutable types</a></li>
+<li>
+<a href="#head-2b8052d0b12eb9178fa4e234e2ec6108e811460f">Equality of mutable values</a></li>
+<li>
+<a href="#head-2d02f1ba2142e6814e7dcdf979c4523b6443b90c">Equality of datatypes</a></li>
+<li>
+<a href="#head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</a></li>
+<li>
+<a href="#head-a4bc8bf5caf54b18cea9f58e83dd4acb488deb17">Also see</a></li>
+</ol>
+
+ 
+</p>
+<h2 id="head-7a35baa02601d966253d4cd11022720d3c7c85b6">Equality of ground types</h2>
+<p>
+Ground types like <tt>char</tt>, <tt>int</tt>, and <tt>word</tt> may be compared (to values of the same type).  For example, <tt>13&nbsp;=&nbsp;14</tt> is type correct and yields <tt>false</tt>. 
+</p>
+<h2 id="head-0f3dde7404010ce2eb8acb56157248e74f28e7ac">Equality of reals</h2>
+<p>
+The one ground type that can not be compared is <tt>real</tt>.  So, <tt>13.0&nbsp;=&nbsp;14.0</tt> is not type correct.  One can use <tt>Real.==</tt> to compare reals for equality, but beware that this has different algebraic properties than polymorphic equality. 
+</p>
+<p>
+See <a href="http://mlton.org/basis/real.html">http://mlton.org/basis/real.html</a> for a discussion of why <tt>real</tt> is not an equality type. 
+</p>
+<h2 id="head-16f64cbf7b943934e1a83e690a579efe57383553">Equality of functions</h2>
+<p>
+Comparison of functions is not allowed. 
+</p>
+<h2 id="head-57e4aca10e4c8110f7108e37c8e03ee3ceab6eb0">Equality of immutable types</h2>
+<p>
+Polymorphic equality can be used on <a href="Immutable">immutable</a> values like tuples, records, lists, and vectors.  For example, 
+</p>
+
+<pre>(1, 2, 3) = (4, 5, 6)
+</pre><p>
+is a type-correct expression yielding <tt>false</tt>, while 
+</p>
+
+<pre>[1, 2, 3] = [1, 2, 3]
+</pre><p>
+is type correct and yields <tt>true</tt>. 
+</p>
+<p>
+Equality on immutable values is computed by structure, which means that values are compared by recursively descending the data structure until ground types are reached, at which point the ground types are compared with primitive equality tests (like comparison of characters).  So, the expression 
+</p>
+
+<pre>[1, 2, 3] = [1, 1 + 1, 1 + 1 + 1]
+</pre><p>
+is guaranteed to yield <tt>true</tt>, even though the lists may occupy different locations in memory. 
+</p>
+<p>
+Because of structural equality, immutable values can only be compared if their components can be compared.  For example, <tt>[1,&nbsp;2,&nbsp;3]</tt> can be compared, but <tt>[1.0,&nbsp;2.0,&nbsp;3.0]</tt> can not.  The SML type system uses <a href="EqualityType">equality types</a> to ensure that structural equality is only applied to valid values. 
+</p>
+<h2 id="head-2b8052d0b12eb9178fa4e234e2ec6108e811460f">Equality of mutable values</h2>
+<p>
+In contrast to immutable values, polymorphic equality of <a href="Mutable">mutable</a> values (like ref cells and arrays) is performed by pointer comparison, not by structure.  So, the expression 
+</p>
+
+<pre>ref 13 = ref 13
+</pre><p>
+is guaranteed to yield <tt>false</tt>, even though the ref cells hold the same contents. 
+</p>
+<p>
+Because equality of mutable values is not structural, arrays and refs can be compared <em>even if their components are not equality types</em>. Hence, the following expression is type correct (and yields true). 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">let</FONT></B>
+   <B><FONT COLOR="#A020F0">val</FONT></B> r = ref <B><FONT COLOR="#5F9EA0">13.0</FONT></B>
+<B><FONT COLOR="#A020F0">in</FONT></B>
+   r = r
+<B><FONT COLOR="#A020F0">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<h2 id="head-2d02f1ba2142e6814e7dcdf979c4523b6443b90c">Equality of datatypes</h2>
+<p>
+Polymorphic equality of datatypes is structural.  Two values of the same datatype are equal if they are of the same variant and if the variant's arguments are equal (recursively).  So, with the datatype 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">A</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">B</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> t
+</FONT></B></PRE>
+<p>
+ 
+</p>
+<p>
+then <tt>B&nbsp;(B&nbsp;A)&nbsp;=&nbsp;B&nbsp;A</tt> is type correct and yields <tt>false</tt>, while <tt>A&nbsp;=&nbsp;A</tt> and <tt>B&nbsp;A&nbsp;=&nbsp;B&nbsp;A</tt> yield <tt>true</tt>. 
+</p>
+<p>
+As polymorphic equality descends two values to compare them, it uses pointer equality whenever it reaches a mutable value.  So, with the datatype  
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">A</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> int ref </FONT></B>|<FONT COLOR="#228B22"><B> </FONT></B>...
+</PRE>
+<p>
+ 
+</p>
+<p>
+then <tt>A&nbsp;(ref&nbsp;13)&nbsp;=&nbsp;A&nbsp;(ref&nbsp;13)</tt> is type correct and yields <tt>false</tt>, because the pointer equality on the two ref cells yields <tt>false</tt>. 
+</p>
+<p>
+One weakness of the SML type system is that datatypes do not inherit the special property of the <tt>ref</tt> and <tt>array</tt> type constructors that allows them to be compared regardless of their component type.  For example, after declaring 
+<pre class=code>
+<B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> 'a t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">A</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> 'a ref
+</FONT></B></PRE>
+ one might expect to be able to compare two values of type  <tt>real&nbsp;t</tt>, because pointer comparison on a ref cell would suffice. Unfortunately, the type system can only express that a user-defined datatype <a href="AdmitsEquality">admits equality</a> or not.  In this case, <tt>t</tt> admits equality, which means that <tt>int&nbsp;t</tt> can be compared but that <tt>real&nbsp;t</tt> can not.  We can confirm this with the program 
+<pre class=code>
+<B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> 'a t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">A</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> 'a ref
+</FONT></B><B><FONT COLOR="#A020F0">fun</FONT></B> f (x: real t, y: real t) = x = y
+</PRE>
+ on which MLton reports the following error. 
+<pre>Error: z.sml 2.34.
+  Function applied to incorrect argument.
+    expects: [&lt;equality&gt;] * [&lt;equality&gt;]
+    but got: [&lt;non-equality&gt;] * [&lt;non-equality&gt;]
+    in: = (x, y)
+</pre>
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+<p>
+Polymorphic equality is implemented by recursively descending the two values being compared, and stopping as soon as they are determined to be unequal, or exploring the entire values to determine that they are equal.  Hence, polymorphic equality can take time proportional to the size of the smaller value. 
+</p>
+<p>
+MLton uses some optimizations to improve performance.   
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ When computing structural equality, first do a pointer comparison.  If the comparison yields <tt>true</tt>, then stop and return <tt>true</tt>,  since the structural comparison is guaranteed to do so.  If the  pointer comparison fails, then recursively descend the values. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ If a datatype is an enum (e.g. <tt>datatype&nbsp;t&nbsp;=&nbsp;A&nbsp;|&nbsp;B&nbsp;|&nbsp;C</tt>),  then a single comparison suffices to compare values of the datatype.  No case dispatch is required to determine whether the two values are  of the same variant. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ When comparing a known constant non-value-carrying variant, use a  single comparison.  For example, the following code will compile into  a single comparison for <tt>A&nbsp;=&nbsp;x</tt>. 
+<pre> datatype t = A | B | C of ...
+ ... if A = x then ...</pre>
+</p>
+</li>
+    <li class="gap">
+<p>
+ When comparing a small constant <tt>IntInf.int</tt> to another <tt>IntInf.int</tt>, use a  single comparison against the constant.  No case dispatch is  required.  
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-a4bc8bf5caf54b18cea9f58e83dd4acb488deb17">Also see</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="AdmitsEquality">AdmitsEquality</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="EqualityType">EqualityType</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="EqualityTypeVariable">EqualityTypeVariable</a> 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-26 20:31:49 by <span title="cfs36.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Polyvariance
===================================================================
--- mlton/trunk/doc/guide/Polyvariance	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Polyvariance	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,72 @@
+<!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>Polyvariance - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Polyvariance
+    <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">
+<p>
+An optimization pass for the <a href="SXML">SXML</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="SXMLSimplify">SXMLSimplify</a>. 
+</p>
+<h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Duplicate a higher-order, <tt>let</tt> bound function at each variable reference, if cost is smaller than threshold. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/xml/polyvariance.sig?view=markup">polyvariance.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/xml/polyvariance.fun?view=markup">polyvariance.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:30:57 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/PortingMLton
===================================================================
--- mlton/trunk/doc/guide/PortingMLton	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/PortingMLton	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,364 @@
+<!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>PortingMLton - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      PortingMLton
+    <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">
+Porting MLton to a new target platform (architecture or OS) involves the following steps. 
+    <ol type="1">
+
+    <li>
+<p>
+Make the necessary changes to the scripts, runtime system, Basis  Library implementation, and compiler. 
+</p>
+</li>
+    <li class="gap">
+<p>
+Get the regressions working using a cross compiler. 
+</p>
+</li>
+    <li class="gap">
+<p>
+Cross compile MLton and bootstrap on the target. 
+</p>
+</li>
+
+    </ol>
+
+
+<p>
+MLton only has a native code generator for X86, so, if you are porting to another architecture, you must use the C code generator.  These notes do not cover building a new native code generator. 
+</p>
+<h2 id="head-54fc2e14a2d5b38e69a028f12f443994b939305a">What code to change</h2>
+
+    <ul>
+
+    <li>
+<p>
+ Scripts 
+</p>
+</li>
+
+        <ul>
+
+        <li>
+<p>
+ In <tt>bin/platform</tt>, add a new case to handle the output of   <tt>uname</tt>.  
+</p>
+</li>
+        <li class="gap">
+<p>
+ In <tt>bin/upgrade-basis</tt>, 
+</p>
+</li>
+
+            <ul>
+
+            <li>
+<p>
+ add new stubs in <tt>structure&nbsp;MLton.Platform.OS</tt>. 
+</p>
+</li>
+            <li>
+<p>
+ add a new case to set <tt>$os</tt>. 
+</p>
+</li>
+            <li>
+<p>
+ add a new case to set <tt>MLton.Platform.Arch.t</tt> and <tt>all</tt> 
+</p>
+</li>
+
+            </ul>
+
+
+
+        </ul>
+
+
+    <li class="gap">
+<p>
+ Runtime system 
+</p>
+<p>
+ The goal of this step is to be able to successfully run <tt>make</tt> in  the <tt>runtime</tt> directory on the target machine. 
+</p>
+</li>
+
+            <ul>
+
+            <li>
+<p>
+ In <tt>platform.h</tt>, add a new case to include    <tt>platform/&lt;os&gt;.h</tt> 
+</p>
+</li>
+            <li class="gap">
+<p>
+ In <tt>platform/&lt;os&gt;.[ch]</tt>, implement any    platform-dependent functions that the runtime needs. 
+</p>
+</li>
+            <li class="gap">
+<p>
+ In <tt>basis/Real/class.c</tt>, add the architecture specific code    to implement <tt>Real&lt;N&gt;.class</tt> (i.e. to determine the class of a    floating point number.  It would be nice to implement this code    (portably) in the Basis Library implementation some day. 
+</p>
+</li>
+            <li class="gap">
+<p>
+ Add rounding mode control to IEEEReal.c for the new arch. 
+</p>
+</li>
+            <li class="gap">
+<p>
+ Compile and install the <a href="GnuMP">GnuMP</a>.  This varies from platform to    platform.  In <tt>platform/&lt;os&gt;.h</tt>, you need to include the    appropriate <tt>gmp.h</tt>. 
+</p>
+</li>
+            <li class="gap">
+<p>
+ Make sure the definition of <tt>ReturnToC</tt> in    <tt>include/x86-main.h</tt> is correct. 
+</p>
+</li>
+
+            </ul>
+
+
+    <li class="gap">
+<p>
+ Basis Library implementation (<tt>basis-library/*</tt>) 
+</p>
+</li>
+
+            <ul>
+
+            <li>
+<p>
+ In <tt>misc/primitive.sml</tt>, 
+</p>
+</li>
+
+                <ul>
+
+                <li>
+<p>
+ If necessary, add a new variant to the     <tt>MLton.Platform.Arch.t</tt> datatype. 
+</p>
+</li>
+                <li class="gap">
+<p>
+ If necessary, add a new variant to the <tt>MLton.Platform.OS.t</tt>     datatype.  
+</p>
+</li>
+                <li class="gap">
+<p>
+ modify the constants that define <tt>host</tt> to match with     <tt>MLton_Platform_OS_host</tt>, as set in     <tt>runtime/platform/&lt;os&gt;.h</tt>. 
+</p>
+</li>
+
+                </ul>
+
+
+            <li class="gap">
+<p>
+ In <tt>mlton/platform.{sig,sml}&nbsp;</tt> add a new variant. 
+</p>
+</li>
+            <li class="gap">
+<p>
+ Look at all the uses of <tt>MLton.Platform</tt> in the Basis    Library implementation and see if you need to do anything special.  You might use    the following command to see where to look. 
+<pre>   find basis-library -type f | xargs grep 'MLton\.Platform'</pre>   If in doubt, leave the code alone and wait to see what happens when    you run the regression tests.  Here's some that will likely need to    be modified. 
+</p>
+</li>
+
+                <ul>
+
+                <li>
+<p>
+ <tt>real/pack-real.sml</tt>: definition of isBigEndian 
+</p>
+</li>
+
+                </ul>
+
+
+
+            </ul>
+
+
+    <li class="gap">
+<p>
+ Compiler 
+</p>
+</li>
+
+        <ul>
+
+        <li>
+<p>
+ In <tt>lib/mlton-stubs/</tt>, update <tt>mlton.sml</tt> and   <tt>platform.sig</tt> to add any new variants.  
+</p>
+</li>
+        <li class="gap">
+<p>
+ In <tt>mlton/main/main.fun</tt>, add code to set <tt>linkWithGmp</tt>. 
+</p>
+</li>
+
+        </ul>
+
+
+
+    </ul>
+
+
+<h2 id="head-d7908c004a8540632014119d432f4daa14496746">Running the regressions with a cross compiler</h2>
+<p>
+When porting to a new platform, it is always best to get all (or as many as possible) of the regressions working before moving to a self compile.  It is easiest to do this by modifying and rebuilding the compiler on a working machine and then running the regressions with a cross compiler.  It is not easy to build a gcc cross compiler, so we recommend generating the C and assembly on a working machine (using MLton's <tt>-target</tt> and <tt>-stop&nbsp;g</tt> flags, copying the generated files to the target machine, then compiling and linking there. 
+</p>
+
+    <ol type="1">
+
+    <li>
+<p>
+Remake the compiler on a working machine. 
+</p>
+</li>
+    <li class="gap">
+<p>
+Use <tt>bin/add-cross</tt> to add support for the new target.  In  particular, this should create <tt>build/lib/&lt;target&gt;/</tt> with the  platform-specific necessary cross-compilation information. 
+</p>
+</li>
+    <li class="gap">
+<p>
+Run the regression tests with the cross-compiler.  To cross-compile  all the tests, do 
+<pre> bin/regression -cross &lt;target&gt;</pre> This will create all the executables.  Then, copy  <tt>bin/regression</tt> and the <tt>regression</tt> directory to the target  machine, and do 
+<pre> bin/regression -run-only</pre> This should run all the tests.  
+</p>
+</li>
+
+    </ol>
+
+
+<p>
+Repeat this step, interleaved with appropriate compiler modifications, until all the regressions pass. 
+</p>
+<h2 id="head-89ec4ec2bf400e823f3ca49d0cb938b0fedd7bab">Bootstrap</h2>
+<p>
+Once you've got all the regressions working, you can build MLton for the new target.  As with the regressions, the idea for bootstrapping is to generate the C and assembly on a working machine, copy it to the target machine, and then compile and link there.  Here's the sequence of steps.  
+</p>
+
+    <ol type="1">
+
+    <li>
+<p>
+On a working machine, with the newly rebuilt compiler, in the  <tt>mlton</tt> directory, do: 
+<pre> mlton -stop g -target i386-mingw mlton.cm</pre>
+</p>
+</li>
+    <li class="gap">
+<p>
+Copy to the target machine. 
+</p>
+</li>
+    <li class="gap">
+<p>
+On the target machine, move the libraries to the right place.  That is, in <tt>build/lib</tt>, do: 
+<pre> rm -rf self target-map
+ mv i386-mingw self</pre>
+</p>
+</li>
+    <li class="gap">
+<p>
+On the target machine, compile and link MLton.  That is, in the  mlton directory, do something like: 
+<pre> gcc -c -Ibuild/lib/include -O1 -w mlton/mlton.*.[cS]
+ gcc -o build/lib/mlton-compile \
+        -Lbuild/lib/self \
+        -L/usr/local/lib \
+        mlton.*.o \
+        -lmlton -lgmp -lgdtoa -lm</pre>
+</p>
+</li>
+    <li class="gap">
+<p>
+At this point, MLton should be working and you can finish the rest  of a usual make on the target machine. 
+<pre> make script world targetmap tools install</pre>
+</p>
+</li>
+
+    </ol>
+
+
+<p>
+There are other details to get right, like making sure that the tools directories were clean so that the tools are rebuilt on the new platform, but hopefully this structure works.  Once you've got a compiler on the target machine, you should test it by running all the regressions normally (i.e. without the <tt>-cross</tt> flag) and by running a couple rounds of self compiles. 
+</p>
+<h2 id="head-a4bc8bf5caf54b18cea9f58e83dd4acb488deb17">Also see</h2>
+<p>
+The above description is based on the following emails sent to the MLton list. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="http://mlton.org/pipermail/mlton/2002-October/013110.html">http://mlton.org/pipermail/mlton/2002-October/013110.html</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="http://mlton.org/pipermail/mlton/2004-July/016029.html">http://mlton.org/pipermail/mlton/2004-July/016029.html</a>        
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-28 21:44:56 by <span title="cfs36.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/PrecedenceParse
===================================================================
--- mlton/trunk/doc/guide/PrecedenceParse	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/PrecedenceParse	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,69 @@
+<!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>PrecedenceParse - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      PrecedenceParse
+    <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">
+An analysis/rewrite pass for the <a href="AST">AST</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="Elaborate">Elaborate</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Rewrites <a href="AST">AST</a> function clauses, expressions, and patterns to resolve <a href="OperatorPrecedence">OperatorPrecedence</a>. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate/precedence-parse.sig?view=markup">precedence-parse.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate/precedence-parse.fun?view=markup">precedence-parse.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:30:43 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Printf
===================================================================
--- mlton/trunk/doc/guide/Printf	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Printf	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,200 @@
+<!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>Printf - 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">
+
+
+<link rel="Appendix" title="printf.sml" href="http://mlton.org/pages/Printf/attachments/printf.sml">
+</head>
+
+<body lang="en" dir="ltr">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Printf
+    <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">
+Programmers coming from C or Java often ask if  <a href="StandardML">Standard ML</a> has a <tt>printf</tt> function.  It does not. However, it is possible to write your own.  In practice, however, it is not so important to do so - it is much more common to use a style in which you convert values to strings and concatenate to form the final the string, as in 
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> () = print (concat [<FONT COLOR="#BC8F8F"><B>&quot;var = &quot;</FONT></B>, Int.toString var, <FONT COLOR="#BC8F8F"><B>&quot;\n&quot;</FONT></B>])
+</PRE>
+<p>
+ 
+</p>
+<p>
+Here is the signature for a <tt>printf</tt> function with user definable formats (defined by <tt>newFormat</tt>). 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> PRINTF =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> ('a, 'b) t
+
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> ` : string -&gt; ('a, 'a) t
+      <B><FONT COLOR="#A020F0">val</FONT></B> newFormat: ('a -&gt; string) -&gt; ('a -&gt; 'b, 'c) t * string -&gt; ('b, 'c) t
+      <B><FONT COLOR="#A020F0">val</FONT></B> printf: (unit, 'a) t -&gt; 'a
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<p>
+A structure matching <tt>PRINTF</tt> could be used as follows. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">functor</FONT></B> TestPrintf (S: PRINTF) =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#0000FF">open</FONT></B> S
+
+      <I><FONT COLOR="#B22222">(* define some formats (the names are mnemonics of C's %c %d %s %f) *)</FONT></I>
+      <B><FONT COLOR="#A020F0">fun</FONT></B> C z = newFormat Char.toString z
+      <B><FONT COLOR="#A020F0">fun</FONT></B> D z = newFormat Int.toString z
+      <B><FONT COLOR="#A020F0">fun</FONT></B> S z = newFormat (<B><FONT COLOR="#A020F0">fn</FONT></B> s =&gt; s) z
+      <B><FONT COLOR="#A020F0">fun</FONT></B> F z = newFormat Real.toString z
+
+      <B><FONT COLOR="#A020F0">infix</FONT></B> C F D S
+
+      <B><FONT COLOR="#A020F0">val</FONT></B> () = printf (`<FONT COLOR="#BC8F8F"><B>&quot;here's a string &quot;</FONT></B>S<FONT COLOR="#BC8F8F"><B>&quot; and an int &quot;</FONT></B>D<FONT COLOR="#BC8F8F"><B>&quot;.\n&quot;</FONT></B>) <FONT COLOR="#BC8F8F"><B>&quot;foo&quot;</FONT></B> <B><FONT COLOR="#5F9EA0">13</FONT></B>
+      <B><FONT COLOR="#A020F0">val</FONT></B> () = printf (`<FONT COLOR="#BC8F8F"><B>&quot;here's a char &quot;</FONT></B>C<FONT COLOR="#BC8F8F"><B>&quot;.\n&quot;</FONT></B>) #<FONT COLOR="#BC8F8F"><B>&quot;c&quot;</FONT></B>
+      <B><FONT COLOR="#A020F0">val</FONT></B> () = printf (`<FONT COLOR="#BC8F8F"><B>&quot;here's a real &quot;</FONT></B>F<FONT COLOR="#BC8F8F"><B>&quot;.\n&quot;</FONT></B>) <B><FONT COLOR="#5F9EA0">13.0</FONT></B>
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<p>
+With no special compiler support, SML's type system ensures that the format characters (<tt>C</tt>, <tt>D</tt>, <tt>F</tt>, <tt>S</tt>) are supplied the correct type of argument.  Try modifying the above code to see what error you get if you pass the wrong type. 
+</p>
+<p>
+The real trick is in implementing <tt>PRINTF</tt>.  Here is an implementation based on <a href = "References#Danvy98"> Functional Unparsing</a>. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">structure</FONT></B> Printf:&gt; PRINTF =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> out </FONT></B>=<FONT COLOR="#228B22"><B> TextIO.outstream
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> output = TextIO.output
+
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> ('a, 'b) t </FONT></B>=<FONT COLOR="#228B22"><B> (out -&gt; 'a) -&gt; (out -&gt; 'b)
+
+      </FONT></B><B><FONT COLOR="#A020F0">fun</FONT></B> fprintf (out, f) = f (<B><FONT COLOR="#A020F0">fn</FONT></B> _ =&gt; ()) out
+
+      <B><FONT COLOR="#A020F0">fun</FONT></B> printf f = fprintf (TextIO.stdOut, f)
+
+      <B><FONT COLOR="#A020F0">fun</FONT></B> ` s k = <B><FONT COLOR="#A020F0">fn</FONT></B> out =&gt; (output (out, s); k out)
+
+      <B><FONT COLOR="#A020F0">fun</FONT></B> newFormat f (a, b) k =
+         a (<B><FONT COLOR="#A020F0">fn</FONT></B> out =&gt; <B><FONT COLOR="#A020F0">fn</FONT></B> s =&gt;
+            (output (out, f s)
+             ; output (out, b)
+             ; k out))
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<p>
+To make a complete program and test the above code, we can apply the <tt>TestPrintf</tt> functor to our implementation. 
+<pre class=code>
+<B><FONT COLOR="#0000FF">structure</FONT></B> S = TestPrintf (Printf)
+</PRE>
+ 
+</p>
+<p>
+Running the complete code prints out the following. 
+<pre>here's a string foo and an int 13.
+here's a char c.
+here's a real 13.
+</pre>
+</p>
+<h2 id="head-12c4ffe1d987164a4bedf6ab2aac597a113e181c">Efficiency</h2>
+<p>
+<tt>printf</tt> is rarely a bottleneck in programs.  However, you may be curious how the above implementation performs compared with the string-based C one.  Fortunately, MLton's aggressive optimization inlines away all the wrapper functions, leaving only the coercions interspersed with calls to <tt>print</tt>.  Thus, with MLton, the processing of the format characters occurs at compile time, which should be even faster than C's approach of processing the format characters at run time. 
+</p>
+<p>
+For example, MLton expands the above program into something like the following. 
+<pre>(print "here's a string "
+ ; print "foo"
+ ; print " and an int "
+ ; print (Int.toString 13)
+ ; print ".\n"
+ ; print "here's a char "
+ ; print (Char.toString #"c")
+ ; print ".\n"
+ ; print "here's a real "
+ ; print (Real.toString 13.0)
+ ; print ".\n")
+</pre>
+</p>
+<p>
+If you're fluent in MLton's intermediate languages, you can compile the program with <tt>-keep-pass&nbsp;polyvariance</tt> and look at the IL to confirm this. 
+</p>
+<h2 id="head-a479c9c34e878d07b4d67a73a48f432ad7dc53c8">Download</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="http://mlton.org/pages/Printf/attachments/printf.sml">printf.sml</a> 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-a4bc8bf5caf54b18cea9f58e83dd4acb488deb17">Also see</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="PrintfGentle">PrintfGentle</a> 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-30 23:56:46 by <span title="cfs38.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/PrintfGentle
===================================================================
--- mlton/trunk/doc/guide/PrintfGentle	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/PrintfGentle	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,399 @@
+<!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>PrintfGentle - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      PrintfGentle
+    <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">
+This page provides a gentle introduction and derivation of <a href="Printf">Printf</a>, with sections and arrangement more suitable to a talk. <h2 id="head-2473e96bc614a911821242119918a241a41836d6">Introduction</h2>
+<p>
+SML does not have <tt>printf</tt>.  Could we define it ourselves?  
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> () = printf (<FONT COLOR="#BC8F8F"><B>&quot;here's an int %d and a real %f.\n&quot;</FONT></B>, <B><FONT COLOR="#5F9EA0">13</FONT></B>, <B><FONT COLOR="#5F9EA0">17.0</FONT></B>)
+<B><FONT COLOR="#A020F0">val</FONT></B> () = printf (<FONT COLOR="#BC8F8F"><B>&quot;here's three values (%d, %f, %f).\n&quot;</FONT></B>, <B><FONT COLOR="#5F9EA0">13</FONT></B>, <B><FONT COLOR="#5F9EA0">17.0</FONT></B>, <B><FONT COLOR="#5F9EA0">19.0</FONT></B>)
+</PRE>
+<p>
+ 
+</p>
+<p>
+What could the type of <tt>printf</tt> be? 
+</p>
+<p>
+This obviously can't work, because SML functions take a fixed number of arguments.  Actually they take one argument, but if that's a tuple, it can only have a fixed number of components. 
+</p>
+<h2 id="head-f9635a75e0047cc95e31d23e2e028a16d33c9a3e">From tupling to currying</h2>
+<p>
+What about currying to get around the typing problem?  
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> () = printf <FONT COLOR="#BC8F8F"><B>&quot;here's an int %d and a real %f.\n&quot;</FONT></B> <B><FONT COLOR="#5F9EA0">13</FONT></B> <B><FONT COLOR="#5F9EA0">17.0</FONT></B>
+<B><FONT COLOR="#A020F0">val</FONT></B> () = printf <FONT COLOR="#BC8F8F"><B>&quot;here's three values (%d, %f, %f).\n&quot;</FONT></B> <B><FONT COLOR="#5F9EA0">13</FONT></B> <B><FONT COLOR="#5F9EA0">17.0</FONT></B> <B><FONT COLOR="#5F9EA0">19.0</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<p>
+That fails for a similar reason.  We need two types for <tt>printf</tt>.  
+</p>
+
+<pre>val printf: string -&gt; int -&gt; real -&gt; unit
+val printf: string -&gt; int -&gt; real -&gt; real -&gt; unit
+</pre><p>
+This can't work, because <tt>printf</tt> can only have one type.  SML doesn't support programmer-defined overloading. 
+</p>
+<h2 id="head-a4afe537360c86052d42c20840d22ff6d349ed93">Overloading and dependent types</h2>
+<p>
+Even without worrying about number of arguments, there is another problem.  The type of <tt>printf</tt> depends on the format string.  
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> () = printf <FONT COLOR="#BC8F8F"><B>&quot;here's an int %d and a real %f.\n&quot;</FONT></B> <B><FONT COLOR="#5F9EA0">13</FONT></B> <B><FONT COLOR="#5F9EA0">17.0</FONT></B>
+<B><FONT COLOR="#A020F0">val</FONT></B> () = printf <FONT COLOR="#BC8F8F"><B>&quot;here's a real %f and an int %d.\n&quot;</FONT></B> <B><FONT COLOR="#5F9EA0">17.0</FONT></B> <B><FONT COLOR="#5F9EA0">13</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<p>
+Now we need  
+</p>
+
+<pre>val printf: string -&gt; int -&gt; real -&gt; unit
+val printf: string -&gt; real -&gt; int -&gt; unit
+</pre><p>
+Again, this can't possibly working because SML doesn't have overloading, and types can't depend on values. 
+</p>
+<h2 id="head-3e2c45a19c32be195d2d157a383b8ec3e1bb8ca1">Idea: express type information in the format string</h2>
+<p>
+If we express type information in the format string, then different uses of <tt>printf</tt> can have different types. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> 'a t  <I><FONT COLOR="#B22222">(* the type of format strings *)</FONT></I>
+</FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> printf: 'a t -&gt; 'a
+<B><FONT COLOR="#A020F0">infix</FONT></B> D F
+<B><FONT COLOR="#A020F0">val</FONT></B> fs1: (int -&gt; real -&gt; unit) t = <FONT COLOR="#BC8F8F"><B>&quot;here's an int &quot;</FONT></B>D<FONT COLOR="#BC8F8F"><B>&quot; and a real &quot;</FONT></B>F<FONT COLOR="#BC8F8F"><B>&quot;.\n&quot;</FONT></B>
+<B><FONT COLOR="#A020F0">val</FONT></B> fs2: (int -&gt; real -&gt; real -&gt; unit) t = 
+   <FONT COLOR="#BC8F8F"><B>&quot;here's three values (&quot;</FONT></B>D<FONT COLOR="#BC8F8F"><B>&quot;, &quot;</FONT></B>F<FONT COLOR="#BC8F8F"><B>&quot;, &quot;</FONT></B>F<FONT COLOR="#BC8F8F"><B>&quot;).\n&quot;</FONT></B>
+<B><FONT COLOR="#A020F0">val</FONT></B> () = printf fs1 <B><FONT COLOR="#5F9EA0">13</FONT></B> <B><FONT COLOR="#5F9EA0">17.0</FONT></B>
+<B><FONT COLOR="#A020F0">val</FONT></B> () = printf fs2 <B><FONT COLOR="#5F9EA0">13</FONT></B> <B><FONT COLOR="#5F9EA0">17.0</FONT></B> <B><FONT COLOR="#5F9EA0">19.0</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<p>
+Now, our two calls to <tt>printf</tt> type check, because the format string specializes <tt>printf</tt> to the appropriate type. 
+</p>
+<h2 id="head-222947ccdb8e9be636e5f01eb51ad36e369acdd6">The types of format characters</h2>
+<p>
+What should the type of format characters <tt>D</tt> and <tt>F</tt> be? Each format character requires an additional argument of the appropriate type to be supplied to <tt>printf</tt>. 
+</p>
+<p>
+Idea: guess the final type that will be needed for <tt>printf</tt> the format string and verify it with each format character.   
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> ('a, 'b) t   <I><FONT COLOR="#B22222">(* 'a = rest of type to verify, 'b = final type *)</FONT></I>
+</FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> ` : string -&gt; ('a, 'a) t  <I><FONT COLOR="#B22222">(* guess the type, which must be verified *)</FONT></I>
+<B><FONT COLOR="#A020F0">val</FONT></B> D: (int -&gt; 'a, 'b) t * string -&gt; ('a, 'b) t  <I><FONT COLOR="#B22222">(* consume an int *)</FONT></I>
+<B><FONT COLOR="#A020F0">val</FONT></B> F: (real -&gt; 'a, 'b) t * string -&gt; ('a, 'b) t  <I><FONT COLOR="#B22222">(* consume a real *)</FONT></I>
+<B><FONT COLOR="#A020F0">val</FONT></B> printf: (unit, 'a) t -&gt; 'a
+</PRE>
+<p>
+ 
+</p>
+<p>
+Don't worry.  In the end, type inference will guess and verify for us. 
+</p>
+<h2 id="head-6dd34f47d86bf18133dbe46190db3b9f050b3ee6">Understanding guess and verify</h2>
+<p>
+Now, let's build up a format string and a specialized <tt>printf</tt>. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">infix</FONT></B> D F
+<B><FONT COLOR="#A020F0">val</FONT></B> f0 = `<FONT COLOR="#BC8F8F"><B>&quot;here's an int &quot;</FONT></B>
+<B><FONT COLOR="#A020F0">val</FONT></B> f1 = f0 D <FONT COLOR="#BC8F8F"><B>&quot; and a real &quot;</FONT></B>
+<B><FONT COLOR="#A020F0">val</FONT></B> f2 = f1 F <FONT COLOR="#BC8F8F"><B>&quot;.\n&quot;</FONT></B>
+<B><FONT COLOR="#A020F0">val</FONT></B> p = printf f2
+</PRE>
+<p>
+ 
+</p>
+<p>
+These definitions yield the following types.  
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> f0: (int -&gt; real -&gt; unit, int -&gt; real -&gt; unit) t
+<B><FONT COLOR="#A020F0">val</FONT></B> f1: (real -&gt; unit, int -&gt; real -&gt; unit) t
+<B><FONT COLOR="#A020F0">val</FONT></B> f2: (unit, int -&gt; real -&gt; unit) t
+<B><FONT COLOR="#A020F0">val</FONT></B> p: int -&gt; real -&gt; unit
+</PRE>
+<p>
+ 
+</p>
+<p>
+So, <tt>p</tt> is a specialized <tt>printf</tt> function.  We could use it as follows 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> () = p <B><FONT COLOR="#5F9EA0">13</FONT></B> <B><FONT COLOR="#5F9EA0">17.0</FONT></B>
+<B><FONT COLOR="#A020F0">val</FONT></B> () = p <B><FONT COLOR="#5F9EA0">14</FONT></B> <B><FONT COLOR="#5F9EA0">19.0</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<h2 id="head-0de24a80c2f8581bf891b8ea4722f1e6f78df373">Type checking this using a functor</h2>
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> PRINTF =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> ('a, 'b) t
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> ` : string -&gt; ('a, 'a) t
+      <B><FONT COLOR="#A020F0">val</FONT></B> D: (int -&gt; 'a, 'b) t * string -&gt; ('a, 'b) t
+      <B><FONT COLOR="#A020F0">val</FONT></B> F: (real -&gt; 'a, 'b) t * string -&gt; ('a, 'b) t
+      <B><FONT COLOR="#A020F0">val</FONT></B> printf: (unit, 'a) t -&gt; 'a
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+
+<B><FONT COLOR="#0000FF">functor</FONT></B> Test (P: PRINTF) =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#0000FF">open</FONT></B> P
+      <B><FONT COLOR="#A020F0">infix</FONT></B> D F
+         
+      <B><FONT COLOR="#A020F0">val</FONT></B> () = printf (`<FONT COLOR="#BC8F8F"><B>&quot;here's an int &quot;</FONT></B>D<FONT COLOR="#BC8F8F"><B>&quot; and a real &quot;</FONT></B>F<FONT COLOR="#BC8F8F"><B>&quot;.\n&quot;</FONT></B>) <B><FONT COLOR="#5F9EA0">13</FONT></B> <B><FONT COLOR="#5F9EA0">17.0</FONT></B>
+      <B><FONT COLOR="#A020F0">val</FONT></B> () = printf (`<FONT COLOR="#BC8F8F"><B>&quot;here's three values (&quot;</FONT></B>D<FONT COLOR="#BC8F8F"><B>&quot;, &quot;</FONT></B>F <FONT COLOR="#BC8F8F"><B>&quot;, &quot;</FONT></B>F<FONT COLOR="#BC8F8F"><B>&quot;).\n&quot;</FONT></B>) <B><FONT COLOR="#5F9EA0">13</FONT></B> <B><FONT COLOR="#5F9EA0">17.0</FONT></B> <B><FONT COLOR="#5F9EA0">19.0</FONT></B>
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<h2 id="head-e8524d50c5bfba29773f4e572863f8d9f6f75372">Implementing Printf</h2>
+<p>
+Think of a format character as a formatter transformer.  It takes the formatter for the part of the format string before it and transforms it into a new formatter that first does the left hand bit, then does its bit, then continues on with the rest of the format string. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">structure</FONT></B> Printf: PRINTF =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> ('a, 'b) t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">T</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> (unit -&gt; 'a) -&gt; 'b
+
+      </FONT></B><B><FONT COLOR="#A020F0">fun</FONT></B> printf (T f) = f (<B><FONT COLOR="#A020F0">fn</FONT></B> () =&gt; ())
+
+      <B><FONT COLOR="#A020F0">fun</FONT></B> ` s = T (<B><FONT COLOR="#A020F0">fn</FONT></B> a =&gt; (print s; a ()))
+
+      <B><FONT COLOR="#A020F0">fun</FONT></B> D (T f, s) =
+         T (<B><FONT COLOR="#A020F0">fn</FONT></B> g =&gt; f (<B><FONT COLOR="#A020F0">fn</FONT></B> () =&gt; <B><FONT COLOR="#A020F0">fn</FONT></B> i =&gt; 
+                       (print (Int.toString i); print s; g ())))
+
+      <B><FONT COLOR="#A020F0">fun</FONT></B> F (T f, s) =
+         T (<B><FONT COLOR="#A020F0">fn</FONT></B> g =&gt; f (<B><FONT COLOR="#A020F0">fn</FONT></B> () =&gt; <B><FONT COLOR="#A020F0">fn</FONT></B> i =&gt; 
+                       (print (Real.toString i); print s; g ())))
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<h2 id="head-3056e3449c9eeb687ff4979d488318a55b86ad94">Testing printf</h2>
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">structure</FONT></B> Z = Test (Printf)
+</PRE>
+<p>
+ 
+</p>
+<h2 id="head-1ce26dacd016f9087315053e78d0fdf62930a8b3">User-definable formats</h2>
+<p>
+The definition of the format characters is pretty much the same. Within the <tt>Printf</tt> structure we can define a format character generator.  
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> newFormat: ('a -&gt; string) -&gt; ('a -&gt; 'b, 'c) t * string -&gt; ('b, 'c) t =
+   <B><FONT COLOR="#A020F0">fn</FONT></B> toString =&gt; <B><FONT COLOR="#A020F0">fn</FONT></B> (T f, s) =&gt;
+   T (<B><FONT COLOR="#A020F0">fn</FONT></B> th =&gt; f (<B><FONT COLOR="#A020F0">fn</FONT></B> () =&gt; <B><FONT COLOR="#A020F0">fn</FONT></B> a =&gt; (print (toString a); print s ; th ())))
+<B><FONT COLOR="#A020F0">val</FONT></B> D = <B><FONT COLOR="#A020F0">fn</FONT></B> z =&gt; newFormat Int.toString z
+<B><FONT COLOR="#A020F0">val</FONT></B> F = <B><FONT COLOR="#A020F0">fn</FONT></B> z =&gt; newFormat Real.toString z
+</PRE>
+<p>
+ 
+</p>
+<h2 id="head-647c5b70b462e300382ee62466a109f85f30bf29">A core Printf</h2>
+<p>
+We can now have a very small <tt>PRINTF</tt> signature, and define all the format strings externally to the core module. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> PRINTF =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> ('a, 'b) t
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> ` : string -&gt; ('a, 'a) t
+      <B><FONT COLOR="#A020F0">val</FONT></B> newFormat: ('a -&gt; string) -&gt; ('a -&gt; 'b, 'c) t * string -&gt; ('b, 'c) t
+      <B><FONT COLOR="#A020F0">val</FONT></B> printf: (unit, 'a) t -&gt; 'a
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+
+<B><FONT COLOR="#0000FF">structure</FONT></B> Printf: PRINTF =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> ('a, 'b) t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">T</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> (unit -&gt; 'a) -&gt; 'b
+
+      </FONT></B><B><FONT COLOR="#A020F0">fun</FONT></B> printf (T f) = f (<B><FONT COLOR="#A020F0">fn</FONT></B> () =&gt; ())
+
+      <B><FONT COLOR="#A020F0">fun</FONT></B> ` s = T (<B><FONT COLOR="#A020F0">fn</FONT></B> a =&gt; (print s; a ()))
+
+      <B><FONT COLOR="#A020F0">fun</FONT></B> newFormat toString (T f, s) =
+         T (<B><FONT COLOR="#A020F0">fn</FONT></B> th =&gt;
+            f (<B><FONT COLOR="#A020F0">fn</FONT></B> () =&gt; <B><FONT COLOR="#A020F0">fn</FONT></B> a =&gt;
+               (print (toString a)
+                ; print s
+                ; th ())))
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<h2 id="head-11e864f783f740962ac1010af348633b44a7adc1">Extending to fprintf</h2>
+<p>
+One can implement fprintf by threading the outstream through all the transformers. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> PRINTF =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> ('a, 'b) t
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> ` : string -&gt; ('a, 'a) t
+      <B><FONT COLOR="#A020F0">val</FONT></B> fprintf: (unit, 'a) t * TextIO.outstream -&gt; 'a
+      <B><FONT COLOR="#A020F0">val</FONT></B> newFormat: ('a -&gt; string) -&gt; ('a -&gt; 'b, 'c) t * string -&gt; ('b, 'c) t
+      <B><FONT COLOR="#A020F0">val</FONT></B> printf: (unit, 'a) t -&gt; 'a
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+
+<B><FONT COLOR="#0000FF">structure</FONT></B> Printf: PRINTF =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> out </FONT></B>=<FONT COLOR="#228B22"><B> TextIO.outstream
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> output = TextIO.output
+         
+      <B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> ('a, 'b) t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">T</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> (out -&gt; 'a) -&gt; out -&gt; 'b
+
+      </FONT></B><B><FONT COLOR="#A020F0">fun</FONT></B> fprintf (T f, out) = f (<B><FONT COLOR="#A020F0">fn</FONT></B> _ =&gt; ()) out
+
+      <B><FONT COLOR="#A020F0">fun</FONT></B> printf t = fprintf (t, TextIO.stdOut)
+
+      <B><FONT COLOR="#A020F0">fun</FONT></B> ` s = T (<B><FONT COLOR="#A020F0">fn</FONT></B> a =&gt; <B><FONT COLOR="#A020F0">fn</FONT></B> out =&gt; (output (out, s); a out))
+
+      <B><FONT COLOR="#A020F0">fun</FONT></B> newFormat toString (T f, s) =
+         T (<B><FONT COLOR="#A020F0">fn</FONT></B> g =&gt;
+            f (<B><FONT COLOR="#A020F0">fn</FONT></B> out =&gt; <B><FONT COLOR="#A020F0">fn</FONT></B> a =&gt;
+               (output (out, toString a)
+                ; output (out, s)
+                ; g out)))
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<h2 id="head-70440046a3dc2e079f23ee1c57dfa76669b732aa">Notes</h2>
+
+    <ul>
+
+    <li>
+<p>
+ Lesson: instead of using dependent types for a function, express  the the dependency in the type of the argument. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ If <tt>printf</tt> is partially applied, it will do the printing then  and there.  Perhaps this could be fixed with some kind of terminator. 
+</p>
+<p>
+ A syntactic or argument terminator is not necessary.  A formatter  can either be eager (as above) or lazy (as below).  A lazy formatter  accumulates enough state to print the entire string.  The simplest  lazy formatter concatenates the strings as they become available: 
+<pre class=code>
+<B><FONT COLOR="#0000FF">structure</FONT></B> PrintfLazyConcat: PRINTF =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> ('a, 'b) t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">T</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> (string -&gt; 'a) -&gt; string -&gt; 'b
+
+      </FONT></B><B><FONT COLOR="#A020F0">fun</FONT></B> printf (T f) = f print <FONT COLOR="#BC8F8F"><B>&quot;&quot;</FONT></B>
+
+      <B><FONT COLOR="#A020F0">fun</FONT></B> ` s = T (<B><FONT COLOR="#A020F0">fn</FONT></B> th =&gt; <B><FONT COLOR="#A020F0">fn</FONT></B> s' =&gt; th (s' ^ s))
+
+      <B><FONT COLOR="#A020F0">fun</FONT></B> newFormat toString (T f, s) =
+         T (<B><FONT COLOR="#A020F0">fn</FONT></B> th =&gt;
+            f (<B><FONT COLOR="#A020F0">fn</FONT></B> s' =&gt; <B><FONT COLOR="#A020F0">fn</FONT></B> a =&gt;
+               th (s' ^ toString a ^ s)))
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+ 
+</p>
+ It is somewhat more efficient to accumulate the strings as a list:  
+<pre class=code>
+<B><FONT COLOR="#0000FF">structure</FONT></B> PrintfLazyList: PRINTF =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> ('a, 'b) t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">T</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> (string list -&gt; 'a) -&gt; string list -&gt; 'b
+
+      </FONT></B><B><FONT COLOR="#A020F0">fun</FONT></B> printf (T f) = f (List.app print o List.rev) []
+
+      <B><FONT COLOR="#A020F0">fun</FONT></B> ` s = T (<B><FONT COLOR="#A020F0">fn</FONT></B> th =&gt; <B><FONT COLOR="#A020F0">fn</FONT></B> ss =&gt; th (s::ss))
+
+      <B><FONT COLOR="#A020F0">fun</FONT></B> newFormat toString (T f, s) =
+         T (<B><FONT COLOR="#A020F0">fn</FONT></B> th =&gt;
+            f (<B><FONT COLOR="#A020F0">fn</FONT></B> ss =&gt; <B><FONT COLOR="#A020F0">fn</FONT></B> a =&gt;
+               th (s::toString a::ss)))
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-07-13 21:21:04 by <span title="cs78147033.pp.htv.fi"><a href="VesaKarvonen">VesaKarvonen</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/ProductType
===================================================================
--- mlton/trunk/doc/guide/ProductType	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/ProductType	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,96 @@
+<!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>ProductType - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      ProductType
+    <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">
+<a href="StandardML">Standard ML</a> has special syntax for products (tuples). A product type is written as 
+<pre>t1 * t2 * ... * tN
+</pre> and a product pattern is written as
+<pre>(p1, p2, ..., pN)
+</pre>In most situations the syntax is quite convenient. However, there are special circumstances under which the syntax for product patterns can be cumbersome. <p>
+The problem is probably best known through parser combinators. A typical parser combinator library provides a combinator that has a type of the form 
+<pre>'a parser * 'b parser -&gt; ('a * 'b) parser
+</pre>and produces a parser for the concatenation of two parsers. When more than two parsers are concatenated, the result of the resulting parser is a nested structure of pairs 
+<pre>(...((p1, p2), p3)..., pN)
+</pre>which is somewhat cumbersome. 
+</p>
+<p>
+One way around this problem is to use a product datatype 
+<pre class=code>
+<B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> ('a, 'b) product </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">&amp;</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> 'a * 'b
+</FONT></B></PRE>
+ with an infix constructor 
+<pre class=code>
+<B><FONT COLOR="#A020F0">infix</FONT></B> &amp;
+</PRE>
+ 
+</p>
+<p>
+The type of the concatenation combinator then becomes 
+<pre>'a parser * 'b parser -&gt; ('a, 'b) product parser
+</pre>
+</p>
+<p>
+While this doesn't stop the nesting, it makes the pattern significantly easier to write. Instead of 
+<pre>(...((p1, p2), p3)..., pN)
+</pre>the pattern is written as 
+<pre>p1 &amp; p2 &amp; p3 &amp; ... &amp; pN
+</pre>which is considerably more concise. 
+</p>
+<p>
+The symbol <tt>&amp;</tt> is inspired by the Curry-Howard isomorphism: the proof of a conjunction <tt>(A&nbsp;&amp;&nbsp;B)</tt> is a pair of proofs <tt>(a,&nbsp;b)</tt>. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-07 17:57:29 by <span title="cs78147176.pp.htv.fi"><a href="VesaKarvonen">VesaKarvonen</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Profiling
===================================================================
--- mlton/trunk/doc/guide/Profiling	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Profiling	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,112 @@
+<!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>Profiling - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Profiling
+    <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">
+With MLton and <tt>mlprof</tt>, you can profile your program to find out bytes allocated, execution counts, or time spent in each function.  To profile you program, compile with <tt>-profile</tt> <em>kind</em>, where <em>kind</em> is one of <tt>alloc</tt>, <tt>count</tt>, or <tt>time</tt>.  Then, run the executable, which will write an <tt>mlmon.out</tt> file when it finishes.  You can then run <tt>mlprof</tt> on the executable and the <tt>mlmon.out</tt> file to see the performance data. <p>
+Here are the three kinds of profiling that MLton supports. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="ProfilingAllocation">ProfilingAllocation</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="ProfilingCounts">ProfilingCounts</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="ProfilingTime">ProfilingTime</a> 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+Going further 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="CallGraph">CallGraph</a>s to visualize profiling data. 
+</p>
+</li>
+    <li>
+<p>
+ <a href="ProfilingTheStack">ProfilingTheStack</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="MLtonProfile">MLtonProfile</a> to selectively profile parts of your program. 
+</p>
+</li>
+    <li>
+<p>
+ <a href="HowProfilingWorks">HowProfilingWorks</a>. 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-01 18:55:47 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/ProfilingAllocation
===================================================================
--- mlton/trunk/doc/guide/ProfilingAllocation	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/ProfilingAllocation	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,95 @@
+<!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>ProfilingAllocation - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      ProfilingAllocation
+    <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">
+To find out how many bytes each function allocates, compile your program with <tt>-profile&nbsp;alloc</tt>.  For example, suppose that <tt>list-rev.sml</tt> is the following. <p>
+<pre class=code><B><FONT COLOR="#A020F0">fun</FONT></B> append (l1, l2) =
+   <B><FONT COLOR="#A020F0">case</FONT></B> l1 <B><FONT COLOR="#A020F0">of</FONT></B>
+      [] =&gt; l2
+    | x :: l1 =&gt; x :: append (l1, l2)
+         
+<B><FONT COLOR="#A020F0">fun</FONT></B> rev l =
+   <B><FONT COLOR="#A020F0">case</FONT></B> l <B><FONT COLOR="#A020F0">of</FONT></B>
+      [] =&gt; []
+    | x :: l =&gt; append (rev l, [x])
+
+<B><FONT COLOR="#A020F0">val</FONT></B> l = List.tabulate (<B><FONT COLOR="#5F9EA0">1000</FONT></B>, <B><FONT COLOR="#A020F0">fn</FONT></B> i =&gt; i)
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = <B><FONT COLOR="#5F9EA0">1</FONT></B> + hd (rev l)
+</PRE>
+ 
+</p>
+<p>
+Compile and run <tt>list-rev</tt> as follows. 
+</p>
+
+<pre>% mlton -profile alloc list-rev.sml
+% ./list-rev
+% mlprof -show-line true list-rev mlmon.out
+6,030,136 bytes allocated (108,336 bytes by GC)
+       function          cur 
+----------------------- -----
+append  list-rev.sml: 1 97.6%
+&lt;gc&gt;                     1.8%
+&lt;main&gt;                   0.4%
+rev  list-rev.sml: 6     0.2%
+</pre><p>
+The data shows that most of the allocation is done by the <tt>append</tt> function defined on line 1 of <tt>list-rev.sml</tt>.  The table also shows how special functions like <tt>gc</tt> and <tt>main</tt> are handled: they are printed with surrounding brackets.  C functions are displayed similarly.  Here, as is usually the case, the allocation done by the garbage collector is due to stack growth. 
+</p>
+<p>
+The performance impact of allocation profiling is noticeable, because it inserts additional C calls for object allocation.  You can also compile with <tt>-profile&nbsp;alloc&nbsp;-profile-branch&nbsp;true</tt> to find out how much allocation is done in each branch of a function; see <a href="ProfilingCounts">ProfilingCounts</a> for more details on <tt>-profile-branch</tt>. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-12 17:51:37 by <span title="132.236.243.210"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/ProfilingCounts
===================================================================
--- mlton/trunk/doc/guide/ProfilingCounts	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/ProfilingCounts	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,123 @@
+<!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>ProfilingCounts - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      ProfilingCounts
+    <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">
+To find out how many times each function is called and how many times each branch is taken, compile your program with  <tt>-profile&nbsp;count&nbsp;-profile-branch&nbsp;true</tt>.  For example, suppose that <tt>tak.sml</tt> contains the following. <p>
+<pre class=code><B><FONT COLOR="#0000FF">structure</FONT></B> Tak =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#A020F0">fun</FONT></B> tak1 (x, y, z) =
+         <B><FONT COLOR="#A020F0">let</FONT></B>
+            <B><FONT COLOR="#A020F0">fun</FONT></B> tak2 (x, y, z) =
+               <B><FONT COLOR="#A020F0">if</FONT></B> y &gt;= x
+                  <B><FONT COLOR="#A020F0">then</FONT></B> z
+               <B><FONT COLOR="#A020F0">else</FONT></B>
+                  tak1 (tak2 (x - <B><FONT COLOR="#5F9EA0">1</FONT></B>, y, z),
+                        tak2 (y - <B><FONT COLOR="#5F9EA0">1</FONT></B>, z, x),
+                        tak2 (z - <B><FONT COLOR="#5F9EA0">1</FONT></B>, x, y))
+         <B><FONT COLOR="#A020F0">in</FONT></B>
+            <B><FONT COLOR="#A020F0">if</FONT></B> y &gt;= x
+               <B><FONT COLOR="#A020F0">then</FONT></B> z
+            <B><FONT COLOR="#A020F0">else</FONT></B>
+               tak1 (tak2 (x - <B><FONT COLOR="#5F9EA0">1</FONT></B>, y, z),
+                     tak2 (y - <B><FONT COLOR="#5F9EA0">1</FONT></B>, z, x),
+                     tak2 (z - <B><FONT COLOR="#5F9EA0">1</FONT></B>, x, y))
+         <B><FONT COLOR="#A020F0">end</FONT></B>
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+
+<B><FONT COLOR="#A020F0">val</FONT></B> <B><FONT COLOR="#A020F0">rec</FONT></B> f =
+   <B><FONT COLOR="#A020F0">fn</FONT></B> <B><FONT COLOR="#5F9EA0">0</FONT></B> =&gt; ()
+    | ~<B><FONT COLOR="#5F9EA0">1</FONT></B> =&gt; print <FONT COLOR="#BC8F8F"><B>&quot;this branch is not taken\n&quot;</FONT></B>
+    | n =&gt; (Tak.tak1 (<B><FONT COLOR="#5F9EA0">18</FONT></B>, <B><FONT COLOR="#5F9EA0">12</FONT></B>, <B><FONT COLOR="#5F9EA0">6</FONT></B>) ; f (n-<B><FONT COLOR="#5F9EA0">1</FONT></B>))
+
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = f <B><FONT COLOR="#5F9EA0">5000</FONT></B>
+
+<B><FONT COLOR="#A020F0">fun</FONT></B> uncalled () = ()
+</PRE>
+ 
+</p>
+<p>
+Compile with count profiling and run the program. 
+</p>
+
+<pre>% mlton -profile count -profile-branch true tak.sml
+% ./tak
+</pre><p>
+Display the profiling data, along with raw counts and file positions. 
+</p>
+
+<pre>% mlprof -raw true -show-line true tak mlmon.out
+623,610,002 ticks
+            function               cur       raw     
+--------------------------------- ----- -------------
+Tak.tak1.tak2  tak.sml: 5         38.2% (238,530,000)
+Tak.tak1.tak2.&lt;true&gt;  tak.sml: 7  27.5% (171,510,000)
+Tak.tak1  tak.sml: 3              10.7%  (67,025,000)
+Tak.tak1.&lt;true&gt;  tak.sml: 14      10.7%  (67,025,000)
+Tak.tak1.tak2.&lt;false&gt;  tak.sml: 9 10.7%  (67,020,000)
+Tak.tak1.&lt;false&gt;  tak.sml: 16      2.0%  (12,490,000)
+f  tak.sml: 23                     0.0%       (5,001)
+f.&lt;branch&gt;  tak.sml: 25            0.0%       (5,000)
+f.&lt;branch&gt;  tak.sml: 23            0.0%           (1)
+uncalled  tak.sml: 29              0.0%           (0)
+f.&lt;branch&gt;  tak.sml: 24            0.0%           (0)
+</pre><p>
+Branches are displayed with the usual lexical nesting followed by <tt>&lt;branch&gt;</tt> where the function name would normally be, or <tt>&lt;true&gt;</tt> or <tt>&lt;false&gt;</tt> for if-expressions.  Hence, it is best to run <tt>mlprof</tt> with <tt>-show-line&nbsp;true</tt> to help identify the branch. 
+</p>
+<p>
+One use of <tt>-profile&nbsp;count</tt> is as a code-coverage tool, to help find code in your program that hasn't been tested.  For this reason, <tt>mlprof</tt> displays functions and branches that have a count of zero.  As the above output shows, the branch on line 24 was never taken and the function defined on line 29 was never called.  To see zero counts, it is best to run <tt>mlprof</tt> with <tt>-raw&nbsp;true</tt>, since some code (e.g. the branch on line 23 above) will show up with <tt>0.0%</tt> but may still have been executed and hence have a nonzero raw count. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-12 17:48:06 by <span title="132.236.243.210"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/ProfilingTheStack
===================================================================
--- mlton/trunk/doc/guide/ProfilingTheStack	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/ProfilingTheStack	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,99 @@
+<!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>ProfilingTheStack - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      ProfilingTheStack
+    <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">
+For all forms of <a href="Profiling">Profiling</a>, you can use <tt>-profile-stack&nbsp;true</tt> to count the time spent (or bytes allocated) while a function is on the stack.  For example, suppose that <tt>list-rev.sml</tt> contains the following. <p>
+<pre class=code><B><FONT COLOR="#A020F0">fun</FONT></B> append (l1, l2) =
+   <B><FONT COLOR="#A020F0">case</FONT></B> l1 <B><FONT COLOR="#A020F0">of</FONT></B>
+      [] =&gt; l2
+    | x :: l1 =&gt; x :: append (l1, l2)
+         
+<B><FONT COLOR="#A020F0">fun</FONT></B> rev l =
+   <B><FONT COLOR="#A020F0">case</FONT></B> l <B><FONT COLOR="#A020F0">of</FONT></B>
+      [] =&gt; []
+    | x :: l =&gt; append (rev l, [x])
+
+<B><FONT COLOR="#A020F0">val</FONT></B> l = List.tabulate (<B><FONT COLOR="#5F9EA0">1000</FONT></B>, <B><FONT COLOR="#A020F0">fn</FONT></B> i =&gt; i)
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = <B><FONT COLOR="#5F9EA0">1</FONT></B> + hd (rev l)
+</PRE>
+ 
+</p>
+<p>
+Compile with stack profiling and then run the program. 
+<pre>% mlton -profile alloc -profile-stack true list-rev.sml
+% ./list-rev
+</pre>
+</p>
+<p>
+Display the profiling data. 
+</p>
+
+<pre>% mlprof -show-line true list-rev mlmon.out
+6,030,136 bytes allocated (108,336 bytes by GC)
+       function          cur  stack  GC 
+----------------------- ----- ----- ----
+append  list-rev.sml: 1 97.6% 97.6% 1.4%
+&lt;gc&gt;                     1.8%  0.0% 1.8%
+&lt;main&gt;                   0.4% 98.2% 1.8%
+rev  list-rev.sml: 6     0.2% 97.6% 1.8%
+</pre><p>
+In the above table, we see that <tt>rev</tt>, defined on line 6 of <tt>list-rev.sml</tt>, is only responsible for 0.2% of the allocation, but is on the stack while 97.6% of the allocation is done by the user program and while 1.8% of the allocation is done by the garbage collector. 
+</p>
+<p>
+The performance impact of <tt>-profile-stack&nbsp;true</tt> can be noticeable since there is some extra bookkeeping at every nontail call and return. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-12 17:50:23 by <span title="132.236.243.210"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/ProfilingTime
===================================================================
--- mlton/trunk/doc/guide/ProfilingTime	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/ProfilingTime	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,158 @@
+<!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>ProfilingTime - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      ProfilingTime
+    <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">
+To use <a href="Profiling">Profiling</a> to find out how much time is spent by each source function over an entire run of the program, compile with  <tt>-profile&nbsp;time</tt>.  For example, suppose that <tt>tak.sml</tt> contains the following. <p>
+<pre class=code><B><FONT COLOR="#0000FF">structure</FONT></B> Tak =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#A020F0">fun</FONT></B> tak1 (x, y, z) =
+         <B><FONT COLOR="#A020F0">let</FONT></B>
+            <B><FONT COLOR="#A020F0">fun</FONT></B> tak2 (x, y, z) =
+               <B><FONT COLOR="#A020F0">if</FONT></B> y &gt;= x
+                  <B><FONT COLOR="#A020F0">then</FONT></B> z
+               <B><FONT COLOR="#A020F0">else</FONT></B>
+                  tak1 (tak2 (x - <B><FONT COLOR="#5F9EA0">1</FONT></B>, y, z),
+                        tak2 (y - <B><FONT COLOR="#5F9EA0">1</FONT></B>, z, x),
+                        tak2 (z - <B><FONT COLOR="#5F9EA0">1</FONT></B>, x, y))
+         <B><FONT COLOR="#A020F0">in</FONT></B>
+            <B><FONT COLOR="#A020F0">if</FONT></B> y &gt;= x
+               <B><FONT COLOR="#A020F0">then</FONT></B> z
+            <B><FONT COLOR="#A020F0">else</FONT></B>
+               tak1 (tak2 (x - <B><FONT COLOR="#5F9EA0">1</FONT></B>, y, z),
+                     tak2 (y - <B><FONT COLOR="#5F9EA0">1</FONT></B>, z, x),
+                     tak2 (z - <B><FONT COLOR="#5F9EA0">1</FONT></B>, x, y))
+         <B><FONT COLOR="#A020F0">end</FONT></B>
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+
+<B><FONT COLOR="#A020F0">val</FONT></B> <B><FONT COLOR="#A020F0">rec</FONT></B> f =
+   <B><FONT COLOR="#A020F0">fn</FONT></B> <B><FONT COLOR="#5F9EA0">0</FONT></B> =&gt; ()
+    | ~<B><FONT COLOR="#5F9EA0">1</FONT></B> =&gt; print <FONT COLOR="#BC8F8F"><B>&quot;this branch is not taken\n&quot;</FONT></B>
+    | n =&gt; (Tak.tak1 (<B><FONT COLOR="#5F9EA0">18</FONT></B>, <B><FONT COLOR="#5F9EA0">12</FONT></B>, <B><FONT COLOR="#5F9EA0">6</FONT></B>) ; f (n-<B><FONT COLOR="#5F9EA0">1</FONT></B>))
+
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = f <B><FONT COLOR="#5F9EA0">5000</FONT></B>
+
+<B><FONT COLOR="#A020F0">fun</FONT></B> uncalled () = ()
+</PRE>
+ 
+</p>
+<p>
+Compile with time profiling and run the program. 
+<pre>% mlton -profile time tak.sml
+% ./tak
+</pre>
+</p>
+<p>
+Display the profiling data. 
+</p>
+
+<pre>% mlprof tak mlmon.out
+6.00 seconds of CPU time (0.00 seconds GC)
+function     cur 
+------------- -----
+Tak.tak1.tak2 75.8%
+Tak.tak1      24.2%
+</pre><p>
+This example shows how <tt>mlprof</tt> indicates lexical nesting via a sequence of period-separated names indicating the structures and functions in which a function definition is nested.  The profiling data shows that roughly three-quarters of the time is spent in the <tt>Tak.tak1.tak2</tt> function, while the rest is spent in <tt>Tak.tak1</tt>. 
+</p>
+<p>
+Display raw counts in addition to percentages with <tt>-raw&nbsp;true</tt>. 
+<pre>% mlprof -raw true tak mlmon.out
+6.00 seconds of CPU time (0.00 seconds GC)
+  function     cur    raw  
+------------- ----- -------
+Tak.tak1.tak2 75.8% (4.55s)
+Tak.tak1      24.2% (1.45s)
+</pre>
+</p>
+<p>
+Display the file name and line number for each function in addition to its name with <tt>-show-line&nbsp;true</tt>. 
+<pre>% mlprof -show-line true tak mlmon.out
+6.00 seconds of CPU time (0.00 seconds GC)
+        function           cur 
+------------------------- -----
+Tak.tak1.tak2  tak.sml: 5 75.8%
+Tak.tak1  tak.sml: 3      24.2%
+</pre>
+</p>
+<p>
+Time profiling is designed to have a very small performance impact. You can also compile with <tt>-profile&nbsp;time&nbsp;-profile-branch&nbsp;true</tt> to find out how much time is spent in each branch of a function; see <a href="ProfilingCounts">ProfilingCounts</a> for more details on <tt>-profile-branch</tt>. 
+</p>
+<h2 id="head-bcaa33a7ae44bd5042c37a9cdbea7f843b1cf7c8">Caveats</h2>
+<p>
+With <tt>-profile&nbsp;time</tt>, use of the following in your program will cause a run-time error, since they would interfere with the profiler signal handler. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>MLton.Itimer.set&nbsp;(MLton.Itimer.Prof,&nbsp;...)</tt> 
+</p>
+</li>
+    <li>
+<p>
+ <tt>MLton.Signal.setHandler&nbsp;(MLton.Signal.prof,&nbsp;...)</tt> 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+Also, because of the random sampling used to implement  <tt>-profile&nbsp;time</tt>, it is best to have a long running program (at least tens of seconds) in order to get reasonable time  
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-12 17:49:16 by <span title="132.236.243.210"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Projects
===================================================================
--- mlton/trunk/doc/guide/Projects	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Projects	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,168 @@
+<!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>Projects - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Projects
+    <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">
+We have lots of ideas for projects to improve MLton, many of which we do not have time to implement, or at least haven't started on yet. Here is a list of some of those improvements, ranging from the easy (1 week) to the difficult (several months).  If you have any interest in working on one of these, or some other improvement to MLton not listed here, please send mail to <a class="external" href="mailto:MLton@mlton.org"><img src="moin-email.png" alt="[MAILTO]" height="10" width="14">MLton@mlton.org</a>. 
+    <ul>
+
+    <li>
+<p>
+ Port to new platform: Windows (native, not Cygwin or MinGW), x86-64, ... 
+</p>
+</li>
+    <li>
+<p>
+ Source-level debugger 
+</p>
+</li>
+    <li>
+<p>
+ Heap profiler 
+</p>
+</li>
+    <li>
+<p>
+ Support NLFFI 
+</p>
+</li>
+    <li>
+<p>
+ Interfaces to libraries: Gtk+, OpenGL, ... 
+</p>
+</li>
+    <li>
+<p>
+ Additional constant types: Real80, ... 
+</p>
+</li>
+    <li>
+<p>
+ An IDE (possibly integrated with <a href="Eclipse">Eclipse</a>) 
+</p>
+</li>
+    <li>
+<p>
+ Port MLRISC and use for code generation 
+</p>
+</li>
+    <li>
+<p>
+ Optimizations 
+</p>
+</li>
+
+        <ul>
+
+        <li>
+<p>
+ Improved closure representation 
+</p>
+</li>
+
+                <ul>
+
+    Right now, MLton's closure conversion algorithm uses a simple flat closure to represent each function. 
+                </ul>
+
+
+        <li>
+<p>
+ Elimination of array bounds checks in loops 
+</p>
+</li>
+        <li>
+<p>
+ Elimination of overflow checks on array index computations 
+</p>
+</li>
+        <li>
+<p>
+ Common-subexpression elimination of repeated array subscripts 
+</p>
+</li>
+        <li>
+<p>
+ Loop-invariant code motion, especially for tuple selects 
+</p>
+</li>
+        <li>
+<p>
+ Auto-vectorization, for MMX/SSE/3DNow/AltiVec (see the <a class="external" href="http://gcc.gnu.org/projects/tree-ssa/vectorization.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">work done on GCC</a>) 
+</p>
+</li>
+
+        </ul>
+
+
+    <li>
+<p>
+ Analyses 
+</p>
+</li>
+
+        <ul>
+
+        <li>
+<p>
+ Uncaught exception analysis 
+</p>
+</li>
+</ul>
+
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-04-25 18:49:12 by <span title="adsl-63-195-184-50.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Pronounce
===================================================================
--- mlton/trunk/doc/guide/Pronounce	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Pronounce	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,63 @@
+<!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>Pronounce - 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">
+
+
+<link rel="Appendix" title="pronounce-mlton.mp3" href="http://mlton.org/pages/Pronounce/attachments/pronounce-mlton.mp3">
+</head>
+
+<body lang="en" dir="ltr">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Pronounce
+    <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">
+Here is <a href="http://mlton.org/pages/Pronounce/attachments/pronounce-mlton.mp3">how MLton sounds</a>.   <p>
+MLton is pronounced in two syllables, with stress on the first syllable.  The first syllable sounds like the word <em>mill</em> (as in "steel mill"), the second like the word <em>tin</em> (as in "cookie tin"). 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-10-27 19:29:45 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/PropertyList
===================================================================
--- mlton/trunk/doc/guide/PropertyList	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/PropertyList	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,150 @@
+<!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>PropertyList - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      PropertyList
+    <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">
+A property list is a dictionary-like data structure into which properties (name-value pairs) can be inserted and from which properties can be looked up by name.  The term comes from the Lisp language, where every symbol has a property list for storing information, and where the names are typically symbols and keys can be any type of value. <p>
+Here is an SML signature for property lists such that for any type of value a new property can be dynamically created to manipulate that type of value in a property list. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> PROPERTY_LIST =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t
+
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> new: unit -&gt; t
+      <B><FONT COLOR="#A020F0">val</FONT></B> newProperty: unit -&gt; {add: t * 'a -&gt; unit,
+                                peek: t -&gt; 'a option}
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<p>
+Here is a functor demonstrating the use of property lists.  It first creates a property list, then two new properties (of different types), and adds a value to the list for each property. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">functor</FONT></B> Test (P: PROPERTY_LIST) =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#A020F0">val</FONT></B> pl = P.new ()
+
+      <B><FONT COLOR="#A020F0">val</FONT></B> {add = addInt: P.t * int -&gt; unit, peek = peekInt} = P.newProperty ()
+      <B><FONT COLOR="#A020F0">val</FONT></B> {add = addReal: P.t * real -&gt; unit, peek = peekReal} = P.newProperty ()
+
+      <B><FONT COLOR="#A020F0">val</FONT></B> () = addInt (pl, <B><FONT COLOR="#5F9EA0">13</FONT></B>)
+      <B><FONT COLOR="#A020F0">val</FONT></B> () = addReal (pl, <B><FONT COLOR="#5F9EA0">17.0</FONT></B>)
+      <B><FONT COLOR="#A020F0">val</FONT></B> s1 = Int.toString (valOf (peekInt pl))
+      <B><FONT COLOR="#A020F0">val</FONT></B> s2 = Real.toString (valOf (peekReal pl))
+      <B><FONT COLOR="#A020F0">val</FONT></B> () = print (concat [s1, <FONT COLOR="#BC8F8F"><B>&quot; &quot;</FONT></B>, s2, <FONT COLOR="#BC8F8F"><B>&quot;\n&quot;</FONT></B>])
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<p>
+Applied to an appropriate implementation <tt>PROPERTY_LIST</tt>, the <tt>Test</tt> functor will produce the following output. 
+<pre>13 17.0
+</pre>
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+<p>
+Because property lists can hold values of any type, their implementation requires a <a href="UniversalType">UniversalType</a>.  Given that, a property list is simply a list of elements of the universal type.  Adding a property adds to the front of the list, and looking up a property scans the list. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">functor</FONT></B> PropertyList (U: UNIVERSAL_TYPE): PROPERTY_LIST =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">T</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> U.t list ref
+
+      </FONT></B><B><FONT COLOR="#A020F0">fun</FONT></B> new () = T (ref [])
+
+      <B><FONT COLOR="#A020F0">fun</FONT></B> <FONT COLOR="#228B22"><B>'a</FONT></B> newProperty () =
+         <B><FONT COLOR="#A020F0">let</FONT></B>
+            <B><FONT COLOR="#A020F0">val</FONT></B> (inject, out) = U.embed ()
+            <B><FONT COLOR="#A020F0">fun</FONT></B> add (T r, a: 'a): unit = r := inject a :: (!r)
+            <B><FONT COLOR="#A020F0">fun</FONT></B> peek (T r) =
+               Option.map (valOf o out) (List.find (isSome o out) (!r))
+         <B><FONT COLOR="#A020F0">in</FONT></B>
+            {add = add, peek = peek}
+         <B><FONT COLOR="#A020F0">end</FONT></B>
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<p>
+If <tt>U:&nbsp;UNIVERSAL_TYPE</tt>, then we can test our code as follows. 
+<pre class=code>
+<B><FONT COLOR="#0000FF">structure</FONT></B> Z = Test (PropertyList (U))
+</PRE>
+ 
+</p>
+<p>
+Of course, a serious implementation of property lists would have to handle duplicate insertions of the same property, as well as the removal of elements in order to avoid space leaks. 
+</p>
+<h2 id="head-a4bc8bf5caf54b18cea9f58e83dd4acb488deb17">Also see</h2>
+<p>
+MLton relies heavily on property lists for attaching information to syntax tree nodes in its intermediate languages.  See  
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/lib/mlton/basic/property-list.sig?view=markup">property-list.sig</a>
+  
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/lib/mlton/basic/property-list.fun?view=markup">property-list.fun</a>
+. 
+</p>
+<p>
+<a class="nonexistent" href="MLRISC">MLRISC</a> <a href = "References#LeungGeorge98">uses property lists extensively</a>. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:30:27 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/RSSA
===================================================================
--- mlton/trunk/doc/guide/RSSA	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/RSSA	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,76 @@
+<!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>RSSA - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      RSSA
+    <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">
+An <a href="IntermediateLanguage">IntermediateLanguage</a>,  translated from <a href="SSA2">SSA2</a> by <a href="ToRSSA">ToRSSA</a>,  optimized by <a href="RSSASimplify">RSSASimplify</a>, and  translated by <a href="ToMachine">ToMachine</a> to <a href="Machine">Machine</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+RSSA is a <a href="IntermediateLanguage">IntermediateLanguage</a> that makes representation decisions explicit. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/backend/rssa.sig?view=markup">rssa.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/backend/rssa.fun?view=markup">rssa.fun</a>
+ <h2 id="head-a6de4b535fedeaa8890bd890b60fe09f87b5f96a">Type Checking</h2>
+<p>
+The new type language is aimed at expressing bit-level control over layout and associated packing of data representations.  There are singleton types that denote constants, other atomic types for things like integers and reals, and arbitrary sum types and sequence (tuple) types.  The big change to the type system is that type checking is now based on subtyping, not type equality.  So, for example, the singleton type 0xFFFFEEBB whose only inhabitant is the eponymous constant is a subtype of the type Word32. 
+</p>
+<h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+<p>
+<strong></strong>SSA<strong></strong> is an abbreviation for Static Single Assignment.   The RSSA <a href="IntermediateLanguage">IntermediateLanguage</a> is a variant of <strong></strong>SSA<strong></strong>. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:29:58 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/RSSAShrink
===================================================================
--- mlton/trunk/doc/guide/RSSAShrink	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/RSSAShrink	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,91 @@
+<!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>RSSAShrink - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      RSSAShrink
+    <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">
+An optimization pass for the <a href="RSSA">RSSA</a> <a href="IntermediateLanguage">IntermediateLanguage</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Implements a whole family of compile-time reductions, like 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ constant folding, copy propagation 
+</p>
+</li>
+    <li>
+<p>
+ inline the <tt>Goto</tt> to a block with a unique predecessor 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/shrink.sig?view=markup">shrink.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/shrink.fun?view=markup">shrink.fun</a>
+<br>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/shrink.sig?view=markup">shrink.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/shrink.fun?view=markup">shrink.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:29:43 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/RSSASimplify
===================================================================
--- mlton/trunk/doc/guide/RSSASimplify	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/RSSASimplify	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,131 @@
+<!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>RSSASimplify - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      RSSASimplify
+    <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 optimization passes for the <a href="RSSA">RSSA</a> <a href="IntermediateLanguage">IntermediateLanguage</a> are collected and controlled by the <tt>Backend</tt> functor (
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/backend/backend.sig?view=markup">backend.sig</a>
+,
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/backend/backend.fun?view=markup">backend.fun</a>
+).   <p>
+The following optimization pass is implemented: 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="RSSAShrink">RSSAShrink</a> 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+The following implementation passes are implemented: 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="ImplementHandlers">ImplementHandlers</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="ImplementProfiling">ImplementProfiling</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="InsertLimitChecks">InsertLimitChecks</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="InsertSignalChecks">InsertSignalChecks</a> 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+The optimization passes can be controlled from the command-line by the options 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>diag-pass&nbsp;&lt;pass&gt;</tt> -- keep diagnostic info for pass 
+</p>
+</li>
+    <li>
+<p>
+ <tt>drop-pass&nbsp;&lt;pass&gt;</tt> -- omit optimization pass 
+</p>
+</li>
+    <li>
+<p>
+ <tt>keep-pass&nbsp;&lt;pass&gt;</tt> -- keep the results of pass 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:29:29 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/RayRacine
===================================================================
--- mlton/trunk/doc/guide/RayRacine	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/RayRacine	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,107 @@
+<!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>RayRacine - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      RayRacine
+    <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">
+Using SML in some <em>Semantic Web</em> stuff.   Anyone interested in similar, please contact me.  Grey<strong></strong>Lensman on #sml on IRC or rracine at this domain adelphia with a dot here net.  <p>
+Current areas of coding. 
+</p>
+
+    <ol type="1">
+
+    <li>
+<p>
+Pretty solid, high performance Rete implementation - base functionality is complete. 
+</p>
+</li>
+    <li>
+<p>
+N3 parser - mostly complete 
+</p>
+</li>
+    <li>
+<p>
+RDF parser based on fxg - not started. 
+</p>
+</li>
+    <li>
+<p>
+Swerve HTTP server - 1/2 done. 
+</p>
+</li>
+    <li>
+<p>
+SPARQL implementation - not started. 
+</p>
+</li>
+    <li>
+<p>
+Persistent engine based on BerkelyDB - not started. 
+</p>
+</li>
+    <li>
+<p>
+Native implementation of Postgresql protocol - underway, ways to go. 
+</p>
+</li>
+    <li>
+<p>
+I also have a small change to the MLton compiler to add <a class="nonexistent" href="PackWord">PackWord</a>&lt;N&gt; - changes compile but needs some more work, clean-up and unit tests. 
+</p>
+</li>
+</ol>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-29 19:56:50 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Redundant
===================================================================
--- mlton/trunk/doc/guide/Redundant	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Redundant	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,72 @@
+<!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>Redundant - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Redundant
+    <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">
+An optimization pass for the <a href="SSA">SSA</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="SSASimplify">SSASimplify</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+??? 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/redundant.sig?view=markup">redundant.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/redundant.fun?view=markup">redundant.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+<p>
+The reason Redundant got put in was due to some output of the <a href="ClosureConvert">ClosureConvert</a> pass converter where the environment record, or components of it, were passed around in several places.  That may have been more relevant with polyvariant analyses (which are long gone). But it still seems possibly relevant, especially with more aggressive flattening, which should reveal some fields in nested closure records that are redundant. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:29:15 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/RedundantTests
===================================================================
--- mlton/trunk/doc/guide/RedundantTests	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/RedundantTests	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,76 @@
+<!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>RedundantTests - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      RedundantTests
+    <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">
+An optimization pass for the <a href="SSA">SSA</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="SSASimplify">SSASimplify</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Simplify conditionals whose results are implied by a previous conditional test. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/redundant-tests.sig?view=markup">redundant-tests.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/redundant-tests.fun?view=markup">redundant-tests.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+<p>
+An additional test will sometimes eliminate the overflow test when adding or subtracting 1.  In particular, it will eliminate it in the following cases: 
+<pre>if x &lt; y
+  then ... x + 1 ...
+else ... y - 1 ...
+</pre>
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:28:59 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/RefFlatten
===================================================================
--- mlton/trunk/doc/guide/RefFlatten	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/RefFlatten	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,108 @@
+<!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>RefFlatten - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      RefFlatten
+    <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">
+<p>
+An optimization pass for the <a href="SSA2">SSA2</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="SSA2Simplify">SSA2Simplify</a>. 
+</p>
+<h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Flatten a <tt>ref</tt> cell into its containing object. The idea is to replace, where possible, a type like 
+<pre>   (int ref * real)
+</pre>with a type like 
+<pre>   (int[m] * real)
+</pre>where the <tt>[m]</tt> indicates a mutable field of a tuple.  
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/ref-flatten.sig?view=markup">ref-flatten.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/ref-flatten.fun?view=markup">ref-flatten.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+<p>
+The savings is obvious, I hope.  We avoid an extra heap-allocated object for the <tt>ref</tt>, which in the above case saves two words.  We also save the time and code for the extra indirection at each get and set.  There are lots of useful data structures (singly-linked and doubly-linked lists, union-find, fibonacci heaps, ...) that I believe we are paying through the nose right now because of the absence of ref flattening. 
+</p>
+<p>
+The idea is to compute for each occurrence of a <tt>ref</tt> type in the program whether or not that <tt>ref</tt> can be represented as an offset of some object (constructor or tuple).  As before, a unification-based whole-program with deep abstract values makes sure the analysis is consistent. 
+</p>
+<p>
+The only syntactic part of the analysis that remains is the part that checks that for a variable bound to a value constructed by <tt>Ref_ref</tt>: 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ the object allocation is in the same block.  This is pretty draconian, and it would be nice to generalize it some day to allow flattening as long as the <tt>ref</tt> allocation and object allocation "line up one-to-one" in the same loop-free chunk of code. 
+</p>
+</li>
+    <li>
+<p>
+ updates occur in the same block (and hence it is safe-for-space because the containing object is still alive).  It would be nice to relax this to allow updates as long as it can be proved that the container is live. 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+Prevent flattening of <tt>unit&nbsp;ref</tt>s. 
+</p>
+<p>
+RefFlatten is safe for space.  The idea is to prevent a <tt>ref</tt> being flattened into an object that has a component of unbounded size (other than possibly the <tt>ref</tt> itself) unless we can prove that at each point the <tt>ref</tt> is live, then the containing object is live too.  I used a pretty simple approximation to liveness. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:28:44 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/References
===================================================================
--- mlton/trunk/doc/guide/References	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/References	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,804 @@
+<!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>References - 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">
+
+
+<link rel="Appendix" title="CejtinEtAl00.ps.gz" href="http://mlton.org/pages/References/attachments/CejtinEtAl00.ps.gz">
+<link rel="Appendix" title="FluetWeeks01.ps.gz" href="http://mlton.org/pages/References/attachments/FluetWeeks01.ps.gz">
+</head>
+
+<body lang="en" dir="ltr">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      References
+    <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">
+<a href="#A">A</a> <a href="#B">B</a> <a href="#C">C</a> <a href="#D">D</a> <a href="#E">E</a> <a href="#F">F</a> <a href="#G">G</a> <a href="#H">H</a> <a href="#I">I</a> <a href="#J">J</a> <a href="#K">K</a> <a href="#L">L</a> <a href="#M">M</a> <a href="#N">N</a> <a href="#O">O</a> <a href="#P">P</a> <a href="#Q">Q</a> <a href="#R">R</a> <a href="#S">S</a> <a href="#T">T</a> <a href="#U">U</a> <a href="#V">V</a> <a href="#W">W</a> <a href="#X">X</a> <a href="#Y">Y</a> <a href="#Z">Z</a> <p>
+<a id="A"></a> 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a id="Appel92"></a>  <a class="external" href="http://us.cambridge.org/titles/catalogue.asp?isbn=0521416957"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Compiling with Continuations</a>  (<a class="external" href="http://www.addall.com/New/submitNew.cgi?query=0-521-41695-7&amp;type=ISBN&amp;location=10000&amp;state=&amp;dispCurr=USD"><img src="moin-www.png" alt="[WWW]" height="11" width="11">addall</a>).  ISBN 0521416957.  Andrew W. Appel.  Cambridge University Press, 1992. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a id="AppelJim97"></a>  Shrinking Lambda Expressions in Linear Time.  Andrew Appel and Trevor Jim.  <a href="#JFP">JFP</a>, 7(5):515-540, 1997.   
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a id="Appel98"></a>  <a class="external" href="http://us.cambridge.org/titles/catalogue.asp?isbn=0521582741"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Modern Compiler Implementation in ML</a>  (<a class="external" href="http://www.addall.com/New/submitNew.cgi?query=0-521-58274-1&amp;type=ISBN&amp;location=10000&amp;state=&amp;dispCurr=USD"><img src="moin-www.png" alt="[WWW]" height="11" width="11">addall</a>).  ISBN 0521582741  Andrew W. Appel.  Cambridge University Press, 1998. 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+<a id="B"></a> 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a id="BaudinetMacqueen85"></a>  <a class="external" href="http://citeseer.ist.psu.edu/baudinet85tree.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Tree Pattern Matching for ML</a>.  Marianne Baudinet, David Mac<strong></strong>Queen.  1985. 
+</p>
+</li>
+
+            <ul>
+
+   <em>Describes the match compiler used in an early version of    <a href="SMLNJ">SML/NJ</a></em>.  
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <a id="BentonEtAl98"></a>  <a class="external" href="http://citeseer.ist.psu.edu/benton98compiling.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Compiling Standard ML to Java Bytecodes</a>.  Nick Benton, Andrew Kennedy, and George Russell.  <a href="#ICFP">ICFP</a> 1998. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a id="BentonKennedy99"></a>  <a class="external" href="http://citeseer.ist.psu.edu/benton99interlanguage.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Interlanguage Working Without Tears: Blending SML with Java</a>.  Nick Benton and Andrew Kennedy.  <a href="#ICFP">ICFP</a> 1999. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a id="BentonKennedy01"></a>  <a class="external" href="http://citeseer.ist.psu.edu/388363.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Exceptional Syntax</a>.  Nick Benton and Andrew Kennedy.  <a href="#JFP">JFP</a>, 11(4):395-410, 2001. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a id="Benton05"></a>  <a class="external" href="http://research.microsoft.com/~nick/benton03.pdf"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Embedded Interpreters</a>.  Nick Benton.  <a href="#JFP">JFP</a>, 2005. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a id="BentonEtAl04"></a>  <a class="external" href="http://www.research.microsoft.com/~nick/p53-Benton.pdf"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Adventures in Interoperability: The SML.NET Experience</a>.  Nick Benton, Andrew Kennedy, and Claudio Russo.  <a href="#PPDP">PPDP</a> 2004. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a id="Berthomieu00"></a>  <a class="external" href="http://www.laas.fr/~bernard/oo/ooml.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">OO Programming styles in ML</a>.  Bernard Berthomieu.  LAAS Report #2000111, 2000. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a id="Blume01"></a>  <a class="external" href="http://citeseer.ist.psu.edu/blume01nolongerforeign.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">No-Longer-Foreign: Teaching an ML compiler to speak C "natively"</a>.  Matthias Blume.  <a href="#BABEL">BABEL</a> 2001. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a id="Boehm03"></a>  <a class="external" href="http://citeseer.ist.psu.edu/640926.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Destructors, Finalizers, and Synchronization</a>.  Hans Boehm.  <a href="#POPL">POPL</a> 2003. 
+</p>
+</li>
+
+        <ul>
+
+  <em>Discusses a number of issues in the design of finalizers.  Many   of the design choices are consistent with <a href="MLtonFinalizable">MLtonFinalizable</a>.</em> 
+        </ul>
+
+
+
+    </ul>
+
+
+<p>
+<a id="C"></a> 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a id="CejtinEtAl00"></a>  <a href="http://mlton.org/pages/References/attachments/CejtinEtAl00.ps.gz">Flow-directed Closure Conversion for Typed Languages</a>.  Henry Cejtin, Suresh Jagannathan, and Stephen Weeks.  <a href="#ESOP">ESOP</a> 2000. 
+</p>
+</li>
+
+        <ul>
+
+  <em>Describes MLton's closure-conversion algorithm, which translates   from its simply-typed higher-order intermediate language to its   simply-typed first-order intermediate language.</em> 
+        </ul>
+
+
+
+    </ul>
+
+
+<p>
+<a id="D"></a> 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a id="Danvy98"></a>  <a class="external" href="http://citeseer.ist.psu.edu/danvy98functional.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Functional Unparsing</a>.  Olivier Danvy.  BRICS Technical Report RS 98-12, 1998. 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+<a id="E"></a> 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a id="Elsman03"></a>  <a class="external" href="http://www.it-c.dk/research/mlkit/papers.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Garbage Collection Safety for Region-based Memory Management</a>.  Martin Elsman.   <a href="#TLDI">TLDI</a> 2003. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a id="Elsman04"></a>  <a class="external" href="http://www.itu.dk/people/mael/papers.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Type-Specialized Serialization with Sharing</a>  Martin Elsman.  University of Copenhagen. IT University Technical  Report TR-2004-43, 2004.  
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+<a id="F"></a> 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a id="FelleisenFreidman98"></a>  <a class="external" href="http://mitpress.mit.edu/catalog/item/default.asp?ttype=2&amp;tid=4787"><img src="moin-www.png" alt="[WWW]" height="11" width="11">The Little MLer</a>  (<a class="external" href="http://www3.addall.com/New/submitNew.cgi?query=026256114X&amp;type=ISBN"><img src="moin-www.png" alt="[WWW]" height="11" width="11">addall</a>).  ISBN 026256114X.  Matthias Felleisen and Dan Freidman.  The MIT Press, 1998. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a id="FlattFindler04"></a>  <a class="external" href="http://www.cs.utah.edu/plt/kill-safe/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Kill-Safe Synchronization Abstractions</a>.  Matthew Flatt and Robert Bruce Findler.  <a href="#PLDI">PLDI</a> 2004. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a id="FluetWeeks01"></a>  <a href="http://mlton.org/pages/References/attachments/FluetWeeks01.ps.gz">Contification Using Dominators</a>.  Matthew Fluet and Stephen Weeks.  <a href="#ICFP">ICFP</a> 2001. 
+</p>
+</li>
+
+        <ul>
+
+  <em>Describes contification, a generalization of tail-recursion   elimination that is an optimization operating on MLton's static   single assignment (SSA) intermediate language.</em> 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <a id="FluetPucella02"></a>  <a class="external" href="http://arxiv.org/abs/cs.PL/0403034"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Phantom Types and Subtyping</a>.  Matthew Fluet and Riccardo Pucella.  <a href="#TCS">TCS</a> 2002. 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+<a id="G"></a> 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a id="GansnerReppy04"></a>  <a class="external" href="http://titles.cambridge.org/catalogue.asp?isbn=0521794781"><img src="moin-www.png" alt="[WWW]" height="11" width="11">The Standard ML Basis Library</a>.  (<a class="external" href="http://www3.addall.com/New/submitNew.cgi?query=0521794781&amp;type=ISBN"><img src="moin-www.png" alt="[WWW]" height="11" width="11">addall</a>)  ISBN 0521794781.  Emden R. Gansner and John H. Reppy.  Cambridge University Press, 2004. 
+</p>
+</li>
+
+        <ul>
+
+  <em>An introduction and overview of the <a href="BasisLibrary"> SML Basis Library</a>,    followed by a detailed description of each module.  The module   descriptions are also available <a class="external" href="http://mlton.org/basis/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">online</a>.</em> 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <a id="GrossmanEtAl02"></a>  <a class="external" href="http://www.eecs.harvard.edu/~greg/cyclone/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Region-based Memory Management in Cyclone</a>.  Dan Grossman, Greg Morrisett, Trevor Jim, Michael Hicks, Yanling  Wang, and James Cheney.   <a href="#PLDI">PLDI</a> 2002. 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+<a id="H"></a> 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a id="HallenbergEtAl02"></a>  <a class="external" href="http://www.it-c.dk/research/mlkit/papers.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Combining Region Inference and Garbage Collection</a>.  Niels Hallenberg, Martin Elsman, and Mads Tofte.   <a href="#PLDI">PLDI</a> 2002. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a id="HansenRichel99"></a>  <a class="external" href="http://www.it.dtu.dk/introSML"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Introduction to Programming using SML</a>  (<a class="external" href="http://www3.addall.com/New/submitNew.cgi?query=0201398206&amp;type=ISBN"><img src="moin-www.png" alt="[WWW]" height="11" width="11">addall</a>).  ISBN 0201398206.  Michael R. Hansen, Hans Rischel.  Addison-Wesley, 1999. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a id="HicksEtAl03"></a>  <a class="external" href="http://www.eecs.harvard.edu/~greg/cyclone/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Safe and Flexible Memory Management in Cyclone</a>.  Mike Hicks, Greg Morrisett, Dan Grossman, and Trevor Jim.    University of Maryland Technical Report CS-TR-4514, 2003. 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+<a id="I"></a> <a id="J"></a> 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a id="Jones99"></a>  <a class="external" href="http://www.cs.kent.ac.uk/people/staff/rej/gcbook/gcbook.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Garbage Collection: Algorithms for Automatic Memory Management</a>  (<a class="external" href="http://www3.addall.com/New/submitNew.cgi?query=0471941484&amp;type=ISBN"><img src="moin-www.png" alt="[WWW]" height="11" width="11">addall</a>).  ISBN 0471941484.  Richard Jones.  John Wiley &amp; Sons, 1999. 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+<a id="K"></a> 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a id="Kahrs93"></a>  <a class="external" href="http://www.cs.kent.ac.uk/pubs/1993/569/index.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Mistakes and ambiguities in the definition of Standard ML</a>.  Stefan Kahrs.  University of Edinburgh LFCS Report ECS-LFCS-93-257, 1993. 
+</p>
+<p>
+ There are also the <a class="external" href="http://www.cs.kent.ac.uk/~smk/errors-new.ps.Z"><img src="moin-www.png" alt="[WWW]" height="11" width="11">addenda</a>  published in 1996. 
+</p>
+</li>
+
+        <ul>
+
+  <em>Describes a number of problems with the    <a href = "References#MilnerEtAl90">1990 Definition</a>, many of which were fixed   in the <a href = "References#MilnerEtAl97">1997 Definition</a>.</em> 
+        </ul>
+
+
+
+    </ul>
+
+
+<p>
+<a id="L"></a> 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a id="Lang99"></a>  <a class="external" href="http://citeseer.nj.nec.com/lang99faster.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Faster Algorithms for Finding Minimal Consistent DFAs</a>.  Kevin Lang. 1999. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a id="LarsenNiss04"></a>  <a class="external" href="http://www.it-c.dk/~hniss/publications/freenix2004.pdf"><img src="moin-www.png" alt="[WWW]" height="11" width="11">mGTK: An SML binding of Gtk+</a>.  Ken Larsen and Henning Niss.  USENIX Annual Technical Conference, 2004. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a id="Leroy90"></a>  <a class="external" href="http://citeseer.ist.psu.edu/leroy90zinc.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">The ZINC experiment: an economical implementation of the ML language</a>.  Xavier Leroy.  Technical report 117, INRIA, 1990. 
+</p>
+</li>
+
+            <ul>
+
+   <em>A detailed explanation of the design and implementation of a    bytecode compiler and interpreter for ML with a machine model aimed    at efficient implementation.</em> 
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <a id="Leroy93"></a>  <a class="external" href="http://pauillac.inria.fr/~xleroy/leroy.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Polymorphism by name for references and continuations</a>.  Xavier Leroy.  <a href="#POPL">POPL</a> 1993. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a id="LeungGeorge98"></a>  <a class="external" href="http://citeseer.ist.psu.edu/637416.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">MLRISC Annotations</a>.  Allen Leung and Lal George. 1998. 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+<a id="M"></a> 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a id="MarlowEtAl01"></a>  <a class="external" href="http://www.haskell.org/~simonmar/papers/async.ps.gz"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Asynchronous exceptions in Haskell</a>.  Simon Marlow, Simon Peyton Jones, Andy Moran and John Reppy.  <a href="#PLDI">PLDI</a> 2001. 
+</p>
+</li>
+
+        <ul>
+
+  <em>An asynchronous exception is a signal that one thread can send to   another, and is useful for the receiving thread to treat as an   exception so that it can clean up locks or other state relevant to   its current context.</em>   <br>
+    There are a couple of earlier versions of this paper floating   around, from August and November 2000.  Make sure and get the   official version from May 2001 (linked above). 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <a id="MeierNorgaard93"></a>  <a class="external" href="http://www.itu.dk/stud/speciale/bmkn/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">A Just-In-Time backend for Moscow ML 2.00 in SML</a>.  Bjarke Meier, Kristian Nørgaard.  Masters Thesis, 2003. 
+</p>
+</li>
+
+            <ul>
+
+   <em>A just-in-time compiler using GNU Lightning, showing a speedup of    up to four times over Moscow ML's usual bytecode interpreter.</em>     <br>
+ The full report is only available in Danish. 
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <a id="Milner82"></a>  <a class="external" href="http://www.dcs.ed.ac.uk/home/stg/tutorial/papers/evolved.pdf"><img src="moin-www.png" alt="[WWW]" height="11" width="11">How ML Evolved</a>.  Robin Milner.  Polymorphism--The ML/LCF/Hope Newsletter, 1983. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a id="MilnerTofte90"></a>  <a class="external" href="http://mitpress.mit.edu/catalog/item/default.asp?ttype=2&amp;tid=8988"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Commentary on Standard ML</a> (<a class="external" href="http://www.itu.dk/people/tofte/publ/1991commentaryBody.pdf"><img src="moin-www.png" alt="[WWW]" height="11" width="11">online pdf</a>).  (<a class="external" href="http://www3.addall.com/New/submitNew.cgi?query=0262631327&amp;type=ISBN"><img src="moin-www.png" alt="[WWW]" height="11" width="11">addall</a>)  ISBN 0262631327.  Robin Milner and Mads Tofte.  The MIT Press, 1990. 
+</p>
+</li>
+
+        <ul>
+
+  <em>Introduces and explains the notation and approach used in   <a href="#MilnerEtAl90">The Definition of Standard ML</a>.</em> 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <a id="MilnerEtAl90"></a>  <a class="external" href="http://mitpress.mit.edu/catalog/item/default.asp?ttype=2&amp;tid=7945"><img src="moin-www.png" alt="[WWW]" height="11" width="11">The Definition of Standard ML</a>.  (<a class="external" href="http://www3.addall.com/New/submitNew.cgi?query=0262631326&amp;type=ISBN"><img src="moin-www.png" alt="[WWW]" height="11" width="11">addall</a>)  ISBN 0262631326.  Robin Milner, Mads Tofte, and Robert Harper.  The MIT Press, 1990. 
+</p>
+</li>
+
+        <ul>
+
+  <em>Superseded by <a href="#MilnerEtAl97">The Definition of Standard ML (Revised)</a>.   Accompanied by the <a href="#MilnerTofte90">Commentary on Standard ML</a>.</em> 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <a id="MilnerEtAl97"></a>  <a class="external" href="http://mitpress.mit.edu/catalog/item/default.asp?ttype=2&amp;tid=3874"><img src="moin-www.png" alt="[WWW]" height="11" width="11">The Definition of Standard ML (Revised)</a>.  (<a class="external" href="http://www3.addall.com/New/submitNew.cgi?query=0262631814&amp;type=ISBN"><img src="moin-www.png" alt="[WWW]" height="11" width="11">addall</a>)  ISBN 0262631814.  Robin Milner, Mads Tofte, Robert Harper, and David Mac<strong></strong>Queen.  The MIT Press, 1997. 
+</p>
+</li>
+
+        <ul>
+
+  <em>A terse and formal specification of Standard ML's syntax and   semantics.  Supersedes an <a href="#MilnerEtAl90">older version</a>.</em> 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <a id="Morentsen99"></a>  <a class="external" href="http://www.daimi.au.dk/CPnets/workshop99/papers/Mortensen.ps.gz"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Automatic Code Generation from Coloured Petri Nets for an Access Control System</a>.  Kjeld H. Mortensen.  Workshop on Practical Use of Coloured Petri Nets and Design/CPN, 1999. 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+<a id="N"></a> 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a id="Neumann99"></a>  <a class="external" href="http://citeseer.ist.psu.edu/412760.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">fxp - Processing Structured Documents in SML</a>.  Andreas Neumann.  Scottish Functional Programming Workshop, 1999. 
+</p>
+</li>
+
+            <ul>
+
+   <em>Describes <a class="external" href="http://atseidl2.informatik.tu-muenchen.de/~berlea/Fxp/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">fxp</a>, an    XML parser implemented in Standard ML.</em> 
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <a id="Neumann99Thesis"></a>  <a class="external" href="http://citeseer.ist.psu.edu/neumann99parsing.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Parsing and Querying XML Documents in SML</a>.  Andreas Neumann.  Doctoral Thesis, 1999. 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+<a id="O"></a> 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a id="Okasaki99"></a>  <a class="external" href="http://us.cambridge.org/titles/catalogue.asp?isbn=0521663504"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Purely Functional Data Structures</a>.  ISBN 0521663504.  Chris Okasaki.  Cambridge University Press, 1999. 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+<a id="P"></a> 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a id="Paulson96"></a>  <a class="external" href="http://www.cl.cam.ac.uk/users/lcp/MLbook/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ML For the Working Programmer</a>  (<a class="external" href="http://www3.addall.com/New/submitNew.cgi?query=052156543X&amp;type=ISBN"><img src="moin-www.png" alt="[WWW]" height="11" width="11">addall</a>)  ISBN 052156543X.  Larry C. Paulson.  Cambridge University Press, 1996. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a id="PetterssonEtAl02"></a>  <a class="external" href="http://user.it.uu.se/~happi/publications/flops02.pdf"><img src="moin-www.png" alt="[WWW]" height="11" width="11">The HiPE/x86 Erlang Compiler: System Description and Performance Evaluation</a>.  Mikael Pettersson, Konstantinos Sagonas, and Erik Johansson.  <a href="#FLOPS">FLOPS</a> 2002. 
+</p>
+</li>
+
+        <ul>
+
+  <em>Describes a native x86 Erlang compiler and a comparison of many   different native x86 compilers (including MLton) and their register   usage and call stack implementations.</em> 
+        </ul>
+
+
+
+    </ul>
+
+
+<p>
+<a id="Q"></a> <a id="R"></a> 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a id="Ramsey03"></a>  <a class="external" href="http://www.eecs.harvard.edu/~nr/pubs/embed-abstract.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Embedding an Interpreted Language Using Higher-Order Functions and Types</a>.  Norman Ramsey.  <a href="#IVME">IVME</a> 2003. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a id="RedwineRamsey04"></a>  <a class="external" href="http://citeseer.ist.psu.edu/670348.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Widening Integer Arithmetic</a>.  Kevin Redwine and Norman Ramsey.  <a href="#CC">CC</a> 2004. 
+</p>
+</li>
+
+        <ul>
+
+  <em>Describes a method to implement numeric types and operations (like   <tt>Int31</tt> or <tt>Word17</tt>) for sizes smaller than that provided by   the processor.</em>  
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <a id="Reppy99"></a>  <a class="external" href="http://us.cambridge.org/titles/catalogue.asp?isbn=0521480892"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Concurrent Programming in ML</a>  (<a class="external" href="http://www3.addall.com/New/submitNew.cgi?query=0521480892&amp;type=ISBN"><img src="moin-www.png" alt="[WWW]" height="11" width="11">addall</a>).  ISBN 0521480892.  John Reppy.  Cambridge University Press, 1999. 
+</p>
+</li>
+
+        <ul>
+
+  <em>Covers <a href="ConcurrentML">ConcurrentML</a>.</em> 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <a id="Rossberg01"></a>  <a class="external" href="http://www.ps.uni-sb.de/hamlet/defects.pdf"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Defects in the Revised Definition of Standard ML</a>.  Andreas Rossberg. 2001. 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+<a id="S"></a> 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a id="Sansom91"></a>  <a class="external" href="http://citeseer.ist.psu.edu/sansom91dualmode.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Dual-Mode Garbage Collection</a>.  Patrick M. Sansom.  Workshop on the Parallel Implementation of Functional Languages, 1991. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a id="Scott00"></a>  <a class="external" href="http://citeseer.ist.psu.edu/scott00when.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">When Do Match-Compilation Heuristics Matter</a>.  Kevin Scott and Norman Ramsey.  University of Virginia Technical Report CS-2000-13. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a id="Sestoft96"></a>  <a class="external" href="http://citeseer.ist.psu.edu/sestoft96ml.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ML pattern match compilation and partial evaluation</a>.  Peter Sestoft.  Partial Evaluation, 1996.  
+</p>
+</li>
+
+        <ul>
+
+  <em>Describes the derivation of the match compiler used in   <a href="MoscowML">Moscow ML</a>.</em> 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <a id="Shipman02"></a>  Anthony L. Shipman.  <a class="external" href="http://web.access.net.au/felixadv/files/output/book/index.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Unix System Programming with Standard ML</a>, 2002. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a id="Signoles03"></a>  <a class="external" href="http://www.lri.fr/~signoles/publis/jfla2003.ps.gz"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Calcul statique des applications de modules parametres</a>.  Julien Signoles.  <a href="#JFLA">JFLA</a> 2003. 
+</p>
+</li>
+
+        <ul>
+
+  <em>Describes a defunctorizer for OCaml, and compares it to existing   defunctorizers, including MLton.</em> 
+        </ul>
+
+
+
+    </ul>
+
+
+<p>
+<a id="T"></a> 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a id="ThorupTofte94"></a>  <a class="external" href="http://www.diku.dk/users/tofte/publ/MLWorkshop94.ps.gz"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Object-oriented programming and Standard ML</a>.  Lars Thorup and Mads Tofte.    Workshop on ML and its applications, 1994.  
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a id="Tofte90"></a>  Type Inference for Polymorphic References.  Mads Tofte.  Information and Computation, 89(1), 1990. 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+<a id="U"></a> 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a id="Ullman98"></a>  <a class="external" href="http://www-db.stanford.edu/~ullman/emlp.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Elements of ML Programming</a>  (<a class="external" href="http://www3.addall.com/New/submitNew.cgi?query=0137903871&amp;type=ISBN"><img src="moin-www.png" alt="[WWW]" height="11" width="11">addall</a>).  ISBN 0137903871.  Jeffrey D. Ullman.  Prentice-Hall, 1998. 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+<a id="V"></a> <a id="W"></a> 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a id="Wang01"></a>  <a class="external" href="http://ncstrl.cs.princeton.edu/expand.php?id=TR-640-01"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Managing Memory with Types</a>.  Daniel C. Wang.  PhD Thesis. 
+</p>
+</li>
+
+        <ul>
+
+  <em>Chapter 6 describes an implementation of a type-preserving garbage   collector for MLton.</em> 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <a id="WangAppel01"></a>  <a class="external" href="http://www.cs.princeton.edu/~danwang/Papers/tpsrvgc/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Type-Preserving Garbage Collectors</a>.  Daniel C. Wang and Andrew W. Appel.  <a href="#POPL">POPL</a> 2001. 
+</p>
+</li>
+
+        <ul>
+
+  <em>Shows how to modify MLton to generate a strongly typed garbage   collector as part of a program.</em> 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <a id="WangMurphy"></a>  <a class="external" href="http://www-2.cs.cmu.edu/~tom7/papers/wang-murphy-recursion.pdf"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Programming With Recursion Schemes</a>.  Daniel C. Wang and Tom Murphy VII. 
+</p>
+</li>
+
+        <ul>
+
+  <em>Describes a programming technique for data abstraction, along with   benchmarks of MLton and other SML compilers.</em> 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <a id="WangMurphy"></a>   <a class="external" href="http://www.cs.princeton.edu/~danwang/drafts/recursion-schemes.pdf"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Recursion Schemes as Abstract Interfaces</a>.  Daniel C. Wang and Tom Murphy.  <a href="#JFP">JFP</a>. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a id="Wright95"></a>  <a class="external" href="http://citeseer.ist.psu.edu/wright95simple.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Simple Imperative Polymorphism</a>.  Andrew Wright.  <a href="#LASC">LASC</a>, 8(4):343-355, 1995. 
+</p>
+</li>
+
+            <ul>
+
+   <em>The origin of the <a href="ValueRestriction">ValueRestriction</a>.</em> 
+            </ul>
+
+
+
+    </ul>
+
+
+<p>
+<a id="X"></a> <a id="Y"></a> <a id="Z"></a> 
+</p>
+<h2 id="head-a90aba13b6feb8ff1a5141d94cb1fc2fe96e9477">Abbreviations</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a id="BABEL"></a> BABEL = Workshop on multi-language infrastructure  and interoperability. 
+</p>
+</li>
+    <li>
+<p>
+ <a id="CC"></a> CC = International Conference on Compiler Construction 
+</p>
+</li>
+    <li>
+<p>
+ <a id="ESOP"></a> ESOP = European Symposium on Programming 
+</p>
+</li>
+    <li>
+<p>
+ <a id="FLOPS"></a> FLOPS = Symposium on Functional and Logic Programming 
+</p>
+</li>
+    <li>
+<p>
+ <a id="ICFP"></a> ICFP = International Conference on Functional Programming 
+</p>
+</li>
+    <li>
+<p>
+ <a id="IVME"></a> IVME = Workshop on Interpreters, Virtual Machines and Emulators. 
+</p>
+</li>
+    <li>
+<p>
+ <a id="JFLA"></a> JFLA = Journees Francophones des Langages Applicatifs 
+</p>
+</li>
+    <li>
+<p>
+ <a id="JFP"></a> JFP = Journal of Functional Programming 
+</p>
+</li>
+    <li>
+<p>
+ <a id="LASC"></a> LASC = Lisp and Symbolic Computation 
+</p>
+</li>
+    <li>
+<p>
+ <a id="PLDI"></a> PLDI = Conference on Programming Language Design  and Implementation 
+</p>
+</li>
+    <li>
+<p>
+ <a id="POPL"></a> POPL = Symposium on Principles of Programming Languages  
+</p>
+</li>
+    <li>
+<p>
+ <a id="PPDP"></a> PPDP = International Conference on Principles and  Practice of Declarative Programming 
+</p>
+</li>
+    <li>
+<p>
+ <a id="TCS"></a> TCS = IFIP International Conference on Theoretical  Computer Science  
+</p>
+</li>
+    <li>
+<p>
+ <a id="TLDI"></a> TLDI = Workshop on Types in Language Design and  Implementation  
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-07-26 18:19:15 by <span title="adsl-64-166-226-32.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Regions
===================================================================
--- mlton/trunk/doc/guide/Regions	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Regions	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,115 @@
+<!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>Regions - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Regions
+    <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">
+In region-based memory management, the heap is divided into a collection of regions into which objects are allocated.  At compile time, either in the source program or through automatic inference, allocation points are annotated with the region in which the allocation will occur.  Typically, although not always, the regions are allocated and deallocated according to a stack discipline. <p>
+MLton does not use region-based memory management; it uses traditional <a href="GarbageCollection">GarbageCollection</a>.  We have considered integrating regions with MLton, but in our opinion it is far from clear that regions would provide MLton with improved performance, while they would certainly add a lot of complexity to the compiler and complicate reasoning about and achieving <a href="SpaceSafety">SpaceSafety</a>.  Region-based memory management and garbage collection have different strengths and weaknesses; it's pretty easy to come up with programs that do significantly better under regions than under GC, and vice versa.  We believe that it is the case that common SML idioms tend to work better under GC than under regions. 
+</p>
+<p>
+One common argument for regions is that the region operations can all be done in (approximately) constant time; therefore, you eliminate GC pause times, leading to a real-time GC.  However, because of space safety concerns (see below), we believe that region-based memory management for SML must also include a traditional garbage collector. Hence, to achieve real-time memory management for MLton/SML, we believe that it would be both easier and more efficient to implement a traditional real-time garbage collector than it would be to implement a region system. 
+</p>
+<h2 id="head-e13532a671e5ad9117550985d8de01f8c2379242">Regions, the ML Kit, and space safety</h2>
+<p>
+The <a href="MLKit">ML Kit</a> pioneered the use of regions for compiling Standard ML.  The ML Kit maintains a stack of regions at run time.  At compile time, it uses region inference to decide when data can be allocated in a stack-like manner, assigning it to an appropriate region.  The ML Kit has put a lot of effort into improving the supporting analyses and representations of regions, which are all necessary to improve the performance. 
+</p>
+<p>
+Unfortunately, under a pure stack-based region system, space leaks are inevitable in theory, and costly in practice.  Data for which region inference can not determine the lifetime is moved into the <em>global region</em> whose lifetime is the entire program.  There are two ways in which region inference will place an object to the global region. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ When the inference is too conservative, that is, when the data is  used in a stack-like manner but the region inference can't figure  it out. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ When data is not used in a stack-like manner.  In this case,  correctness requires region inference to place the object  
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+This global region is a source of space leaks.  No matter what region system you use, there are some programs such that the global region must exist, and its size will grow to an unbounded multiple of the live data size.  For these programs one must have a GC to achieve space safety. 
+</p>
+<p>
+To solve this problem, the ML Kit has undergone work to combine garbage collection with region-based memory management. <a href = "References#HallenbergEtAl02">HallenbergEtAl02</a> and <a href = "References#Elsman03">Elsman03</a> describe the addition of a garbage collector to the ML Kit's region-based system. These papers provide convincing evidence for space leaks in the global region.  They show a number of benchmarks where the memory usage of the program running with just regions is a large multiple (2, 10, 50, even 150) of the program running with regions plus GC. 
+</p>
+<p>
+These papers also give some numbers to show the ML Kit with just regions does better than either a system with just GC or a combined system.  Unfortunately, a pure region system isn't practical because of the lack of space safety.  And the other performance numbers are not so convincing, because they compare to an old version of SML/NJ and not at all with MLton.  It would be interesting to see a comparison with a more serious collector. 
+</p>
+<h2 id="head-aafecc0fcfe54d777ca4e4fc2befd8e4948f9191">Regions, Garbage Collection, and Cyclone</h2>
+<p>
+One possibility is to take Cyclone's approach, and provide both region-based memory management and garbage collection, but at the programmer's option (<a href = "References#GrossmanEtAl02">GrossmanEtAl02</a>, <a href = "References#HicksEtAl03">HicksEtAl03</a>). 
+</p>
+<p>
+One might ask whether we might do the same thing -- i.e., provide a <tt>MLton.Regions</tt> structure with explicit region based memory management operations, so that the programmer could use them when appropriate.  <a href="MatthewFluet">MatthewFluet</a> has thought about this question 
+</p>
+
+        <ul>
+
+  <a href="http://www.cs.cornell.edu/People/fluet/rgn-monad/index.html">http://www.cs.cornell.edu/People/fluet/rgn-monad/index.html</a> 
+        </ul>
+
+
+<p>
+Unfortunately, his conclusion is that the SML type system is too weak to support this option, although there might be a "poor-man's" version with dynamic checks. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-23 22:47:40 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/ReleaseChecklist
===================================================================
--- mlton/trunk/doc/guide/ReleaseChecklist	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/ReleaseChecklist	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,170 @@
+<!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>ReleaseChecklist - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      ReleaseChecklist
+    <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">
+
+    <ul>
+
+    <li>
+<p>
+ Update <tt>doc/changelog</tt> with a summary. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <tt>mlton.org</tt> 
+</p>
+</li>
+
+        <ul>
+
+        <li>
+<p>
+ <tt>basis</tt> gets a snapshot of <a href="http://standardml.org/Basis">http://standardml.org/Basis</a>. 
+</p>
+</li>
+        <li>
+<p>
+ <tt>changelog</tt> gets a copy of <tt>doc/changelog</tt>. 
+</p>
+</li>
+        <li>
+<p>
+ <a href="Home">Home</a> gets note of new release. 
+</p>
+</li>
+        <li>
+<p>
+ <a href="http://mlton.org/Download">Download</a> gets release notes and executables. 
+</p>
+</li>
+        <li>
+<p>
+ <a href="Experimental">Experimental</a> is cleared. 
+</p>
+</li>
+
+        </ul>
+
+
+    <li class="gap">
+<p>
+ Send mail to  
+</p>
+</li>
+
+        <ul>
+
+        <li>
+<p>
+ <a href="mailto:MLton@mlton.org">MLton@mlton.org</a> 
+</p>
+</li>
+        <li>
+<p>
+ <a href="mailto:MLton-user@mlton.org">MLton-user@mlton.org</a> 
+</p>
+</li>
+        <li>
+<p>
+ <a href="mailto:sml-list@cs.cmu.edu">sml-list@cs.cmu.edu</a>  (aka comp.lang.ml) 
+</p>
+</li>
+        <li>
+<p>
+ <a href="mailto:lwn@lwn.net">lwn@lwn.net</a> (linux weekly news) 
+</p>
+</li>
+
+        </ul>
+
+
+    <li class="gap">
+<p>
+ Post to 
+</p>
+</li>
+
+        <ul>
+
+        <li>
+<p>
+ comp.lang.functional 
+</p>
+</li>
+
+        </ul>
+
+
+    <li class="gap">
+<p>
+ Update <a href="OtherSites">OtherSites</a> that have MLton pages. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ dupload Debian package. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ Generate new <a href="Performance">Performance</a> numbers. 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-10 22:10:57 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/RemoveUnused
===================================================================
--- mlton/trunk/doc/guide/RemoveUnused	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/RemoveUnused	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,135 @@
+<!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>RemoveUnused - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      RemoveUnused
+    <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">
+An optimization pass for both the <a href="SSA">SSA</a> and <a href="SSA2">SSA2</a> <a href="IntermediateLanguage">IntermediateLanguage</a>s, invoked from <a href="SSASimplify">SSASimplify</a> and <a href="SSA2Simplify">SSA2Simplify</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+An aggressive removal optimization: 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ removes unused datatypes 
+</p>
+</li>
+    <li>
+<p>
+ removes unused datatype constructors 
+</p>
+</li>
+    <li>
+<p>
+ removes unused datatype constructor arguments 
+</p>
+</li>
+    <li>
+<p>
+ removes unused functions 
+</p>
+</li>
+    <li>
+<p>
+ removes unused function arguments 
+</p>
+</li>
+    <li>
+<p>
+ removes unused function returns 
+</p>
+</li>
+    <li>
+<p>
+ removes unused blocks 
+</p>
+</li>
+    <li>
+<p>
+ removes unused block arguments 
+</p>
+</li>
+    <li>
+<p>
+ removes unused statements (variable bindings) 
+</p>
+</li>
+    <li>
+<p>
+ removes unused handlers from non-tail calls (mayRaise analysis) 
+</p>
+</li>
+    <li>
+<p>
+ removes unused continuations from non-tail calls (mayReturn analysis) 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/remove-unused.sig?view=markup">remove-unused.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/remove-unused.fun?view=markup">remove-unused.fun</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/remove-unused2.sig?view=markup">remove-unused2.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/remove-unused2.fun?view=markup">remove-unused2.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:28:23 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Restore
===================================================================
--- mlton/trunk/doc/guide/Restore	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Restore	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,93 @@
+<!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>Restore - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Restore
+    <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">
+An rewrite pass for the <a href="SSA">SSA</a> and <a href="SSA2">SSA2</a> <a href="IntermediateLanguage">IntermediateLanguage</a>s,  invoked from <a href="KnownCase">KnownCase</a> and <a href="LocalRef">LocalRef</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Restore the <strong></strong>SSA<strong></strong> condition for a violating <a href="SSA">SSA</a> or <a href="SSA2">SSA2</a> program; the input program must satisfy: 
+</p>
+
+        <ul>
+
+  Every path from the root to a use of a variable (excluding globals) passes through a def of that variable. 
+        </ul>
+
+
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/restore.sig?view=markup">restore.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/restore.fun?view=markup">restore.fun</a>
+<br>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/restore2.sig?view=markup">restore2.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/restore2.fun?view=markup">restore2.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+<p>
+Based primarily on Section 19.1 of <a href = "References#Appel98">Modern Compiler Implementation in ML</a>. 
+</p>
+<p>
+The main deviation is the calculation of liveness of the violating variables, which is used to predicate the insertion of phi arguments. This is due to the algorithm's bias towards imperative languages, for which it makes the assumption that all variables are defined in the start block and all variables are "used" at exit. 
+</p>
+<p>
+This is "optimized" for restoration of functions with small numbers of violating variables -- use bool vectors to represent sets of violating variables. 
+</p>
+<p>
+Also, we use a Promise.t to suspend part of the dominance frontier computation. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:28:06 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/RunTimeOptions
===================================================================
--- mlton/trunk/doc/guide/RunTimeOptions	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/RunTimeOptions	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,196 @@
+<!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>RunTimeOptions - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      RunTimeOptions
+    <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">
+To control the runtime system, executables produced by MLton take several optional command line arguments before their usual arguments. To use these options, the first argument to the executable must be <tt>@MLton</tt>.  The optional arguments then follow, must be terminated by <tt>--</tt>, and are followed by any arguments to the program.  The optional arguments are <em>not</em> made available to the SML program via <tt>CommandLine.arguments</tt>.  For example, a valid call to <tt>hello-world</tt> is: 
+<pre>hello-world @MLton gc-summary fixed-heap 10k -- a b c
+</pre>In the above example,  <tt>CommandLine.arguments&nbsp;()&nbsp;=&nbsp;["a",&nbsp;"b",&nbsp;"c"]</tt>. It is also allowed to have a sequence of <tt>@MLton</tt> arguments, as in: 
+<pre>hello-world @MLton gc-summary -- @MLton fixed-heap 10k -- a b c
+</pre><p>
+These options can also control MLton, as in 
+<pre>mlton @MLton fixed-heap 0.5g -- foo.sml
+</pre>
+</p>
+<p>
+Here are the allowed options. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>fixed-heap&nbsp;</tt><em>x</em><tt>{k|K|m|M|g|G}&nbsp;</tt> 
+</p>
+</li>
+
+            <ul>
+
+   Use a fixed size heap of size <em>x</em>, where <em>x</em> is a real number    and the trailing letter indicates its units. 
+<div>
+<table>
+   <tr>
+<td>
+ <tt>k</tt> or <tt>K</tt> </td>
+<td>
+ 1024 </td>
+</tr>
+   <tr>
+<td>
+ <tt>m</tt> or <tt>M</tt> </td>
+<td>
+ 1,048,576 </td>
+</tr>
+   <tr>
+<td>
+ <tt>g</tt> or <tt>G</tt> </td>
+<td>
+ 1,073,741,824 </td>
+</tr>
+</table>
+</div>
+   A value of <tt>0</tt> means to use almost all the RAM present on the    machine. <p>
+   The heap size used by <tt>fixed-heap</tt> includes all memory    allocated by SML code, including memory for the stack (or stacks,    if there are multiple threads).  It does not, however, include any    memory used for code itself or memory used by C globals, the C    stack, or malloc. 
+</p>
+
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>gc-messages</tt> 
+</p>
+</li>
+
+            <ul>
+
+   Print a message at the start and end of every garbage collection. 
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>gc-summary</tt> 
+</p>
+</li>
+
+            <ul>
+
+   Print a summary of garbage collection statistics upon program termination. 
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>load-world&nbsp;</tt><em>world</em> 
+</p>
+</li>
+
+            <ul>
+
+   Restart the computation with the file specified by world, which    must have been created by a call to <tt>MLton.World.save</tt> by the    same executable.  See <a href="MLtonWorld">MLtonWorld</a>. 
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>max-heap&nbsp;</tt><em>x</em><tt>{k|K|m|M|g|G}&nbsp;</tt> 
+</p>
+</li>
+
+            <ul>
+
+   Run the computation with an automatically resized heap that is    never larger than <em>x</em>, where <em>x</em> is a real number and the    trailing letter indicates the units as with <tt>fixed-heap</tt>.  The    heap size for <tt>max-heap</tt> is accounted for as with    <tt>fixed-heap</tt>. 
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>no-load-world</tt> 
+</p>
+</li>
+
+            <ul>
+
+   Disable <tt>load-world</tt>.  This can be used as an argument to the    compiler via <tt>-runtime&nbsp;no-load-world</tt> to create executables    that will not load a world.  This may be useful to ensure that    set-uid executables do not load some strange world. 
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>ram-slop&nbsp;</tt><em>x</em> 
+</p>
+</li>
+
+            <ul>
+
+   Multiply <em>x</em> by the amount of RAM on the machine to obtain what    the runtime views as the amount of RAM it can use.  Typically    <em>x</em> is less than 1, and is used to account for space used by    other programs running on the same machine. 
+            </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>stop</tt> 
+</p>
+</li>
+
+            <ul>
+
+   Causes the runtime to stop processing <tt>@MLton</tt> arguments once    the next <tt>--</tt> is reached.  This can be used as an argument to    the compiler via <tt>-runtime&nbsp;stop</tt> to create executables that don't    process any <tt>@MLton</tt> arguments. </ul>
+
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-22 01:32:34 by <span title="adsl-64-166-225-13.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/RunningOnCygwin
===================================================================
--- mlton/trunk/doc/guide/RunningOnCygwin	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/RunningOnCygwin	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,83 @@
+<!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>RunningOnCygwin - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      RunningOnCygwin
+    <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">
+MLton uses the <a class="external" href="http://www.cygwin.com/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Cygwin</a> emulation layer to provide a Posix-like environment while running on Windows.  To run MLton on Windows, you must first install Cygwin on your machine.  To do this, visit the Cygwin site from your Windows machine and run their <tt>setup.exe</tt> script.  Then, you can unpack the MLton binary tgz in your Cygwin environment. <p>
+To run MLton cross-compiled executables on Windows, you must install the Cygwin <tt>dll</tt> on the Windows machine. 
+</p>
+<p>
+Here are the known problems using MLton on Cygwin. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ Time profiling is disabled. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <tt>Posix.Process.fork</tt> is disabled.  Any use of <tt>fork</tt> will  raise <tt>OS.SysErr</tt>.  For idiomatic uses of <tt>fork</tt> plus  <tt>exec</tt>, you can instead use the <tt>MLton.Process.spawn</tt> family  of functions, which work on all our platforms.   
+</p>
+<p>
+ Fork used to be disabled due to Cygwin bugs involving the interaction  of <tt>fork</tt> and <tt>mmap</tt>.  Recently, Cygwin developers have fixed  those bugs, in Cygwin versions from 2004-Jul-15 or later (1.5.11-1 or  higher).  However, Cygwin's <tt>mmap</tt> emulation does not make  available as much contiguous virtual address space as using the  Windows <tt>VirtualAlloc</tt> function.  Hence, MLton still uses  <tt>VirtualAlloc</tt> and not <tt>mmap</tt>, which means that Cygwin can  not properly emulate fork.  Consequently, <tt>Posix.Process.fork</tt> is  disabled. 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-02 01:03:46 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/RunningOnDarwin
===================================================================
--- mlton/trunk/doc/guide/RunningOnDarwin	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/RunningOnDarwin	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,82 @@
+<!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>RunningOnDarwin - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      RunningOnDarwin
+    <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">
+
+    <ul>
+
+    <li>
+<p>
+ <a class="external" href="http://fink.sourceforge.net/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">fink</a> has the <a href="GnuMP">GnuMP</a> library  <a class="external" href="http://fink.sourceforge.net/pdb/package.php/gmp"><img src="moin-www.png" alt="[WWW]" height="11" width="11">here</a>. 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-a4bc8bf5caf54b18cea9f58e83dd4acb488deb17">Also see</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="RunningOnPowerPC">RunningOnPowerPC</a> 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-04-22 20:01:14 by <span title="adsl-67-117-152-215.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/RunningOnFreeBSD
===================================================================
--- mlton/trunk/doc/guide/RunningOnFreeBSD	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/RunningOnFreeBSD	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,70 @@
+<!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>RunningOnFreeBSD - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      RunningOnFreeBSD
+    <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">
+MLton is available as a FreeBSD  <a class="external" href="http://www.freebsd.org/cgi/ports.cgi?query=mlton&amp;stype=all"><img src="moin-www.png" alt="[WWW]" height="11" width="11">port</a>. <h2 id="head-b05203cf89b60eb36609a1a8b7f3cafe0927486a">Known issues</h2>
+
+    <ul>
+
+    <li>
+<p>
+ Executables often run more slowly than on a comparable Linux  machine.  We conjecture that part of this is due to costs due    to heap resizing and kernel zeroing of pages.  Any help  in solving the problem would be appreciated. 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-29 20:13:09 by <span title="adsl-64-166-225-13.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/RunningOnLinux
===================================================================
--- mlton/trunk/doc/guide/RunningOnLinux	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/RunningOnLinux	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,59 @@
+<!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>RunningOnLinux - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      RunningOnLinux
+    <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 are no known issues using MLton on Linux. </div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-02 00:56:09 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/RunningOnMinGW
===================================================================
--- mlton/trunk/doc/guide/RunningOnMinGW	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/RunningOnMinGW	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,79 @@
+<!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>RunningOnMinGW - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      RunningOnMinGW
+    <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">
+Support for MLton on MinGW is preliminary.  We are still working on resolving the issues below.  If you are interested to help out, please send mail to <a class="external" href="mailto:MLton@mlton.org"><img src="moin-email.png" alt="[MAILTO]" height="10" width="14">MLton@mlton.org</a> and get involved with MLton <a href="Development">Development</a>. 
+    <ul>
+
+    <li>
+<p>
+ Many of the <tt>Posix</tt> functions are unimplemented and  will <tt>raise&nbsp;SysErr</tt>. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <tt>MLton.Itimer</tt> is unimplemented. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ The C function <tt>getrusage</tt> is implemented by a stub   that always sets the time to zero.  Hence  <tt>MLton.Rusage.rusage</tt> will return times of zero.  Also,   the times printed by the runtime system will be zeroes.  
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-24 15:11:09 by <span title="cfs35.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/RunningOnNetBSD
===================================================================
--- mlton/trunk/doc/guide/RunningOnNetBSD	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/RunningOnNetBSD	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,140 @@
+<!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>RunningOnNetBSD - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      RunningOnNetBSD
+    <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">
+<h2 id="head-f540b96714cb4fb53f52a3c6b891109f21c9ec21">Installing the correct packages for NetBSD</h2>
+<p>
+The NetBSD system installs 3rd party packages by a mechanism known as pkgsrc. This is a tree of Makefiles which when invoked downloads the source code, builds a package and installs it on the system. In order to run MLton on NetBSD, you will have to install a number of packages for it to work: 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>shells/bash</tt> 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <tt>devel/gmp</tt> 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <tt>devel/gmake</tt> 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+In order to get graphical call-graphs of profiling information, you will need the additional package 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>graphics/graphviz</tt> 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+To build the documentation for MLton, you will need the package  
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>textproc/hevea</tt> 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-94491c2cf063e8b634a4582f510f3a6735669262">Tips for compiling and using MLton on NetBSD</h2>
+<p>
+MLton can be a memory-hog on computers with little memory.  While 640Mb of RAM ought to be enough to self-compile MLton one might want to do some tuning to the NetBSD VM subsystem in order to succeed.  The notes presented here is what <a href="JesperLouisAndersen">JesperLouisAndersen</a> uses for compiling MLton on his laptop. 
+</p>
+<h3 id="head-3bf1043eef710e5b57c1d91fccdbbd6535c8e3e0">The NetBSD VM subsystem</h3>
+<p>
+NetBSD uses a VM subsystem named <a class="external" href="http://www.ccrc.wustl.edu/pub/chuck/tech/uvm/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">UVM</a>. <a class="external" href="http://www.selonen.org/arto/netbsd/vm_tune.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Tuning the VM system</a> can be done via the <tt>sysctl(8)</tt>-interface with the "VM" MIB set. 
+</p>
+<h3 id="head-53250437dad54a0be46b79ac843e8ef296be4249">Tuning the NetBSD VM subsystem for MLton</h3>
+<p>
+MLton uses a lot of anonymous pages when it is running. Thus, we will need to tune up the default of 80 for anonymous pages.  Setting 
+</p>
+
+<pre>sysctl -w vm.anonmax=95
+sysctl -w vm.anonmin=50
+sysctl -w vm.filemin=2
+sysctl -w vm.execmin=2
+sysctl -w vm.filemax=4
+sysctl -w vm.execmax=4
+</pre><p>
+makes it less likely for the VM system to swap out anonymous pages. For a full explanation of the above flags, see the documentation. 
+</p>
+<p>
+The result is that my laptop goes from a MLton compile where it swaps a lot to a MLton compile with no swapping. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-12 20:55:22 by <span title="0x3ef3bc87.boanxx19.adsl-dhcp.tele.dk"><a href="JesperLouisAndersen">JesperLouisAndersen</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/RunningOnOpenBSD
===================================================================
--- mlton/trunk/doc/guide/RunningOnOpenBSD	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/RunningOnOpenBSD	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,74 @@
+<!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>RunningOnOpenBSD - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      RunningOnOpenBSD
+    <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">
+
+    <ul>
+
+    <li>
+<p>
+ Our socket regression test fails.  We suspect this is not a   bug and is simply due to our test relying on a certain   behavior when connecting to a socket that has not yet   accepted, which is handled differently on OpenBSD than other   platforms.  Any help in understanding and resolving this issue   is appreciated. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ MLton was built and tested on OpenBSD 3.5.  We suspect it will also run on 3.6, but would like to hear confirmation of this.  MLton doesn't build on 3.4, which has a slightly different signal API. 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-11 22:34:48 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/RunningOnPowerPC
===================================================================
--- mlton/trunk/doc/guide/RunningOnPowerPC	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/RunningOnPowerPC	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,69 @@
+<!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>RunningOnPowerPC - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      RunningOnPowerPC
+    <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">
+
+    <ul>
+
+    <li>
+<p>
+ When compiling for PowerPC, MLton doesn't support native code  generation (<tt>-codegen&nbsp;native</tt>).  Hence, performance is not as  good as it might be and compile times are longer.  Also, the quality   of code generated by <tt>gcc</tt> is important.  By default, MLton calls  <tt>gcc&nbsp;-O1</tt>.  You can change this by calling MLton with   <tt>-cc-opt&nbsp;-O2</tt>. 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-02 00:52:39 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/RunningOnSolaris
===================================================================
--- mlton/trunk/doc/guide/RunningOnSolaris	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/RunningOnSolaris	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,92 @@
+<!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>RunningOnSolaris - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      RunningOnSolaris
+    <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">
+Here are the known problems building MLton on Solaris. 
+    <ul>
+
+    <li>
+<p>
+ You must install the <tt>binutils</tt>, <tt>gcc</tt>, and <tt>make</tt>  packages.  You can find out how to get these at  <a class="external" href="http://www.sunfreeware.com"><img src="moin-www.png" alt="[WWW]" height="11" width="11">sunfreeware.com</a> 
+</p>
+</li>
+    <li class="gap">
+<p>
+ Making the documentation requires that you install <tt>latex</tt>  and <tt>dvips</tt>, which are available in the <tt>tetex</tt> package.  It  also requires <tt>hevea</tt>, for which we haven't yet tracked down a  package. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ Bootstrapping is so slow as to be impractical (many hours on a  500MhZ Ultra<strong></strong>Sparc).  For this reason, we strongly recommend building  with a Linux to Solaris <a href="CrossCompiling">cross compiler</a>. 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-a4bc8bf5caf54b18cea9f58e83dd4acb488deb17">Also see</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="RunningOnSparc">RunningOnSparc</a> 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-26 18:44:15 by <span title="adsl-10-6-82.mia.bellsouth.net"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/RunningOnSparc
===================================================================
--- mlton/trunk/doc/guide/RunningOnSparc	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/RunningOnSparc	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,74 @@
+<!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>RunningOnSparc - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      RunningOnSparc
+    <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">
+
+    <ul>
+
+    <li>
+<p>
+ When compiling for Sparc, MLton doesn't support native code  generation (<tt>-codegen&nbsp;native</tt>).  Hence, performance is not as  good as it might be and compile times are longer.  Also, the quality  of code generated by <tt>gcc</tt> is important.  By default, MLton calls  <tt>gcc&nbsp;-O1</tt>.  You can change this by calling MLton with   <tt>-cc-opt&nbsp;-O2</tt>.  We have seen this speed up some programs by as  much as 30%, especially those involving floating point; however, it  can also more than double compile times. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ When compiling for Sparc, MLton uses <tt>-align&nbsp;8</tt> by default.   While this speeds up reals, it also may increase object sizes.  If  your program does not make significant use of reals, you might see a  speedup with <tt>-align&nbsp;4</tt>. 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-02 00:53:36 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/SMLNET
===================================================================
--- mlton/trunk/doc/guide/SMLNET	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/SMLNET	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,65 @@
+<!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>SMLNET - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      SMLNET
+    <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">
+<a class="external" href="http://www.research.microsoft.com/Projects/SML.NET/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">SML.NET</a> is a  <a href="StandardMLImplementations">Standard ML Compiler</a> that targets the .NET Common Language Runtime. <p>
+SML.NET is based on the <a href="MLj">MLj</a> compiler. 
+</p>
+<p>
+<a href = "References#BentonEtAl04">BentonEtAl04</a> describes SML.NET. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-30 20:11:30 by <span title="adsl-64-166-225-13.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/SMLNJ
===================================================================
--- mlton/trunk/doc/guide/SMLNJ	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/SMLNJ	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,90 @@
+<!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>SMLNJ - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      SMLNJ
+    <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">
+<a class="external" href="http://www.smlnj.org/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">SML/NJ</a> is a <a href="StandardMLImplementations">Standard ML Compiler</a>. It is a native code compiler that runs on a variety of platforms and has a number of libraries and tools. <p>
+We maintain a list of SML/NJ's <a href="SMLNJDeviations">deviations</a> from the <a href="DefinitionOfStandardML">Definition of SML</a>. 
+</p>
+<p>
+MLton has support for some features of SML/NJ in order to ease porting between MLton and SML/NJ. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="CompilationManager">CompilationManager</a> (CM) 
+</p>
+</li>
+    <li>
+<p>
+ <a href="LineDirective">LineDirective</a>s 
+</p>
+</li>
+    <li>
+<p>
+ <a href="SMLofNJStructure">SMLofNJStructure</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="UnsafeStructure">UnsafeStructure</a> 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-30 20:12:30 by <span title="adsl-64-166-225-13.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/SMLNJDeviations
===================================================================
--- mlton/trunk/doc/guide/SMLNJDeviations	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/SMLNJDeviations	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,336 @@
+<!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>SMLNJDeviations - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      SMLNJDeviations
+    <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">
+Here are some deviations of <a href="SMLNJ">SML/NJ</a> from the <a href="DefinitionOfStandardML">Definition of SML</a>. Some of these are documented in the  <a class="external" href="http://www.smlnj.org/doc/Conversion/index.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">SML '97 Conversion Guide</a>.  Since MLton does not deviate from the Definition, you should look here if you are having trouble porting a program from MLton to SML/NJ or vice versa.  If you discover other deviations of SML/NJ that aren't listed here, please send mail to <a class="external" href="mailto:MLton@mlton.org"><img src="moin-email.png" alt="[MAILTO]" height="10" width="14">MLton@mlton.org</a>. 
+    <ul>
+
+    <li>
+<p>
+ SML/NJ allows spaces in long identifiers, as in <tt>S&nbsp;.&nbsp;x</tt>.  Section 2.5 of the Definition implies that <tt>S&nbsp;.&nbsp;x</tt> should be treated as three separate lexical items. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ SML/NJ allows <tt>=</tt> to be rebound by the declaration: 
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> <B><FONT COLOR="#A020F0">op</FONT></B> = = <B><FONT COLOR="#5F9EA0">13</FONT></B>
+</PRE>
+ This is explicitly forbidden on page 5 of the Definition. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ SML/NJ extends the syntax of the language to allow vector expressions and patterns like the following: 
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> v = #[<B><FONT COLOR="#5F9EA0">1</FONT></B>,<B><FONT COLOR="#5F9EA0">2</FONT></B>,<B><FONT COLOR="#5F9EA0">3</FONT></B>]
+<B><FONT COLOR="#A020F0">val</FONT></B> #[x,y,z] = v
+</PRE>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ SML/NJ extends the syntax of the language to allow <em>or patterns</em> like the following: 
+<pre class=code>
+<B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> foo </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">Foo</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> int </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">Bar</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> int
+</FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> (Foo x | Bar x) = Foo <B><FONT COLOR="#5F9EA0">13</FONT></B>
+</PRE>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ SML/NJ allows higher-order functors, that is, functors can be components of structures and can be passed as functor arguments and returned as functor results.  As a consequence, SML/NJ allows abbreviated functor definitions, as in the following: 
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> S =
+  <B><FONT COLOR="#0000FF">sig</FONT></B>
+    <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t
+    </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> x: t
+  <B><FONT COLOR="#0000FF">end</FONT></B>
+<B><FONT COLOR="#0000FF">functor</FONT></B> F (<B><FONT COLOR="#0000FF">structure</FONT></B> A: S): S = 
+  <B><FONT COLOR="#0000FF">struct</FONT></B>
+    <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> A.t * A.t
+    </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> x = (A.x, A.x)
+  <B><FONT COLOR="#0000FF">end</FONT></B>
+<B><FONT COLOR="#0000FF">functor</FONT></B> G = F
+</PRE>
+  
+</p>
+</li>
+    <li class="gap">
+<p>
+ SML/NJ extends the syntax of the language to allow functor and signature definitions to occur within the scope of <tt>local</tt> and <tt>structure</tt> declarations. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ SML/NJ allows duplicate type specifications in signatures when the duplicates are introduced by <tt>include</tt>, as in the following: 
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> SIG1 =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t
+      </FONT></B><B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> u
+   </FONT></B><B><FONT COLOR="#0000FF">end</FONT></B>
+<B><FONT COLOR="#0000FF">signature</FONT></B> SIG2 =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t
+      </FONT></B><B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> v
+   </FONT></B><B><FONT COLOR="#0000FF">end</FONT></B>
+<B><FONT COLOR="#0000FF">signature</FONT></B> SIG =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#0000FF">include</FONT></B> SIG1
+      <B><FONT COLOR="#0000FF">include</FONT></B> SIG2
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+ This is disallowed by rule 77 of the Definition. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ SML/NJ allows sharing constraints between type abbreviations in signatures, as in the following: 
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> SIG =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> int * int
+      </FONT></B><B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> u </FONT></B>=<FONT COLOR="#228B22"><B> int * int
+      </FONT></B><B><FONT COLOR="#0000FF">sharing</FONT></B> <B><FONT COLOR="#0000FF">type</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> u
+   </FONT></B><B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+ These are disallowed by rule 78 of the Definition. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ SML/NJ disallows multiple <tt>where&nbsp;type</tt> specifications of the same type name, as in the following 
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> S =
+  <B><FONT COLOR="#0000FF">sig</FONT></B>
+     <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t
+     </FONT></B><B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> u </FONT></B>=<FONT COLOR="#228B22"><B> t
+  </FONT></B><B><FONT COLOR="#0000FF">end</FONT></B>
+  <B><FONT COLOR="#0000FF">where</FONT></B> <B><FONT COLOR="#0000FF">type</FONT></B><FONT COLOR="#228B22"><B> u </FONT></B>=<FONT COLOR="#228B22"><B> int
+</FONT></B></PRE>
+ This is allowed by rule 84 of the Definition. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ SML/NJ allows <tt>and</tt> in <tt>sharing</tt> specs in signatures, as in 
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> S =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t
+      </FONT></B><B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> u
+      </FONT></B><B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> v
+      </FONT></B><B><FONT COLOR="#0000FF">sharing</FONT></B> <B><FONT COLOR="#0000FF">type</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> u
+      </FONT></B> <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> u </FONT></B>=<FONT COLOR="#228B22"><B> v
+   </FONT></B><B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ SML/NJ does not expand the <tt>withtype</tt> derived form as described by the Definition.  According to page 55 of the Definition, the type bindings of a <tt>withtype</tt> declaration are substituted simultaneously in the connected datatype.  Consider the following program. 
+<pre class=code>
+<B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> u </FONT></B>=<FONT COLOR="#228B22"><B> real
+</FONT></B><B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> a </FONT></B>=<FONT COLOR="#228B22"><B>
+    <FONT COLOR="#B8860B">A</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> t
+  </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">B</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> u
+</FONT></B><B><FONT COLOR="#A020F0">withtype</FONT></B><FONT COLOR="#228B22"><B> u </FONT></B>=<FONT COLOR="#228B22"><B> int
+</FONT></B><B><FONT COLOR="#A020F0">and</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> u
+</FONT></B></PRE>
+ According to the Definition, it should be expanded to the following. 
+<pre class=code>
+<B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> u </FONT></B>=<FONT COLOR="#228B22"><B> real
+</FONT></B><B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> a </FONT></B>=<FONT COLOR="#228B22"><B>
+    <FONT COLOR="#B8860B">A</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> u
+  </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">B</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> int
+</FONT></B></PRE>
+ However, SML/NJ expands <tt>withtype</tt> bindings sequentially, meaning that earlier bindings are expanded within later ones.  Hence, the above program is expanded to the following. 
+<pre class=code>
+<B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> u </FONT></B>=<FONT COLOR="#228B22"><B> real
+</FONT></B><B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> a </FONT></B>=<FONT COLOR="#228B22"><B>
+    <FONT COLOR="#B8860B">A</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> int
+  </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">B</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> int
+</FONT></B></PRE>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ SML/NJ allows <tt>withtype</tt> specifications in signatures. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ SML/NJ allows a <tt>where</tt> structure specification that is similar to a <tt>where&nbsp;type</tt> specification.  For example: 
+<pre class=code>
+<B><FONT COLOR="#0000FF">structure</FONT></B> S = <B><FONT COLOR="#0000FF">struct</FONT></B> <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> int </FONT></B><B><FONT COLOR="#0000FF">end</FONT></B>
+<B><FONT COLOR="#0000FF">signature</FONT></B> SIG =
+  <B><FONT COLOR="#0000FF">sig</FONT></B>
+     <B><FONT COLOR="#0000FF">structure</FONT></B> T : <B><FONT COLOR="#0000FF">sig</FONT></B> <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B><B><FONT COLOR="#0000FF">end</FONT></B>
+  <B><FONT COLOR="#0000FF">end</FONT></B> <B><FONT COLOR="#0000FF">where</FONT></B> T = S
+</PRE>
+ This is equivalent to: 
+<pre class=code>
+<B><FONT COLOR="#0000FF">structure</FONT></B> S = <B><FONT COLOR="#0000FF">struct</FONT></B> <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> int </FONT></B><B><FONT COLOR="#0000FF">end</FONT></B>
+<B><FONT COLOR="#0000FF">signature</FONT></B> SIG =
+  <B><FONT COLOR="#0000FF">sig</FONT></B>
+     <B><FONT COLOR="#0000FF">structure</FONT></B> T : <B><FONT COLOR="#0000FF">sig</FONT></B> <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B><B><FONT COLOR="#0000FF">end</FONT></B>
+  <B><FONT COLOR="#0000FF">end</FONT></B> <B><FONT COLOR="#0000FF">where</FONT></B> <B><FONT COLOR="#0000FF">type</FONT></B><FONT COLOR="#228B22"><B> T.t </FONT></B>=<FONT COLOR="#228B22"><B> S.t
+</FONT></B></PRE>
+ SML/NJ also allows a definitional structure specification that is similar to a definitional type specification.  For example: 
+<pre class=code>
+<B><FONT COLOR="#0000FF">structure</FONT></B> S = <B><FONT COLOR="#0000FF">struct</FONT></B> <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> int </FONT></B><B><FONT COLOR="#0000FF">end</FONT></B>
+<B><FONT COLOR="#0000FF">signature</FONT></B> SIG =
+  <B><FONT COLOR="#0000FF">sig</FONT></B>
+     <B><FONT COLOR="#0000FF">structure</FONT></B> T : <B><FONT COLOR="#0000FF">sig</FONT></B> <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B><B><FONT COLOR="#0000FF">end</FONT></B> = S
+  <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+ This is equivalent to the previous examples and to: 
+<pre class=code>
+<B><FONT COLOR="#0000FF">structure</FONT></B> S = <B><FONT COLOR="#0000FF">struct</FONT></B> <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> int </FONT></B><B><FONT COLOR="#0000FF">end</FONT></B>
+<B><FONT COLOR="#0000FF">signature</FONT></B> SIG =
+  <B><FONT COLOR="#0000FF">sig</FONT></B>
+     <B><FONT COLOR="#0000FF">structure</FONT></B> T : <B><FONT COLOR="#0000FF">sig</FONT></B> <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B><B><FONT COLOR="#0000FF">end</FONT></B> <B><FONT COLOR="#0000FF">where</FONT></B> <B><FONT COLOR="#0000FF">type</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> S.t
+  </FONT></B><B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ SML/NJ disallows binding non-datatypes with datatype replication.  For example, it rejects the following program that should be allowed according to the Definition. 
+<pre class=code>
+<B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> ('a, 'b) t </FONT></B>=<FONT COLOR="#228B22"><B> 'a * 'b
+</FONT></B><B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> u </FONT></B>=<FONT COLOR="#228B22"><B> <B><FONT COLOR="#A020F0">datatype</FONT></B> t
+</FONT></B></PRE>
+ This idiom can be useful when one wants to rename a type without rewriting all the type arguments.  For example, the above would have to be written in SML/NJ as follows. 
+<pre class=code>
+<B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> ('a, 'b) t </FONT></B>=<FONT COLOR="#228B22"><B> 'a * 'b
+</FONT></B><B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> ('a, 'b) u </FONT></B>=<FONT COLOR="#228B22"><B> ('a, 'b) t
+</FONT></B></PRE>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ SML/NJ disallows sharing a structure with one of its substructures.  For example, SML/NJ disallows the following. 
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> SIG =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#0000FF">structure</FONT></B> S:
+         <B><FONT COLOR="#0000FF">sig</FONT></B>
+            <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t
+            </FONT></B><B><FONT COLOR="#0000FF">structure</FONT></B> T: <B><FONT COLOR="#0000FF">sig</FONT></B> <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B><B><FONT COLOR="#0000FF">end</FONT></B>
+         <B><FONT COLOR="#0000FF">end</FONT></B>
+      <B><FONT COLOR="#0000FF">sharing</FONT></B> S = S.T
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+ This signature is allowed by the Definition. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ SML/NJ disallows polymorphic generalization of refutable patterns.  For example, SML/NJ disallows the following. 
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> [x] = [[]]
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = (<B><FONT COLOR="#5F9EA0">1</FONT></B> :: x, <FONT COLOR="#BC8F8F"><B>&quot;one&quot;</FONT></B> :: x)
+</PRE>
+ 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-b075a95ec6d7bcb0b6a2ee7dbf5fac2093ba1e54">Deviations from the Basis Library Specification</h2>
+<p>
+Here are some deviations of SML/NJ from the Basis Library Specification.  
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ SML/NJ exposes the equality of the <tt>vector</tt> type in structures such as <tt>Word8Vector</tt> that abstractly match <tt>MONO_VECTOR</tt>, which says <tt>type&nbsp;vector</tt>, not <tt>eqtype&nbsp;vector</tt>.  So, for example, SML/NJ accepts the following program: 
+<pre class=code>
+<B><FONT COLOR="#A020F0">fun</FONT></B> f (v: Word8Vector.vector) = v = v
+</PRE>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ SML/NJ extends the <tt>SUBSTRING</tt> signature with the specification  <tt>val&nbsp;all&nbsp;:&nbsp;string&nbsp;-&gt;&nbsp;substring</tt>.  <tt>all</tt> was deprecated in  favor of <tt>full</tt> in Sept. 2000; <tt>all</tt> was removed from the  specification in July 2003.   
+</p>
+</li>
+    <li class="gap">
+<p>
+ SML/NJ provides <tt>structure&nbsp;Pack32Big&nbsp;:&gt;&nbsp;PACK_WORD</tt> and  <tt>structure&nbsp;Pack32Little&nbsp;:&gt;&nbsp;PACK_WORD</tt>.  Such structures were  renamed to <tt>PackWord&lt;N&gt;Big</tt> and <tt>PackWord&lt;N&gt;Little</tt> in  September 2003.  
+</p>
+</li>
+    <li class="gap">
+<p>
+ When formatting numerical values, SML/NJ converts hexidecimal digits to the characters <tt>"#a"</tt> through <tt>"#f"</tt>, rather than <tt>"#A"</tt> through <tt>"#F"</tt>. 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-06-10 04:39:49 by <span title="cs78147114.pp.htv.fi"><a href="VesaKarvonen">VesaKarvonen</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/SMLNJLibrary
===================================================================
--- mlton/trunk/doc/guide/SMLNJLibrary	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/SMLNJLibrary	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,252 @@
+<!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>SMLNJLibrary - 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">
+
+
+<link rel="Appendix" title="smlnj-lib.patch" href="http://mlton.org/pages/SMLNJLibrary/attachments/smlnj-lib.patch">
+<link rel="Appendix" title="smlnj-lib.tgz" href="http://mlton.org/pages/SMLNJLibrary/attachments/smlnj-lib.tgz">
+</head>
+
+<body lang="en" dir="ltr">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      SMLNJLibrary
+    <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 class="external" href="http://www.smlnj.org/doc/smlnj-lib/index.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">SML/NJ Library</a>  is a collection of libraries that are distributed with SML/NJ.  Due to differences between SML/NJ and MLton, these libraries will not work out-of-the box with MLton.   <p>
+MLton ???????? includes a port of the SML/NJ Library (from SML/NJ version 110.55). 
+</p>
+<h2 id="head-0bb18642b70b9f8a9c12ccf39487328f306b8e19">Usage</h2>
+
+    <ul>
+
+    <li>
+<p>
+ You can import a sub-library by referencing the appropriate <tt>.mlb</tt> file: 
+</p>
+</li>
+
+        <ul>
+
+
+<div>
+<table>
+  <tr>
+<td align="center">
+MLB file</td>
+<td align="center">
+Description</td>
+</tr>
+  <tr>
+<td>
+<tt>$(SML_LIB)/smlnj-lib/Util/smlnj-lib.mlb</tt></td>
+<td>
+Various utility modules, included collections, simple formating, ...</td>
+</tr>
+  <tr>
+<td>
+<tt>$(SML_LIB)/smlnj-lib/Controls/controls-lib.mlb</tt></td>
+<td>
+A library for managing control flags in an application.</td>
+</tr>
+  <tr>
+<td>
+<tt>$(SML_LIB)/smlnj-lib/HashCons/hash-cons-lib.mlb</tt></td>
+<td>
+Support for implementing hash-consed data structures.</td>
+</tr>
+  <tr>
+<td>
+<tt>$(SML_LIB)/smlnj-lib/INet/inet-lib.mlb</tt></td>
+<td>
+Networking utilities; supported on both Unix and Windows systems.</td>
+</tr>
+  <tr>
+<td>
+<tt>$(SML_LIB)/smlnj-lib/Unix/unix-lib.mlb</tt></td>
+<td>
+Utilities for Unix-based operating systems.</td>
+</tr>
+  <tr>
+<td>
+<tt>$(SML_LIB)/smlnj-lib/PP/pp-lib.mlb</tt></td>
+<td>
+Pretty-printing library.</td>
+</tr>
+  <tr>
+<td>
+<tt>$(SML_LIB)/smlnj-lib/HTML/html-lib.mlb</tt></td>
+<td>
+HTML parsing and pretty-printing library.</td>
+</tr>
+  <tr>
+<td>
+<tt>$(SML_LIB)/smlnj-lib/RegExp/regexp-lib.mlb</tt></td>
+<td>
+Regular expression library.</td>
+</tr>
+  <tr>
+<td>
+<tt>$(SML_LIB)/smlnj-lib/Reactive/reactive-lib.mlb</tt></td>
+<td>
+Reactive scripting library.</td>
+</tr>
+</table>
+</div>
+
+        </ul>
+
+
+    <li>
+<p>
+ If you are porting a project from SML/NJ's <a href="CompilationManager">CompilationManager</a> to MLton's <a href="MLBasis"> ML Basis system</a> using <tt>cm2mlb</tt>, you will find it helpful to add the following to your <tt>.mlton/cm2mlb-map</tt>: 
+<pre>smlnj-lib       $(SML_LIB)/smlnj-lib/Util
+controls-lib    $(SML_LIB)/smlnj-lib/Controls
+hash-cons-lib   $(SML_LIB)/smlnj-lib/HashCons
+inet-lib        $(SML_LIB)/smlnj-lib/INet
+unix-lib        $(SML_LIB)/smlnj-lib/Unix
+pp-lib          $(SML_LIB)/smlnj-lib/PP
+html-lib        $(SML_LIB)/smlnj-lib/HTML
+regexp-lib      $(SML_LIB)/smlnj-lib/RegExp
+reactive-lib    $(SML_LIB)/smlnj-lib/Reactive
+</pre> This will automatically convert a <tt>$/smlnj-lib.cm</tt> import in an input <tt>.cm</tt> file into a <tt>$(SML_LIB)/smlnj-lib/Util/smlnj-lib.mlb</tt> import in the output <tt>.mlb</tt> file.
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-dc3decbb93847518f1a049dcf49d0d7c6560bcc6">Details</h2>
+<p>
+The following changes were made to the SML/NJ Library, in addition to deriving the <tt>.mlb</tt> files from the <tt>.cm</tt> files: 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>Util/deviations.sml</tt> (added): Accomodate <a href="SMLNJDeviations"> SML/NJ's deviations</a> from the <a class="external" href="http://www.standardml.org/Basis"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Basis Library specification</a>. 
+</p>
+</li>
+    <li>
+<p>
+ <tt>Util/redblack-set-fn.sml</tt> (modified): Rewrote use of <tt>where</tt> structure specification. 
+</p>
+</li>
+    <li>
+<p>
+ <tt>Util/redblack-map-fn.sml</tt> (modified): Rewrote use of <tt>where</tt> structure specification. 
+</p>
+</li>
+    <li>
+<p>
+ <tt>Util/graph-scc.sml</tt> (modified): Rewrote use of <tt>where</tt> structure specification. 
+</p>
+</li>
+    <li>
+<p>
+ <tt>Util/bit-array.sml</tt> (modified): The computation of the <tt>maxLen</tt> is given by: 
+<pre>val maxLen = 8*Word8Array.maxLen
+</pre> This is fine in SML/NJ where <tt>Word8Array.maxLen</tt> is 16777215, but in MLton, <tt>Word8Array.maxLen</tt> is equal to <tt>valOf(Int.maxInt)</tt>, so the computation overflows. To accomodate both SML/NJ and MLton, the computation is replaced by 
+<pre>val maxLen = (8*Word8Array.maxLen) handle Overflow =&gt; Word8Array.maxLen
+</pre>
+</p>
+</li>
+    <li>
+<p>
+ <tt>Util/engine.mlton.sml</tt> (added, not exported): Implements <tt>structure&nbsp;Engine</tt>, providing time-limited, resumable computations using <a href="MLtonThread">MLtonThread</a>, <a href="MLtonSignal">MLtonSignal</a>, and <a href="MLtonItimer">MLtonItimer</a>. 
+</p>
+</li>
+    <li>
+<p>
+ <tt>Util/time-limit.mlton.sml</tt> (added): Implements <tt>structure&nbsp;TimeLimit</tt> using <tt>structure&nbsp;Engine</tt>.  The SML/NJ implementation of <tt>structure&nbsp;TimeLimit</tt> uses SML/NJ's first-class continuations, signals, and interval timer. 
+</p>
+</li>
+    <li>
+<p>
+ <tt>Util/time-limit.mlb</tt> (added): Exports <tt>structure&nbsp;TimeLimit</tt>, which is <em>not</em> exported by <tt>smlnj-lib.mlb</tt>.  Since MLton is very conservative in the presence of threads and signals, program performance may be adversely affected by unecessarily including <tt>structure&nbsp;TimeLimit</tt>. 
+</p>
+</li>
+    <li>
+<p>
+ <tt>Unix/deviations.sml</tt> (added, not exported): Accomodate <a href="SMLNJDeviations"> SML/NJ's deviations</a> from the <a class="external" href="http://www.standardml.org/Basis"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Basis Library specification</a>. 
+</p>
+</li>
+    <li>
+<p>
+ <tt>HTML/deviations.sml</tt> (added, not exported): Accomodate <a href="SMLNJDeviations"> SML/NJ's deviations</a> from the <a class="external" href="http://www.standardml.org/Basis"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Basis Library specification</a>. 
+</p>
+</li>
+    <li>
+<p>
+ <tt>HTML/html-elements-fn.sml</tt> (modified): Rewrote use of <em>or-patterns</em>. 
+</p>
+</li>
+    <li>
+<p>
+ <tt>HTML/html-attrs-fn.sml</tt> (modified): Rewrote use of <em>or-patterns</em>. 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-190aa842474f4bfcec9c8cde305af27b7d07764d">Patch</h2>
+
+    <ul>
+
+    <li>
+<p>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/lib/smlnj-lib/smlnj-lib.patch?view=markup">smlnj-lib.patch</a>
+ 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 16:00:36 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/SMLofNJStructure
===================================================================
--- mlton/trunk/doc/guide/SMLofNJStructure	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/SMLofNJStructure	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,216 @@
+<!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>SMLofNJStructure - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      SMLofNJStructure
+    <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">
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> SML_OF_NJ =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#0000FF">structure</FONT></B> Cont:
+         <B><FONT COLOR="#0000FF">sig</FONT></B>
+            <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> 'a cont
+            </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> callcc: ('a cont -&gt; 'a) -&gt; 'a
+            <B><FONT COLOR="#A020F0">val</FONT></B> throw: 'a cont -&gt; 'a -&gt; 'b
+         <B><FONT COLOR="#0000FF">end</FONT></B>
+      <B><FONT COLOR="#0000FF">structure</FONT></B> SysInfo:
+         <B><FONT COLOR="#0000FF">sig</FONT></B>
+            <B><FONT COLOR="#A020F0">exception</FONT></B><FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">UNKNOWN</FONT>
+            </FONT></B><B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> os_kind </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">BEOS</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">MACOS</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">OS2</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">UNIX</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">WIN32</FONT>
+
+            </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> getHostArch: unit -&gt; string
+            <B><FONT COLOR="#A020F0">val</FONT></B> getOSKind: unit -&gt; os_kind
+            <B><FONT COLOR="#A020F0">val</FONT></B> getOSName: unit -&gt; string
+         <B><FONT COLOR="#0000FF">end</FONT></B>
+
+      <B><FONT COLOR="#A020F0">val</FONT></B> exnHistory: exn -&gt; string list
+      <B><FONT COLOR="#A020F0">val</FONT></B> exportFn: string * (string * string list -&gt; OS.Process.status) -&gt; unit
+      <B><FONT COLOR="#A020F0">val</FONT></B> exportML: string -&gt; bool
+      <B><FONT COLOR="#A020F0">val</FONT></B> getAllArgs: unit -&gt; string list
+      <B><FONT COLOR="#A020F0">val</FONT></B> getArgs: unit -&gt; string list
+      <B><FONT COLOR="#A020F0">val</FONT></B> getCmdName: unit -&gt; string
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<p>
+<tt>SMLofNJ</tt> implements a subset of the structure of the same name provided in Standard ML of New Jersey.  It is included to make it easier to port programs between the two systems.  The semantics of these functions may be different than in SML/NJ. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>structure&nbsp;Cont</tt>} 
+</p>
+</li>
+
+        <ul>
+
+  implements continuations. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>SysInfo.getHostArch&nbsp;()</tt> 
+</p>
+</li>
+
+        <ul>
+
+  returns the string for the architecture. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>SysInfo.getOSKind</tt> 
+</p>
+</li>
+
+        <ul>
+
+  returns the OS kind. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>SysInfo.getOSName&nbsp;()</tt> 
+</p>
+</li>
+
+        <ul>
+
+  returns the string for the host. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>exnHistory</tt> 
+</p>
+</li>
+
+        <ul>
+
+  the same as <tt>MLton.Exn.history</tt>. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>getCmdName&nbsp;()</tt> 
+</p>
+</li>
+
+        <ul>
+
+  the same as <tt>CommandLine.name&nbsp;()</tt>. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>getArgs&nbsp;()</tt> 
+</p>
+</li>
+
+        <ul>
+
+  the same as <tt>CommandLine.arguments&nbsp;()</tt>. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>getAllArgs&nbsp;()</tt> 
+</p>
+</li>
+
+        <ul>
+
+  the same as <tt>getCmdName()::getArgs()</tt>. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>exportFn&nbsp;f</tt> 
+</p>
+</li>
+
+        <ul>
+
+  save the state of the computation to a file that will apply <tt>f</tt>   to the command-line arguments upon restart. 
+        </ul>
+
+
+    <li class="gap">
+<p>
+ <tt>exportML&nbsp;f</tt> 
+</p>
+</li>
+
+        <ul>
+
+  save the state of the computation to file <tt>f</tt> and continue.   Return <tt>true</tt> in the restarted computation and <tt>false</tt> in   the continuing computation. </ul>
+
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-17 01:40:36 by <span title="roam59-224.fas.harvard.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/SSA
===================================================================
--- mlton/trunk/doc/guide/SSA	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/SSA	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,128 @@
+<!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>SSA - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      SSA
+    <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">
+An <a href="IntermediateLanguage">IntermediateLanguage</a>,  translated from <a href="SXML">SXML</a> by <a href="ClosureConvert">ClosureConvert</a>,  optimized by <a href="SSASimplify">SSASimplify</a>, and  translated by <a href="ToSSA2">ToSSA2</a> to <a href="SSA2">SSA2</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+SSA is a <a class="nonexistent" href="FirstOrder">FirstOrder</a>, <a class="nonexistent" href="SimplyTyped">SimplyTyped</a> <a href="IntermediateLanguage">IntermediateLanguage</a>. It is the main <a href="IntermediateLanguage">IntermediateLanguage</a> used for optimizations. 
+</p>
+<p>
+A SSA program consists of a collection of datatype declarations, a sequence of global statements, and a collection of functions, along with a distinguished "main" function.  Each function consists of a collection of basic blocks, where each basic block is a sequence of statements ending with some control transfer. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/ssa.sig?view=markup">ssa.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/ssa.fun?view=markup">ssa.fun</a>
+<br>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/ssa-tree.sig?view=markup">ssa-tree.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/ssa-tree.fun?view=markup">ssa-tree.fun</a>
+ <h2 id="head-a6de4b535fedeaa8890bd890b60fe09f87b5f96a">Type Checking</h2>
+<p>
+Type checking of a SSA program verfies the following: 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ no duplicate definitions (tycons, cons, vars, labels, funcs) 
+</p>
+</li>
+    <li>
+<p>
+ no out of scope references (tycons, cons, vars, labels, funcs) 
+</p>
+</li>
+    <li>
+<p>
+ variable definitions dominate variable uses 
+</p>
+</li>
+    <li>
+<p>
+ case transfers are exhaustive and irredundant 
+</p>
+</li>
+    <li>
+<p>
+ <tt>Enter</tt>/<tt>Leave</tt> profile statements match 
+</p>
+</li>
+    <li>
+<p>
+ "traditional" well-typedness 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/type-check.sig?view=markup">type-check.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/type-check.fun?view=markup">type-check.fun</a>
+ 
+</p>
+<h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+<p>
+<strong></strong>SSA<strong></strong> is an abbreviation for Static Single Assignment.   The SSA <a href="IntermediateLanguage">IntermediateLanguage</a> is a variant of <strong></strong>SSA<strong></strong>. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:27:49 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/SSA2
===================================================================
--- mlton/trunk/doc/guide/SSA2	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/SSA2	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,131 @@
+<!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>SSA2 - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      SSA2
+    <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">
+An <a href="IntermediateLanguage">IntermediateLanguage</a>,  translated from <a href="SSA">SSA</a> by <a href="ToSSA2">ToSSA2</a>,  optimized by <a href="SSA2Simplify">SSA2Simplify</a>, and  translated by <a href="ToRSSA">ToRSSA</a> to <a href="RSSA">RSSA</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+SSA2 is a <a class="nonexistent" href="FirstOrder">FirstOrder</a>, <a class="nonexistent" href="SimplyTyped">SimplyTyped</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, a slight variant of the <a href="SSA">SSA</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, 
+</p>
+<p>
+Like <a href="SSA">SSA</a>, a <a href="SSA">SSA</a> program consists of a collection of datatype declarations, a sequence of global statements, and a collection of functions, along with a distinguished "main" function.  Each function consists of a collection of basic blocks, where each basic block is a sequence of statements ending with some control transfer. 
+</p>
+<p>
+Unlike <a href="SSA">SSA</a>, SSA2 includes mutable fields in objects and makes the vector type constructor n-ary instead of unary.  This allows optimizations like <a href="RefFlatten">RefFlatten</a> and <a href="DeepFlatten">DeepFlatten</a> to be expressed. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/ssa2.sig?view=markup">ssa2.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/ssa2.fun?view=markup">ssa2.fun</a>
+<br>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/ssa-tree2.sig?view=markup">ssa-tree2.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/ssa-tree2.fun?view=markup">ssa-tree2.fun</a>
+ <h2 id="head-a6de4b535fedeaa8890bd890b60fe09f87b5f96a">Type Checking</h2>
+<p>
+Type checking of a SSA2 program verfies the following: 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ no duplicate definitions (tycons, cons, vars, labels, funcs) 
+</p>
+</li>
+    <li>
+<p>
+ no out of scope references (tycons, cons, vars, labels, funcs) 
+</p>
+</li>
+    <li>
+<p>
+ variable definitions dominate variable uses 
+</p>
+</li>
+    <li>
+<p>
+ case transfers are exhaustive and irredundant 
+</p>
+</li>
+    <li>
+<p>
+ <tt>Enter</tt>/<tt>Leave</tt> profile statements match 
+</p>
+</li>
+    <li>
+<p>
+ "traditional" well-typedness 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/type-check2.sig?view=markup">type-check2.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/type-check2.fun?view=markup">type-check2.fun</a>
+ 
+</p>
+<h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+<p>
+<strong></strong>SSA<strong></strong> is an abbreviation for Static Single Assignment.   The SSA2 <a href="IntermediateLanguage">IntermediateLanguage</a> is a variant of <strong></strong>SSA<strong></strong>. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:27:31 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/SSA2Simplify
===================================================================
--- mlton/trunk/doc/guide/SSA2Simplify	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/SSA2Simplify	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,146 @@
+<!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>SSA2Simplify - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      SSA2Simplify
+    <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 optimization passes for the <a href="SSA2">SSA2</a> <a href="IntermediateLanguage">IntermediateLanguage</a> are collected and controlled by the <tt>Simplify2</tt> functor (
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/simplify2.sig?view=markup">simplify2.sig</a>
+,
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/simplify2.fun?view=markup">simplify2.fun</a>
+).   <p>
+The following optimization passes are implemented: 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="DeepFlatten">DeepFlatten</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="RefFlatten">RefFlatten</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="RemoveUnused">RemoveUnused</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="Zone">Zone</a> 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+There are additional analysis and rewrite passes that augment many of the other optimization passes: 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="Restore">Restore</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="Shrink">Shrink</a> 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+The optimization passes can be controlled from the command-line by the options 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>diag-pass&nbsp;&lt;pass&gt;</tt> -- keep diagnostic info for pass 
+</p>
+</li>
+    <li>
+<p>
+ <tt>drop-pass&nbsp;&lt;pass&gt;</tt> -- omit optimization pass 
+</p>
+</li>
+    <li>
+<p>
+ <tt>keep-pass&nbsp;&lt;pass&gt;</tt> -- keep the results of pass 
+</p>
+</li>
+    <li>
+<p>
+ <tt>loop-passes&nbsp;&lt;n&gt;</tt> -- loop optimization passes 
+</p>
+</li>
+    <li>
+<p>
+ <tt>ssa2-passes&nbsp;&lt;passes&gt;</tt> -- ssa optimization passes 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:27:05 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/SSASimplify
===================================================================
--- mlton/trunk/doc/guide/SSASimplify	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/SSASimplify	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,231 @@
+<!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>SSASimplify - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      SSASimplify
+    <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 optimization passes for the <a href="SSA">SSA</a> <a href="IntermediateLanguage">IntermediateLanguage</a> are collected and controlled by the <tt>Simplify</tt> functor (
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/simplify.sig?view=markup">simplify.sig</a>
+,
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/simplify.fun?view=markup">simplify.fun</a>
+).   <p>
+The following optimization passes are implemented: 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="CommonArg">CommonArg</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="CommonBlock">CommonBlock</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="CommonSubexp">CommonSubexp</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="ConstantPropagation">ConstantPropagation</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="Contify">Contify</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="Flatten">Flatten</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="Inline">Inline</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="IntroduceLoops">IntroduceLoops</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="KnownCase">KnownCase</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="LocalFlatten">LocalFlatten</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="LocalRef">LocalRef</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="LoopInvariant">LoopInvariant</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="Redundant">Redundant</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="RedundantTests">RedundantTests</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="RemoveUnused">RemoveUnused</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="SimplifyTypes">SimplifyTypes</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="Useless">Useless</a> 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+The following implementation pass is implemented: 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="PolyEqual">PolyEqual</a> 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+There are additional analysis and rewrite passes that augment many of the other optimization passes: 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="Multi">Multi</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="Restore">Restore</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="Shrink">Shrink</a> 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+The optimization passes can be controlled from the command-line by the options: 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>diag-pass&nbsp;&lt;pass&gt;</tt> -- keep diagnostic info for pass 
+</p>
+</li>
+    <li>
+<p>
+ <tt>drop-pass&nbsp;&lt;pass&gt;</tt> -- omit optimization pass 
+</p>
+</li>
+    <li>
+<p>
+ <tt>keep-pass&nbsp;&lt;pass&gt;</tt> -- keep the results of pass 
+</p>
+</li>
+    <li>
+<p>
+ <tt>loop-passes&nbsp;&lt;n&gt;</tt> -- loop optimization passes 
+</p>
+</li>
+    <li>
+<p>
+ <tt>ssa-passes&nbsp;&lt;passes&gt;</tt> -- ssa optimization passes 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:26:49 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/SXML
===================================================================
--- mlton/trunk/doc/guide/SXML	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/SXML	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,82 @@
+<!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>SXML - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      SXML
+    <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">
+An <a href="IntermediateLanguage">IntermediateLanguage</a>,  translated from <a href="XML">XML</a> by <a href="Monomorphise">Monomorphise</a>, optimized by <a href="SXMLSimplify">SXMLSimplify</a>, and  translated by <a href="ClosureConvert">ClosureConvert</a> to <a href="SSA">SSA</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+SXML is a simply-typed version of <a href="XML">XML</a>. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/xml/sxml.sig?view=markup">sxml.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/xml/sxml.fun?view=markup">sxml.fun</a>
+<br>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/xml/sxml-tree.sig?view=markup">sxml-tree.sig</a>
+ <h2 id="head-a6de4b535fedeaa8890bd890b60fe09f87b5f96a">Type Checking</h2>
+<p>
+SXML shares the type checker for <a href="XML">XML</a>. 
+</p>
+<h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+<p>
+There are only two differences between <a href="XML">XML</a> and SXML.  First, SXML <tt>val</tt>, <tt>fun</tt>, and <tt>datatype</tt> declarations always have an empty list of type variables.  Second, SXML variable references always have an empty list of type arguments.  Constructors uses can only have a nonempty list of type arguments if the constructor is a primitive. 
+</p>
+<p>
+Although we could rely on the type system to enforce these constraints by parameterizing the <a href="XML">XML</a> signature, <a href="StephenWeeks">StephenWeeks</a> did so in a previous version of the compiler, and the software engineering gains were not worth the effort. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:26:30 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/SXMLShrink
===================================================================
--- mlton/trunk/doc/guide/SXMLShrink	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/SXMLShrink	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,72 @@
+<!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>SXMLShrink - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      SXMLShrink
+    <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">
+An optimization pass for the <a href="SXML">SXML</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="SXMLSimplify">SXMLSimplify</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Performs optimizations based on a reduction system. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/xml/shrink.sig?view=markup">shrink.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/xml/shrink.fun?view=markup">shrink.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+<p>
+<a href="SXML">SXML</a> shares the <a href="XMLShrink">XMLShrink</a> simplifier. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:26:13 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/SXMLSimplify
===================================================================
--- mlton/trunk/doc/guide/SXMLSimplify	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/SXMLSimplify	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,151 @@
+<!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>SXMLSimplify - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      SXMLSimplify
+    <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 optimization passes for the <a href="SXML">SXML</a> <a href="IntermediateLanguage">IntermediateLanguage</a> are collected and controlled by the <tt>SxmlSimplify</tt> functor (
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/xml/sxml-simplify.sig?view=markup">sxml-simplify.sig</a>
+,
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/xml/sxml-simplify.fun?view=markup">sxml-simplify.fun</a>
+).   <p>
+The following optimization passes are implemented: 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="Polyvariance">Polyvariance</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="SXMLShrink">SXMLShrink</a> 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+The following implementation passes are implemented: 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="ImplementExceptions">ImplementExceptions</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="ImplementSuffix">ImplementSuffix</a> 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+The following optimization passes are not implemented, but might prove useful: 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a class="nonexistent" href="Uncurry">Uncurry</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a class="nonexistent" href="LambdaLift">LambdaLift</a> 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+The optimization passes can be controlled from the command-line by the options 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>diag-pass&nbsp;&lt;pass&gt;</tt> -- keep diagnostic info for pass 
+</p>
+</li>
+    <li>
+<p>
+ <tt>drop-pass&nbsp;&lt;pass&gt;</tt> -- omit optimization pass 
+</p>
+</li>
+    <li>
+<p>
+ <tt>keep-pass&nbsp;&lt;pass&gt;</tt> -- keep the results of pass 
+</p>
+</li>
+    <li>
+<p>
+ <tt>sxml-passes&nbsp;&lt;passes&gt;</tt> -- sxml optimization passes 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:25:57 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/ScopeInference
===================================================================
--- mlton/trunk/doc/guide/ScopeInference	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/ScopeInference	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,75 @@
+<!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>ScopeInference - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      ScopeInference
+    <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">
+An analysis/rewrite pass for the <a href="AST">AST</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="Elaborate">Elaborate</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Add free type variables to the <tt>val</tt> or <tt>fun</tt> declaration where they are implicitly scoped. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate/scope.sig?view=markup">scope.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/elaborate/scope.fun?view=markup">scope.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+<p>
+Scope inference determines for each type variable, the declaration where it is bound.  Scope inference is a direct implementation of the specification given in section 4.6 of the [:DefinitionOfStandardML: Definition].  Recall that a free occurrence of a type variable <tt>'a</tt> in a declaration <tt>d</tt> is <em>unguarded</em> in <tt>d</tt> if <tt>'a</tt> is not part of a smaller declaration.  A type variable <tt>'a</tt> is implicitly scoped at <tt>d</tt> if <tt>'a</tt> is unguarded in <tt>d</tt> and <tt>'a</tt> does not occur unguarded in any declaration containing <tt>d</tt>. 
+</p>
+<p>
+The first pass of scope inference walks down the tree and renames all explicitly bound type variables in order to avoid name collisions.  It then walks up the tree and adds to each declaration the set of unguarded type variables occurring in that declaration.  At this point, if declaration <tt>d</tt> contains an unguarded type variable <tt>'a</tt> and the immediately containing declaration does not contain <tt>'a</tt>, then <tt>'a</tt> is implicitly scoped at <tt>d</tt>.  The final pass walks down the tree leaving a <tt>'a</tt> at the a declaration where it is scoped and removing it from all enclosed declarations. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:25:40 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/SelfCompiling
===================================================================
--- mlton/trunk/doc/guide/SelfCompiling	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/SelfCompiling	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,112 @@
+<!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>SelfCompiling - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      SelfCompiling
+    <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">
+If you want to compile MLton, you must first get the <a href="Sources">Sources</a>. You can compile with either MLton or SML/NJ, but we strongly recommend using MLton, since it generates a much faster and more robust executable. <h2 id="head-1de0682946bc93df2efbe121609cf7219fc17ca4">Compiling with MLton</h2>
+<p>
+To compile with MLton, you need the binary versions of <tt>mlton</tt>, <tt>mllex</tt>, and <tt>mlyacc</tt> that come with the MLton binary package.  To be safe, you should use the same version of MLton that you are building.  However, older versions may work, as long as they don't go back too far.  To build MLton, run <tt>make</tt> from within the root directory of the sources.  This will build MLton first with the already installed binary version of MLton and will then rebuild MLton with itself. 
+</p>
+<p>
+First, the <tt>Makefile</tt> calls <tt>mllex</tt> and <tt>mlyacc</tt> to build the lexer and parser, and then calls <tt>mlton</tt> to compile itself. When making MLton using another version the <tt>Makefile</tt> automatically uses <tt>mlton-stubs.cm</tt>, which will put in enough stubs to emulate the <tt>MLton</tt> structure.  Once MLton is built, the <tt>Makefile</tt> will rebuild MLton with itself, this time using <tt>mlton.cm</tt> and the real <tt>MLton</tt> structure from the <a href="BasisLibrary"> SML Basis Library</a>. This second round of compilation is essential in order to achieve a fast and robust MLton. 
+</p>
+<p>
+Compiling MLton requires at least 512M of actual RAM, and 1G is preferable.  If your machine has less than 512M, self-compilation will likely fail, or at least take a very long time due to paging.  Even if you have enough memory, there simply may not be enough available, due to memory consumed by other processes.  In this case, you may see an <tt>Out&nbsp;of&nbsp;memory</tt> message, or self-compilation may become extremely slow.  The only fix is to make sure that enough memory is available. 
+</p>
+<h3 id="head-4db8807336771db69984fb33e2ecb89b2b778d76">Possible Errors</h3>
+
+    <ul>
+
+    <li>
+<p>
+ If you have errors running <tt>latex</tt>, you can skip building the  documentation by using <tt>make&nbsp;all-no-docs</tt>. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ The C compiler may not be able to find the <a href="GnuMP">GnuMP</a> header file,  <tt>gmp.h</tt> leading to an error like the following. 
+<pre> platform/darwin.h:26:36: /usr/local/include/gmp.h: No such file or directory</pre> The solution is to install (or build) the GnuMP on your machine.  If  you install it at a different location, put the new path in  <tt>runtime/platform/</tt><em>&lt;os&gt;</em><tt>.h</tt>. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ The following error indicates that a binary version of MLton could  not be found in your path.  
+<pre>.../upgrade-basis: mlton: command not found
+Error: cannot upgrade basis because the compiler doesn't work
+make[3]: *** [upgrade-basis.sml] Error 1
+</pre> You need to have <tt>mlton</tt> in your path to build MLton from  source. 
+</p>
+<p>
+ During the build process, there are various times that the <tt>Makefile</tt>s  look for a <tt>mlton</tt> in your path and in <tt>src/build/bin</tt>.  It  is OK if the latter doesn't exist when the build starts; it is the  target being built.  While not finding <tt>build/bin/mlton</tt> also results   in <tt>mlton:&nbsp;command&nbsp;not&nbsp;found</tt> error messages, such errors are benign  and will not abort the build.  Failure to find a <tt>mlton</tt> in your path  will abort the build. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ Mac OS X executables do not seem to like static libraries to have a different path location at runtime compared to when the executable was built.  For example, the binary package for Mac OS X unpacks to <tt>/usr</tt>.  If you try to install it in <tt>/usr/local</tt> you may get the following errors:  
+<pre>/usr/bin/ld: table of contents for archive: /usr/local/lib/mlton/self/libmlton.a is out of date;
+rerun ranlib(1) (can't load from it)
+</pre> Although running <tt>ranlib</tt> seems like the right thing to do, it doesn't actually resolve the problem.  Best bet is to just install in <tt>/usr</tt> and then either live with this location, or build MLton yourself and install in <tt>/usr/local</tt>. 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-0df153093cbf2253d0cd4f9678b2c577464c35e0">Compiling with SML/NJ</h2>
+<p>
+To compile with SML/NJ, run <tt>make&nbsp;nj-mlton</tt> from within the root directory of the sources.  You must use SML/NJ version 110.45, which is what MLton is tested with.  First, the <tt>Makefile</tt> calls <tt>mllex</tt> and <tt>mlyacc</tt> to build the lexer and parser.  Then, it calls SML/NJ with the appropriate <tt>sources.cm</tt> file.  Building with SML/NJ takes some time (10 minutes on a 1.6GHz machine).  Unless you are doing compiler development and need rapid recompilation, we recommend compiling with MLton. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-02-28 07:54:28 by <span title="adsl-69-234-103-239.dsl.irvnca.pacbell.net">BrentFulgham</span>.
+</body></html>

Added: mlton/trunk/doc/guide/Serialization
===================================================================
--- mlton/trunk/doc/guide/Serialization	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Serialization	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,69 @@
+<!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>Serialization - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Serialization
+    <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">
+<a href="StandardML">Standard ML</a> does not have built-in support for serialization.  Here is one paper that describes a user-level approach. 
+    <ul>
+
+    <li>
+<p>
+ <a href = "References#Elsman04"> Type-Specialized Serialization with Sharing</a> 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-07-04 16:04:28 by <span title="adsl-64-166-224-93.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/ShowBasis
===================================================================
--- mlton/trunk/doc/guide/ShowBasis	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/ShowBasis	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,167 @@
+<!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>ShowBasis - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      ShowBasis
+    <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">
+<p>
+MLton has a flag, <tt>-show-basis&nbsp;</tt> <em>file</em>, that causes MLton to pretty print to <em>file</em> the basis defined by the input program.  For example, if <tt>foo.sml</tt> contains 
+<pre class=code>
+<B><FONT COLOR="#A020F0">fun</FONT></B> f x = x + <B><FONT COLOR="#5F9EA0">1</FONT></B>
+</PRE>
+ then <tt>mlton&nbsp;-show-basis&nbsp;foo.basis&nbsp;foo.sml</tt> will create <tt>foo.basis</tt> with the following contents. 
+<pre>val f: int -&gt; int
+</pre>If you only want to see the basis and do not wish to compile the program, you can call MLton with <tt>-stop&nbsp;tc</tt>. 
+</p>
+<p>
+When displaying signatures, MLton prefixes types defined in the signature them with <tt>?.</tt> to distinguish them from types defined in the environment.  For example, 
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> SIG =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> x: t * int -&gt; unit
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+ is displayed as 
+<pre>signature SIG = 
+   sig
+      type t = ?.t
+      val x: (?.t * int) -&gt; unit
+   end
+</pre>Notice that <tt>int</tt> occurs without the <tt>?.</tt> prefix. 
+</p>
+<p>
+MLton also uses a canonical name for each type in the signature, and that name is used everywhere for that type, no matter what the input signature looked like.  For example 
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> SIG =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t
+      </FONT></B><B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> u </FONT></B>=<FONT COLOR="#228B22"><B> t
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> x: t
+      <B><FONT COLOR="#A020F0">val</FONT></B> y: u
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+ is displayed as 
+<pre>signature SIG = 
+   sig
+      type t = ?.t
+      type u = ?.t
+      val x: ?.t
+      val y: ?.t
+   end
+</pre>
+</p>
+<p>
+Canonical names are always relative to the "top" of the signature, even when used in nested substructures.  For example, 
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> S =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> w: t
+      <B><FONT COLOR="#0000FF">structure</FONT></B> U:
+         <B><FONT COLOR="#0000FF">sig</FONT></B>
+            <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> u
+            </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> x: t
+            <B><FONT COLOR="#A020F0">val</FONT></B> y: u
+         <B><FONT COLOR="#0000FF">end</FONT></B>
+      <B><FONT COLOR="#A020F0">val</FONT></B> z: U.u
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+ is displayed as 
+<pre>signature S = 
+   sig
+      type t = ?.t
+      val w: ?.t
+      val z: ?.U.u
+      structure U:
+         sig
+            type u = ?.U.u
+            val x: ?.t
+            val y: ?.U.u
+         end
+   end
+</pre>
+</p>
+<p>
+When displaying structures, MLton uses signature constraints wherever possible, combined with <tt>where&nbsp;type</tt> clauses to specify the meanings of the types defined within the signature. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> SIG =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> x: t
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+<B><FONT COLOR="#0000FF">structure</FONT></B> S: SIG =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> int
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> x = <B><FONT COLOR="#5F9EA0">13</FONT></B>
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+<B><FONT COLOR="#0000FF">structure</FONT></B> S2:&gt; SIG = S
+</PRE>
+<p>
+ is displayed as 
+<pre>structure S: SIG
+             where type t = int
+structure S2: SIG
+              where type t = S2.t
+signature SIG = 
+   sig
+      type t = ?.t
+      val x: ?.t
+   end
+</pre>
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-28 19:09:32 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Shrink
===================================================================
--- mlton/trunk/doc/guide/Shrink	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Shrink	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,115 @@
+<!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>Shrink - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Shrink
+    <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">
+A rewrite pass for the <a href="SSA">SSA</a> and <a href="SSA2">SSA2</a> <a href="IntermediateLanguage">IntermediateLanguage</a>s,  invoked from every optimization pass (see <a href="SSASimplify">SSASimplify</a> and <a href="SSA2Simplify">SSA2Simplify</a>). <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Implements a whole family of compile-time reductions, like 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>#1(a,&nbsp;b)&nbsp;--&gt;&nbsp;a</tt> 
+</p>
+</li>
+    <li>
+<p>
+ <tt>case&nbsp;C&nbsp;x&nbsp;of&nbsp;C&nbsp;y&nbsp;=&gt;&nbsp;e&nbsp;&nbsp;--&gt;&nbsp;let&nbsp;y&nbsp;=&nbsp;x&nbsp;in&nbsp;e</tt> 
+</p>
+</li>
+    <li>
+<p>
+ constant folding, copy propagation 
+</p>
+</li>
+    <li>
+<p>
+ eta blocks 
+</p>
+</li>
+    <li>
+<p>
+ tuple reconstruction elimination 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/shrink.sig?view=markup">shrink.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/shrink.fun?view=markup">shrink.fun</a>
+<br>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/shrink.sig?view=markup">shrink.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/shrink.fun?view=markup">shrink.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+<p>
+The Shrink pass is run after every <a href="SSA">SSA</a> and <a href="SSA2">SSA2</a> optimization pass. 
+</p>
+<p>
+The Shrink implementation also includes functions to eliminate unreachable blocks from a <a href="SSA">SSA</a> or <a href="SSA2">SSA2</a> program or function. The Shrink pass does not guarantee to eliminate all unreachable blocks.  Doing so would unduly complicate the implementation, and it is almost always the case that all unreachable blocks are eliminated. However, a small number of optimization passes require that the input have no unreachable blocks (essentially, when the analysis works on the control flow graph and the rewrite iterates on the vector of blocks).  These passes explicitly call <tt>eliminateDeadBlocks</tt>. 
+</p>
+<p>
+The Shrink pass has a special case to turn a non-tail call where the continuation and handler only do <tt>Profile</tt> statements into a tail call where the <tt>Profile</tt> statements preceed the tail call. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:25:20 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/SimplifyTypes
===================================================================
--- mlton/trunk/doc/guide/SimplifyTypes	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/SimplifyTypes	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,189 @@
+<!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>SimplifyTypes - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      SimplifyTypes
+    <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">
+An optimization pass for the <a href="SSA">SSA</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="SSASimplify">SSASimplify</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+This pass computes a "cardinality" of each datatype, which is an abstraction of the number of values of the datatype. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ Zero means the datatype has no values (except for bottom). 
+</p>
+</li>
+    <li>
+<p>
+ One means the datatype has one value (except for bottom). 
+</p>
+</li>
+    <li>
+<p>
+ Many means the datatype has many values. 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+This pass removes all datatypes whose cardinality is Zero or One and removes 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ components of tuples 
+</p>
+</li>
+    <li>
+<p>
+ function args 
+</p>
+</li>
+    <li>
+<p>
+ constructor args 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+which are such datatypes. 
+</p>
+<p>
+This pass marks constructors as one of 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ Useless: it never appears in a <tt>ConApp</tt>. 
+</p>
+</li>
+    <li>
+<p>
+ Transparent: it is the only variant in its datatype and its argument type does not contain any uses of <tt>array</tt> or <tt>vector</tt>. 
+</p>
+</li>
+    <li>
+<p>
+ Useful: otherwise 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+This pass also removes Useless and Transparent constructors. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/simplify-types.sig?view=markup">simplify-types.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/simplify-types.fun?view=markup">simplify-types.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+<p>
+This pass must happen before polymorphic equality is implemented becuase 
+</p>
+
+    <ol type="1">
+
+    <li>
+<p>
+it will make polymorphic equality faster because some types are simpler 
+</p>
+</li>
+    <li>
+<p>
+it removes uses of polymorphic equality that must return true 
+</p>
+</li>
+
+    </ol>
+
+
+<p>
+We must keep track of Transparent consturctors whose argument type uses <tt>array</tt> because of datatypes like the following: 
+<pre class=code>
+  <B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">T</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> t vector
+</FONT></B></PRE>
+ Such a datatype has Cardinality.Many, but we cannot eliminate the datatype and replace the lhs by the rhs, i.e. we must keep the circularity around. 
+</p>
+<p>
+Must do similar things for <tt>vectors</tt>. 
+</p>
+<p>
+Also, to eliminate as many Transparent constructors as possible, for something like the following, 
+<pre class=code>
+  <B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">T</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> u array
+       </FONT></B><B><FONT COLOR="#A020F0">and</FONT></B><FONT COLOR="#228B22"><B> u </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">U</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> t vector
+</FONT></B></PRE>
+ we (arbitrarily) expand one of the datatypes first. The result will be something like 
+<pre class=code>
+  <B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> u </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">U</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> u array array
+</FONT></B></PRE>
+ where all uses of <tt>t</tt> are replaced by <tt>u&nbsp;array</tt>. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:25:00 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Sources
===================================================================
--- mlton/trunk/doc/guide/Sources	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Sources	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,102 @@
+<!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>Sources - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Sources
+    <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">
+Since 20050730, we have maintained our sources with <a href="Subversion">Subversion</a>. You can <a class="external" href="http://mlton.org/svn"><img src="moin-www.png" alt="[WWW]" height="11" width="11">view them on the web</a> or access them with a subversion client.  Anonymous read access is available via 
+<pre>svn://mlton.org/mlton</pre>We use the  <a class="external" href="http://svnbook.red-bean.com/en/1.1/ch05s04.html#svn-ch-5-sect-6.1"><img src="moin-www.png" alt="[WWW]" height="11" width="11">standard repository layout</a>, so you can check out the latest revision with 
+<pre>svn co svn://mlton.org/mlton/trunk mlton</pre>Committers (you know who you are) can access via 
+<pre>svn+ssh://mlton.org/svnroot/
+</pre>So, committers can check out the trunk with 
+<pre>svn co svn+ssh://mlton.org/svnroot/mlton/trunk mlton
+</pre><h2 id="head-302a5a9f18557bb8071c342c910d4001a0b7c373">Commit email</h2>
+<p>
+All commits are sent to <tt>MLton-commit@mlton.org</tt>  (<a class="external" href="http://mlton.org/mailman/listinfo/mlton-commit"><img src="moin-www.png" alt="[WWW]" height="11" width="11">subscribe</a>,  <a class="external" href="http://mlton.org/pipermail/mlton-commit"><img src="moin-www.png" alt="[WWW]" height="11" width="11">archive</a>), which is only for commit email.  Discussion should go to <tt>MLton@mlton.org</tt>. 
+</p>
+<p>
+If the first line of a log message for a commit begins with  "<tt>MAIL&nbsp;</tt>", then the commit message will be sent with the subject as the rest of that first line, and will also be sent to <tt>MLton@mlton.org</tt>. 
+</p>
+<h2 id="head-164b3d4809f98d0458414f1bf9cf3c9dcba16bb5">Changelog</h2>
+<p>
+See the 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/doc/changelog?view=markup">changelog</a>
+ for a list of changes and bug fixes. 
+</p>
+<h2 id="head-5e1dd8155002a7d7db24335015acaddd25a44f09">CVS</h2>
+<p>
+Prior to 20050730, we used <a href="CVS">CVS</a>.  We have left the CVS server up for access via 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a class="external" href="http://mlton.org/cvs"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ViewCVS</a> 
+</p>
+</li>
+    <li>
+<p>
+ anonymous CVS 
+</p>
+</li>
+
+            <ul>
+
+   <tt>cvs&nbsp;-d&nbsp;:pserver:anonymous@cvs.mlton.org:/cvsroot/mlton&nbsp;co&nbsp;mlton</tt> </ul>
+
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 21:30:44 by <span title="adsl-64-166-224-249.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/SpaceSafety
===================================================================
--- mlton/trunk/doc/guide/SpaceSafety	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/SpaceSafety	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,70 @@
+<!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>SpaceSafety - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      SpaceSafety
+    <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">
+Informally, space safety is a property of a language implementation that asymptotically bounds the space used by a running program. <h2 id="head-5d20d0fee3b91643dd8d272ac33d01ca95179d82">References</h2>
+
+    <ul>
+
+    <li>
+<p>
+ Chapter 12 of <a href = "References#Appel92">Appel92</a> 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-30 20:20:57 by <span title="adsl-64-166-225-13.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/StandardML
===================================================================
--- mlton/trunk/doc/guide/StandardML	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/StandardML	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,227 @@
+<!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>StandardML - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      StandardML
+    <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">
+Standard ML (SML) is a programming language that combines excellent support for rapid prototyping, modularity, and development of large programs, with performance approaching that of C. <h2 id="head-2d4e718f0442d9c4816bb4b1aeb082186175deb7">SML Resources</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="StandardMLTutorials">Tutorials</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="StandardMLBooks">Books</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="StandardMLImplementations">Implementations</a> 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-2d5a7dcc23ca7d0417def16d68a4c3da7a76008b">Aspects of SML</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="DefineTypeBeforeUse">DefineTypeBeforeUse</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="EqualityType">EqualityType</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="EqualityTypeVariable">EqualityTypeVariable</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="GenerativeDatatype">GenerativeDatatype</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="GenerativeException">GenerativeException</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="OperatorPrecedence">OperatorPrecedence</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="Overloading">Overloading</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="PolymorphicEquality">PolymorphicEquality</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="ValueRestriction">ValueRestriction</a> 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-2826893caa985e193778f8e620bd5785db9b4de8">Using SML</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="ForLoops">ForLoops</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="FunctionalRecordUpdate">FunctionalRecordUpdate</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="InfixingOperators">InfixingOperators</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="Lazy">Lazy</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="ObjectOrientedProgramming">ObjectOrientedProgramming</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="OptionalArguments">OptionalArguments</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="Printf">Printf</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="PropertyList">PropertyList</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="StyleGuide">StyleGuide</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="UniversalType">UniversalType</a> 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-b2753352a29ee19fe5f6de47a4ce208dd7e5b162">Programming in SML</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="Emacs">Emacs</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="Enscript">Enscript</a> 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-70440046a3dc2e079f23ee1c57dfa76669b732aa">Notes</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="StandardMLHistory"> History of SML</a>  
+</p>
+</li>
+    <li>
+<p>
+ <a href="Regions">Regions</a> 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-01 17:59:53 by <span title="cs78147176.pp.htv.fi"><a href="VesaKarvonen">VesaKarvonen</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/StandardMLBooks
===================================================================
--- mlton/trunk/doc/guide/StandardMLBooks	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/StandardMLBooks	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,134 @@
+<!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>StandardMLBooks - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      StandardMLBooks
+    <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">
+<h2 id="head-7143af3b6dc4f39d379ba13a79c6187c5ef99d90">Introductory Books</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a href = "References#Ullman98"> Elements of ML Programming</a> 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a href = "References#Paulson96"> ML For the Working Programmer</a> 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a href = "References#HansenRichel99"> Introduction to Programming using SML</a> 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a href = "References#FelleisenFreidman98"> The Little MLer</a> 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-76c74bd071dd73f01696fddbbffc77712a479faf">Applications</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a href = "References#Shipman02"> Unix System Programming with Standard ML</a> 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-f0ffb21a4e3a4291a50bcaad445a40eec3bdeb82">Reference Books</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a href = "References#GansnerReppy04"> The Standard ML Basis Library</a> 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a href="DefinitionOfStandardML">The Definition of Standard ML (Revised)</a> 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-cfbc9e10239e3aa2884b26233bd2772c8b87a636">Related Topics</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a href = "References#Reppy99"> Concurrent Programming in ML</a> 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a href = "References#Okasaki99"> Purely Functional Data Structures</a> 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-05-19 19:50:12 by <span title="adsl-64-166-224-88.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/StandardMLHistory
===================================================================
--- mlton/trunk/doc/guide/StandardMLHistory	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/StandardMLHistory	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,65 @@
+<!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>StandardMLHistory - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      StandardMLHistory
+    <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">
+<a href="StandardML">Standard ML</a> grew out of <a href="ML">ML</a> in the early 1980s. <p>
+For an excellent overview of SML's history, see Appendix F of the <a href="DefinitionOfStandardML">Definition</a>. 
+</p>
+<p>
+For an overview if its history before 1982, see <a href = "References#Milner82">How ML Evolved</a>. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-06-20 21:44:44 by <span title="adsl-64-170-112-14.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/StandardMLImplementations
===================================================================
--- mlton/trunk/doc/guide/StandardMLImplementations	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/StandardMLImplementations	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,155 @@
+<!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>StandardMLImplementations - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      StandardMLImplementations
+    <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">
+
+    <ul>
+
+    <li>
+<p>
+ <a href="HaMLet">HaMLet</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="MLKit">ML Kit</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="Home">MLton</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="MoscowML">Moscow ML</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="PolyML">Poly/ML</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="SMLNJ">SML/NJ</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="SMLNET">SML.NET</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="TILT">TILT</a> 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-c2bde4ab5c0231d52c93e602e91fc08c6eff09a9">Related Languages</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="Alice">Alice</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="OCaml">OCaml</a> 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-51dac21fc97141d6d3b3deb79b403e10081c4df1">Not Actively Maintained</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a class="external" href="http://www.dcs.ed.ac.uk/home/edml/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Edinburgh ML</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="MLj">MLj</a> 
+</p>
+</li>
+    <li>
+<p>
+ MLWorks 
+</p>
+</li>
+    <li>
+<p>
+ <a class="external" href="ftp://ftp.cs.bham.ac.uk/pub/dist/poplog/freepoplog.html"><img src="moin-ftp.png" alt="[FTP]" height="11" width="11">Free POPLOG</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a class="external" href="http://www.cs.cornell.edu/Info/People/jgm/til.tar.Z"><img src="moin-www.png" alt="[WWW]" height="11" width="11">TIL</a> 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-07-27 18:18:47 by <span title="adsl-64-166-226-32.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/StandardMLPortability
===================================================================
--- mlton/trunk/doc/guide/StandardMLPortability	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/StandardMLPortability	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,72 @@
+<!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>StandardMLPortability - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      StandardMLPortability
+    <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">
+Technically, SML'97 as defined in the <a href="DefinitionOfStandardML">Definition</a> requires only a a minimal initial basis, which, while including the types <tt>int</tt>, <tt>real</tt>, <tt>char</tt>, and <tt>string</tt>, need have no operations on those base types.  Hence, the only observable output of an SML'97 program is termination or raising an exception.  Most SML compilers should agree there, to the degree each agrees with the Definition.  See <a href="UnresolvedBugs">UnresolvedBugs</a> for MLton's very few corner cases. <p>
+Realistically, a program needs to make use of the <a href="BasisLibrary"> SML Basis Library</a>. Within the Basis Library, there are numerous places where the behavior is implementation dependent.  For a trivial example: 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = valOf (Int.maxInt)
+</PRE>
+<p>
+ 
+</p>
+<p>
+may either raise the <tt>Option</tt> exception (if  <tt>Int.maxInt&nbsp;==&nbsp;NONE</tt>) or may terminate normally.  The default Int/Real/Word sizes are the biggest implementation dependent aspect; so, one implementation may raise <tt>Overflow</tt> while another can accomodate the result.  Also, maximum array and vector lengths are implementation dependent.  Interfacing with the operating system is a bit murky, and implementations surely differ in handling of errors there. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-28 21:44:09 by <span title="cfs36.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/StandardMLTutorials
===================================================================
--- mlton/trunk/doc/guide/StandardMLTutorials	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/StandardMLTutorials	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,84 @@
+<!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>StandardMLTutorials - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      StandardMLTutorials
+    <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">
+
+    <ul>
+
+    <li>
+<p>
+ <a class="external" href="http://www.dcs.napier.ac.uk/course-notes/sml/manual.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">A Gentle Introduction to ML</a>.   Andrew Cummings. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a class="external" href="http://www.dcs.ed.ac.uk/home/stg/NOTES/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Programming in Standard ML '97: An Online Tutorial</a>.  Stephen Gilmore. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a class="external" href="http://www-2.cs.cmu.edu/~rwh/smlbook/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Programming in Standard ML</a>.  Robert Harper. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a class="external" href="http://www.diku.dk/users/tofte/publ/oregon/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Essentials of Standard ML Modules</a>.  Mads Tofte. 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-05-10 15:17:53 by <span title="adsl-64-166-225-167.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/StephenWeeks
===================================================================
--- mlton/trunk/doc/guide/StephenWeeks	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/StephenWeeks	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,72 @@
+<!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>StephenWeeks - 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">
+
+
+<link rel="Appendix" title="license-plate.jpg" href="http://mlton.org/pages/StephenWeeks/attachments/license-plate.jpg">
+</head>
+
+<body lang="en" dir="ltr">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      StephenWeeks
+    <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">
+I am a consultant based in the San Francisco Bay Area. <p>
+<a class="external" href="http://sweeks.com/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">home page</a> 
+</p>
+<p>
+You can email me at <a href="mailto:sweeks@sweeks.com.">sweeks@sweeks.com.</a> 
+</p>
+<p>
+My license plate. 
+</p>
+<p>
+<img src="http://mlton.org/pages/StephenWeeks/attachments/license-plate.jpg?ts=1098901229" alt="license-plate.jpg"> 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-10 21:59:17 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/StyleGuide
===================================================================
--- mlton/trunk/doc/guide/StyleGuide	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/StyleGuide	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,69 @@
+<!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>StyleGuide - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      StyleGuide
+    <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">
+These conventions are chosen so that inertia is towards modularity, code reuse and finding bugs early, <em>not</em> to save typing. 
+    <ul>
+
+    <li>
+<p>
+ <a href="SyntacticConventions">SyntacticConventions</a> 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-14 23:23:24 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Subversion
===================================================================
--- mlton/trunk/doc/guide/Subversion	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Subversion	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,69 @@
+<!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>Subversion - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Subversion
+    <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">
+<a class="external" href="http://subversion.tigris.org/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Subversion</a> is a version control system designed to replace <a href="CVS">CVS</a>.  The MLton project uses Subversion to maintain its <a href="Sources">source code</a>. 
+    <ul>
+
+    <li>
+<p>
+ <a class="external" href="http://svnbook.red-bean.com"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Version Control with Subversion</a>, a  free online book 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-07-30 21:29:05 by <span title="adsl-67-124-248-142.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/SureshJagannathan
===================================================================
--- mlton/trunk/doc/guide/SureshJagannathan	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/SureshJagannathan	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,62 @@
+<!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>SureshJagannathan - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      SureshJagannathan
+    <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">
+I am an Associate Professor at the <a class="external" href="http://www.cs.purdue.edu/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Department of Computer Science</a> at Purdue University. My research focus is in programming language design and implementation, concurrency, and distributed systems.  I am interested in various aspects of MLton, mostly related to (in no particular order): (1) control-flow analysis (2) representation strategies (e.g., flattening), (3) IR formats, and (4) extensions for distributed programming. <p>
+Please see my <a class="external" href="http://www.cs.purdue.edu/homes/suresh/index.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Home page</a> for more details. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-20 21:09:49 by <span title="atlnga1-ar3-4-64-008-045.atlnga1.dsl-verizon.net"><a href="SureshJagannathan">SureshJagannathan</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Survey
===================================================================
--- mlton/trunk/doc/guide/Survey	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Survey	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,62 @@
+<!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>Survey - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Survey
+    <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">
+<p>
+The 2005 MLton Survey is closed.  Please check this space in January 2006 for our next survey.  Thanks to all who responded. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-02-07 01:08:25 by <span title="adsl-64-166-224-38.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/SurveyDone
===================================================================
--- mlton/trunk/doc/guide/SurveyDone	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/SurveyDone	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,59 @@
+<!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>SurveyDone - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      SurveyDone
+    <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">
+Success.  Thank you for submitting a survey. </div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-05 19:41:21 by <span title="adsl-64-166-225-13.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Swerve
===================================================================
--- mlton/trunk/doc/guide/Swerve	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Swerve	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,71 @@
+<!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>Swerve - 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">
+
+
+<link rel="Appendix" title="swerve.tar.bz2" href="http://mlton.org/pages/Swerve/attachments/swerve.tar.bz2">
+</head>
+
+<body lang="en" dir="ltr">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Swerve
+    <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">
+<a class="external" href="http://web.access.net.au/felixadv/files/output/book/c3253.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Swerve</a> is an HTTP server written in SML, originally developed with SML/NJ. <a href="RayRacine">RayRacine</a> ported Swerve to MLton in January 2005.   <p>
+<a href="http://mlton.org/pages/Swerve/attachments/swerve.tar.bz2">download the port</a> 
+</p>
+<p>
+Excerpt from the included <tt>README</tt>: 
+</p>
+
+        <ul>
+
+  <em>Total testing of this port consisted of a successful compile,   startup, and serving one html page with one gif image.  Given    that the original code was throughly designed and implemented in a   thoughtful manner and I expect it is quite usable modulo a few minor   bugs introduced by my porting effort.</em> </ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-06-19 01:06:54 by <span title="69-163-240-36.atlsfl.adelphia.net"><a href="RayRacine">RayRacine</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/SyntacticConventions
===================================================================
--- mlton/trunk/doc/guide/SyntacticConventions	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/SyntacticConventions	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,650 @@
+<!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>SyntacticConventions - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      SyntacticConventions
+    <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">
+<ol>
+<li>
+<a href="#head-9239ee2cda84eca4c3440e2a7b50148af67da3d4">General</a></li>
+<li>
+<a href="#head-649d2864df18704de32e689e69e63f2483e8b76e">Identifiers</a></li>
+<li>
+<a href="#head-93b9e289e2842469d001eccf7ad5d79f3c302dc9">Types</a></li>
+<li>
+<a href="#head-68836c550ee20fae0e06b2994e76a40348d2fc30">Core</a></li>
+<li>
+<a href="#head-e4cf0392296064579858651f856889aadbc2805e">Signatures</a></li>
+<li>
+<a href="#head-c64b6d8ab6a3167af6b211df05198e555a8951eb">Structures</a></li>
+<li>
+<a href="#head-23ac4cb38bc668a9233ce693377f7f5c3879f104">Functors</a></li>
+</ol>
+
+ <h2 id="head-9239ee2cda84eca4c3440e2a7b50148af67da3d4"><a href="#bottom"><img src="moin-bottom.png" alt="[BOTTOM]" height="10" width="14"></a><a href="#top"><img src="moin-top.png" alt="[TOP]" height="10" width="14"></a>General</h2>
+
+    <ul>
+
+    <li>
+<p>
+ A line of code never exceeds 80 columns. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ Only split a syntactic entity across multiple lines if it doesn't  fit on one line within 80 columns. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ Use alphabetical order wherever possible. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ Avoid redundant parentheses. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ When using <tt>:</tt>, there is no space before the colon, and a  single space after it. 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-649d2864df18704de32e689e69e63f2483e8b76e"><a href="#bottom"><img src="moin-bottom.png" alt="[BOTTOM]" height="10" width="14"></a><a href="#top"><img src="moin-top.png" alt="[TOP]" height="10" width="14"></a>Identifiers</h2>
+
+    <ul>
+
+    <li>
+<p>
+ Variables, record labels and type constructors begin with and use  small letters, using capital letters to separate words. 
+<pre>cost
+maxValue</pre> 
+</p>
+</li>
+    <li class="gap">
+<p>
+ Variables that represent collections of objects (lists, arrays,  vectors, ...) are often suffixed with an <tt>s</tt>.  
+<pre>xs
+employees</pre>
+</p>
+</li>
+    <li class="gap">
+<p>
+ Constructors, structure identifiers, and functor identifiers begin  with a capital letter.  
+<pre>Queue
+LinkedList</pre>
+</p>
+</li>
+    <li class="gap">
+<p>
+ Signature identifiers are in all capitals, using <tt>_</tt> to  separate words.  
+<pre>LIST
+BINARY_HEAP</pre>
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-93b9e289e2842469d001eccf7ad5d79f3c302dc9"><a href="#bottom"><img src="moin-bottom.png" alt="[BOTTOM]" height="10" width="14"></a><a href="#top"><img src="moin-top.png" alt="[TOP]" height="10" width="14"></a>Types</h2>
+
+    <ul>
+
+    <li>
+<p>
+ Alphabetize record labels.  In a record type, there are spaces  after colons and commas, but not before colons or commas, or at the  delimiters <tt>{</tt> and <tt>}&nbsp;</tt>.  
+<pre>{bar: int, foo: int}
+</pre>
+</p>
+</li>
+    <li class="gap">
+<p>
+ Only split a record type across multiple lines if it doesn't fit on  one line. If a record type must be split over multiple lines, put one  field per line.  
+<pre>{bar: int,
+ foo: real * real, 
+ zoo: bool} </pre>
+</p>
+</li>
+    <li class="gap">
+<p>
+ In a tuple type, there are spaces before and after each <tt>*</tt>.  
+<pre>int * bool * real
+</pre>
+</p>
+</li>
+    <li class="gap">
+<p>
+ Only split a tuple type across multiple lines if it doesn't fit on  one line.  In a tuple type split over multiple lines, there is one  type per line, and the <tt>*</tt>s go at the beginning of the lines.  
+<pre>int
+* bool
+* real
+</pre> It may also be useful to parenthesize to make the grouping more  apparent.   
+<pre>(int
+ * bool
+ * real)
+</pre>
+</p>
+</li>
+    <li class="gap">
+<p>
+ In an arrow type split over multiple lines, put the arrow at the  beginning of its line.   
+<pre>int * real
+-&gt; bool
+</pre> It may also be useful to parenthesize to make the grouping more  apparent.  
+<pre>(int * real
+ -&gt; bool)
+</pre>
+</p>
+</li>
+    <li class="gap">
+<p>
+ Avoid redundant parentheses. 
+</p>
+</li>
+
+        <ul>
+
+        <li>
+<p>
+ Arrow types associate to the right, so write 
+<pre>a -&gt; b -&gt; c</pre> not 
+<pre>a -&gt; (b -&gt; c)</pre>
+</p>
+</li>
+        <li class="gap">
+<p>
+ Type constructor application associates to the left, so write   
+<pre>int ref list</pre> not 
+<pre>(int ref) list</pre>
+</p>
+</li>
+        <li class="gap">
+<p>
+ Type constructor application binds more tightly than a tuple type,   so write 
+<pre>int list * bool list</pre> not 
+<pre>(int list) * (bool list)</pre>
+</p>
+</li>
+        <li class="gap">
+<p>
+ Tuple types bind more tightly than arrow types, so write 
+<pre>int * bool -&gt; real
+</pre> not 
+<pre>(int * bool) -&gt; real</pre>
+</p>
+</li>
+
+        </ul>
+
+
+
+    </ul>
+
+
+<h2 id="head-68836c550ee20fae0e06b2994e76a40348d2fc30"><a href="#bottom"><img src="moin-bottom.png" alt="[BOTTOM]" height="10" width="14"></a><a href="#top"><img src="moin-top.png" alt="[TOP]" height="10" width="14"></a>Core</h2>
+
+    <ul>
+
+    <li>
+<p>
+ A core expression or declaration split over multiple lines does not  contain any blank lines. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ A record field selector has no space between the  <tt>#</tt> and the record label.  So, write 
+<pre class=code>
+#foo
+</PRE>
+ not 
+<pre class=code>
+# foo
+</PRE>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ A tuple has a space after each comma, but not before, and not at  the delimiters <tt>(</tt> <tt>)</tt>.  
+<pre class=code>
+(e1, e2, e3)
+</PRE>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ A tuple split over multiple lines has one element per line, and the  commas go at the end of the lines.  
+<pre class=code>
+(e1,
+ e2,
+ e3)
+</PRE>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ A list has a space after each comma, but not before, and not at the  delimiters <tt>[</tt> <tt>]</tt>. 
+<pre class=code>
+[e1, e2, e3]
+</PRE>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ A list split over multiple lines has one element per line, and the  commas at the end of the lines. 
+<pre class=code>
+[e1,
+ e2,
+ e3]
+</PRE>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ A record has spaces before and after <tt>=</tt>, a space after each  comma, and no space at the delimiters.  Field names appear in  alphabetical order.  
+<pre class=code>
+{bar = <B><FONT COLOR="#5F9EA0">13</FONT></B>, foo = true} 
+</PRE>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ A sequence expression has a space after each semicolon, but not  before.  
+<pre class=code>
+(e1; e2; e3)
+</PRE>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ A sequence expression split over multiple lines has one expression  per line, and the semicolons at the beginning of lines.  Lisp and  Scheme programmers may find this hard to read at first.  
+<pre class=code>
+(e1
+ ; e2
+ ; e3)
+</PRE>
+  <em>Rationale</em>: this makes it easy to visually spot the beginning of  each expression, which becomes more valuable as the expressions  themselves are split across multiple lines. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ An application expression has a space between the function and the  argument.  There are no parens unless the argument is a tuple (in  which case the parens are really part of the tuple, not the  application).  
+<pre class=code>
+f a
+f (a1, a2, a3)
+</PRE>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ Avoid redundant parentheses.  Application associates to left, so  write 
+<pre class=code>
+f a1 a2 a3
+</PRE>
+ not 
+<pre class=code>
+((f a1) a2) a3
+</PRE>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ Infix operators have a space before and after the operator. 
+<pre class=code>
+x + y
+x * y - z
+</PRE>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ Avoid redundant parentheses.  Use <a href="OperatorPrecedence">OperatorPrecedence</a>.  So, write 
+<pre class=code>
+x + y * z
+</PRE>
+ not 
+<pre class=code>
+x + (y * z)
+</PRE>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ An <tt>andalso</tt> expression split over multiple lines has the  <tt>andalso</tt> at the beginning of subsequent lines. 
+<pre class=code>
+e1
+<B><FONT COLOR="#A020F0">andalso</FONT></B> e2
+<B><FONT COLOR="#A020F0">andalso</FONT></B> e3
+</PRE>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ A <tt>case</tt> expression is indented as follows 
+<pre class=code>
+<B><FONT COLOR="#A020F0">case</FONT></B> e1 <B><FONT COLOR="#A020F0">of</FONT></B>
+   p1 =&gt; e1
+ | p2 =&gt; e2
+ | p3 =&gt; e3
+</PRE>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ A <tt>datatype</tt>'s constructors are alphabetized.  
+<pre class=code>
+<B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">A</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">B</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">C</FONT>
+</FONT></B></PRE>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ A <tt>datatype</tt> declaration has a space before and after each  <tt>|</tt>. 
+<pre class=code>
+<B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">A</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">B</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> int </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">C</FONT>
+</FONT></B></PRE>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ A <tt>datatype</tt> split over multiple lines has one constructor per  line, with the <tt>|</tt> at the beginning of lines and the constructors  beginning 3 columns to the right of the <tt>datatype</tt>. 
+<pre class=code>
+<B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> 
+   <FONT COLOR="#B8860B">A</FONT> 
+ </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">B</FONT> 
+ </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">C</FONT>
+</FONT></B></PRE>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ A <tt>fun</tt> declaration may start its body on the subsequent line,  indented 3 spaces. 
+<pre class=code>
+<B><FONT COLOR="#A020F0">fun</FONT></B> f x y =
+   <B><FONT COLOR="#A020F0">let</FONT></B>
+      <B><FONT COLOR="#A020F0">val</FONT></B> z = x + y + z
+   <B><FONT COLOR="#A020F0">in</FONT></B>
+      z
+   <B><FONT COLOR="#A020F0">end</FONT></B>
+</PRE>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ An <tt>if</tt> expression is indented as follows. 
+<pre class=code>
+<B><FONT COLOR="#A020F0">if</FONT></B> e1
+   <B><FONT COLOR="#A020F0">then</FONT></B> e2
+<B><FONT COLOR="#A020F0">else</FONT></B> e3
+</PRE>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ A sequence of <tt>if</tt>-<tt>then</tt>-<tt>else</tt>s is indented as  follows. 
+<pre class=code>
+<B><FONT COLOR="#A020F0">if</FONT></B> e1
+   <B><FONT COLOR="#A020F0">then</FONT></B> e2
+<B><FONT COLOR="#A020F0">else</FONT></B> <B><FONT COLOR="#A020F0">if</FONT></B> e3
+   <B><FONT COLOR="#A020F0">then</FONT></B> e4
+<B><FONT COLOR="#A020F0">else</FONT></B> <B><FONT COLOR="#A020F0">if</FONT></B> e5
+   <B><FONT COLOR="#A020F0">then</FONT></B> e6
+<B><FONT COLOR="#A020F0">else</FONT></B> e7
+</PRE>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ A <tt>let</tt> expression has the <tt>let</tt>, <tt>in</tt>, and <tt>end</tt>  on their own lines, starting in the same column.  Declarations and the  body are indented 3 spaces.  
+<pre class=code>
+<B><FONT COLOR="#A020F0">let</FONT></B>
+   <B><FONT COLOR="#A020F0">val</FONT></B> x = <B><FONT COLOR="#5F9EA0">13</FONT></B>
+   <B><FONT COLOR="#A020F0">val</FONT></B> y = <B><FONT COLOR="#5F9EA0">14</FONT></B>
+<B><FONT COLOR="#A020F0">in</FONT></B>
+   x + y
+<B><FONT COLOR="#A020F0">end</FONT></B>
+</PRE>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ A <tt>local</tt> declaration has the <tt>local</tt>, <tt>in</tt>, and  <tt>end</tt> on their own lines, starting in the same column.  Declarations are indented 3 spaces. 
+<pre class=code>
+<B><FONT COLOR="#0000FF">local</FONT></B>
+   <B><FONT COLOR="#A020F0">val</FONT></B> x = <B><FONT COLOR="#5F9EA0">13</FONT></B>
+<B><FONT COLOR="#0000FF">in</FONT></B>
+   <B><FONT COLOR="#A020F0">val</FONT></B> y = x
+<B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ An <tt>orelse</tt> expression split over multiple lines has the  <tt>orelse</tt> at the beginning of subsequent lines. 
+<pre class=code>
+e1
+<B><FONT COLOR="#A020F0">orelse</FONT></B> e2
+<B><FONT COLOR="#A020F0">orelse</FONT></B> e3
+</PRE>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ A <tt>val</tt> declaration has a space before and after the  <tt>=</tt>. 
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> p = e
+</PRE>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ A <tt>val</tt> declaration can start the expression on the subsequent  line, indented 3 spaces. 
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> p =
+   <B><FONT COLOR="#A020F0">if</FONT></B> e1 <B><FONT COLOR="#A020F0">then</FONT></B> e2 <B><FONT COLOR="#A020F0">else</FONT></B> e3
+</PRE>
+ 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-e4cf0392296064579858651f856889aadbc2805e"><a href="#bottom"><img src="moin-bottom.png" alt="[BOTTOM]" height="10" width="14"></a><a href="#top"><img src="moin-top.png" alt="[TOP]" height="10" width="14"></a>Signatures</h2>
+
+    <ul>
+
+    <li>
+<p>
+ A <tt>signature</tt> declaration is indented as follows. 
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> FOO =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#A020F0">val</FONT></B> x: int
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ A <tt>val</tt> specification has a space after the colon, but not  before.  
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> x: int
+</PRE>
+  <em>Exception</em>: in the case of operators (like <tt>+</tt>), there is a  space before the colon to avoid lexing the colon as part of the  operator. 
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> + : t * t -&gt; t
+</PRE>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ Alphabetize specifications in signatures.  
+<pre class=code>
+<B><FONT COLOR="#0000FF">sig</FONT></B> 
+   <B><FONT COLOR="#A020F0">val</FONT></B> x: int 
+   <B><FONT COLOR="#A020F0">val</FONT></B> y: bool 
+<B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+ 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-c64b6d8ab6a3167af6b211df05198e555a8951eb"><a href="#bottom"><img src="moin-bottom.png" alt="[BOTTOM]" height="10" width="14"></a><a href="#top"><img src="moin-top.png" alt="[TOP]" height="10" width="14"></a>Structures</h2>
+
+    <ul>
+
+    <li>
+<p>
+ A <tt>structure</tt> declaration has a space on both sides of the  <tt>=</tt>. 
+<pre class=code>
+<B><FONT COLOR="#0000FF">structure</FONT></B> Foo = Bar
+</PRE>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ A <tt>structure</tt> declaration split over multiple lines is indented  as follows. 
+<pre class=code>
+<B><FONT COLOR="#0000FF">structure</FONT></B> S =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#A020F0">val</FONT></B> x = <B><FONT COLOR="#5F9EA0">13</FONT></B>
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ Declarations in a <tt>struct</tt> are separated by blank lines.  
+<pre class=code>
+<B><FONT COLOR="#0000FF">struct</FONT></B>
+   <B><FONT COLOR="#A020F0">val</FONT></B> x =
+      <B><FONT COLOR="#A020F0">let</FONT></B>
+         y = <B><FONT COLOR="#5F9EA0">13</FONT></B>
+      <B><FONT COLOR="#A020F0">in</FONT></B> 
+         y + <B><FONT COLOR="#5F9EA0">1</FONT></B>
+      <B><FONT COLOR="#A020F0">end</FONT></B>
+
+   <B><FONT COLOR="#A020F0">val</FONT></B> z = <B><FONT COLOR="#5F9EA0">14</FONT></B>
+<B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+ 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-23ac4cb38bc668a9233ce693377f7f5c3879f104"><a href="#bottom"><img src="moin-bottom.png" alt="[BOTTOM]" height="10" width="14"></a><a href="#top"><img src="moin-top.png" alt="[TOP]" height="10" width="14"></a>Functors</h2>
+
+    <ul>
+
+    <li>
+<p>
+ A <tt>functor</tt> declaration has spaces after each <tt>:</tt> (or  <tt>:&gt;</tt>) but not before, and a space before and after the  <tt>=</tt>.  It is indented as follows 
+<pre class=code>
+<B><FONT COLOR="#0000FF">functor</FONT></B> Foo (S: FOO_ARG): FOO =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+       <B><FONT COLOR="#A020F0">val</FONT></B> x = S.x
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+  <em>Exception</em>: a functor declaration in a file to itself can omit  the indentation to save horizontal space. 
+<pre class=code>
+<B><FONT COLOR="#0000FF">functor</FONT></B> Foo (S: FOO_ARG): FOO =
+<B><FONT COLOR="#0000FF">struct</FONT></B>
+
+<B><FONT COLOR="#A020F0">val</FONT></B> x = S.x
+
+<B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+    In this case, there should be a blank line after the <tt>struct</tt>}  and before the <tt>end</tt>. 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-06-13 18:59:30 by <span title="cs78147115.pp.htv.fi"><a href="VesaKarvonen">VesaKarvonen</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/SystemInfo
===================================================================
--- mlton/trunk/doc/guide/SystemInfo	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/SystemInfo	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,63 @@
+<!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>SystemInfo - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      SystemInfo
+    <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">
+<p>
+<dl><dt>Python Version</dt><dd>2.2.3 (#1, Oct 25 2004, 20:26:02) 
+[GCC 2.96 20000731 (Red Hat Linux 7.3 2.96-113)]</dd><dt>MoinMoin Version</dt><dd>Release 1.2.3 [Revision 1.186]</dd><dt>Number of pages</dt><dd>304</dd><dt>Number of system pages</dt><dd>2</dd><dt>Number of backup versions</dt><dd>1108</dd><dt>Accumulated page sizes</dt><dd>528027</dd><dt>Entries in edit log</dt><dd>1546 (150530 bytes)</dd><dt>Event log</dt><dd>23328193 bytes</dd><dt>Global extension macros</dt><dd>AbandonedPages, BR, FootNote, Form, FullSearch, GetText, Include, Navigation, OrphanedPages, PageHits, PageSize, RandomPage, RandomQuote, RecentChanges, ShowSmileys, StatsChart, SystemAdmin, TableOfContents, TeudView, WantedPages</dd><dt>Local extension macros</dt><dd>Cite, Div, DownloadSVN, Form, Improvement, IncludeSVN, Input, Span, TextArea, ViewCVS, ViewCVSDir, ViewSVN, ViewSVNDir</dd><dt>Global extension actions</dt><dd>AttachFile, DeletePage, LikePages, LocalSiteMap, RenamePage, SpellCheck, links, rss_rc, titleindex</dd><dt>Local extension actions</dt><dd>AllLinks</dd><dt>Installed processors</dt><dd>CSV, Colorize</dd></dl 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-10-26 01:42:46 by <span title="eponym"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/TILT
===================================================================
--- mlton/trunk/doc/guide/TILT	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/TILT	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,59 @@
+<!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>TILT - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      TILT
+    <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">
+<a class="external" href="http://www-2.cs.cmu.edu/~fox/tilt.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">TILT</a> is a  <a href="StandardMLImplementations">Standard ML Compiler</a>. </div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-30 20:11:27 by <span title="adsl-64-166-225-13.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Talk
===================================================================
--- mlton/trunk/doc/guide/Talk	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Talk	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,85 @@
+<!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>Talk - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Talk
+    <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">
+<h2 id="head-90e90a1990eca672026367cc0b035840339c759a">The MLton Standard ML Compiler</h2>
+<p>
+<strong>Henry Cejtin, Matthew Fluet, Suresh Jagannathan, Stephen Weeks</strong> 
+</p>
+<p>
+<br>
+<br>
+<br>
+<br>
+ 
+<div>
+<table width="100%">
+<tr>
+<td>
+</td>
+</tr>
+<tr>
+<td width="50%" align="left">
+</td>
+<td width="50%" align="right">
+<a href="TalkStandardML"> Next</a></td>
+</tr>
+
+</p>
+</table>
+</div>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-01 16:48:10 by <span title="roam59-224.fas.harvard.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/TalkDiveIn
===================================================================
--- mlton/trunk/doc/guide/TalkDiveIn	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/TalkDiveIn	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,104 @@
+<!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>TalkDiveIn - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      TalkDiveIn
+    <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">
+<h3 id="head-f43d0c1bd8a3cecc6b8fb01925a72c14dc1fa53c">Dive In</h3>
+
+    <ul>
+
+    <li>
+<p>
+ to <a href="Development">Development</a> 
+</p>
+</li>
+    <li>
+<p>
+ to <a href="Documentation">Documentation</a> 
+</p>
+</li>
+    <li>
+<p>
+ to <a href="http://mlton.org/Download">Download</a> 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+<br>
+<br>
+<br>
+<br>
+ 
+<div>
+<table width="100%">
+<tr>
+<td>
+</td>
+</tr>
+<tr>
+<td width="50%" align="left">
+<a class="nonexistent" href="ZZZPrev"> Prev</a></td>
+<td width="50%" align="right">
+</td>
+</tr>
+
+</p>
+</table>
+</div>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-01 18:35:50 by <span title="cfs38.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/TalkFolkLore
===================================================================
--- mlton/trunk/doc/guide/TalkFolkLore	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/TalkFolkLore	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,104 @@
+<!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>TalkFolkLore - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      TalkFolkLore
+    <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">
+<h3 id="head-ddb69ed63e8678c41f36461729cc4854057a2645">Folk Lore</h3>
+
+    <ul>
+
+    <li>
+<p>
+ Defunctorization and monomorphisation are feasible 
+</p>
+</li>
+    <li>
+<p>
+ Global control-flow analysis is feasible 
+</p>
+</li>
+    <li>
+<p>
+ Early closure conversion is feasible 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+<br>
+<br>
+<br>
+<br>
+ 
+<div>
+<table width="100%">
+<tr>
+<td>
+</td>
+</tr>
+<tr>
+<td width="50%" align="left">
+<a href="TalkWholeProgram"> Prev</a></td>
+<td width="50%" align="right">
+<a href="TalkMLtonFeatures"> Next</a></td>
+</tr>
+
+</p>
+</table>
+</div>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-01 18:35:55 by <span title="cfs38.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/TalkFromSMLTo
===================================================================
--- mlton/trunk/doc/guide/TalkFromSMLTo	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/TalkFromSMLTo	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,94 @@
+<!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>TalkFromSMLTo - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      TalkFromSMLTo
+    <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">
+<h3 id="head-0ac5d35f6ac8daff64cc9ef7c10830603069dbb4">From Standard ML to S-T F-O IL</h3>
+
+    <ul>
+
+    <li>
+<p>
+ What issues arise when translating from Standard ML into an intermediate language? 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+<br>
+<br>
+<br>
+<br>
+ 
+<div>
+<table width="100%">
+<tr>
+<td>
+</td>
+</tr>
+<tr>
+<td width="50%" align="left">
+<a href="TalkMLtonApproach"> Prev</a></td>
+<td width="50%" align="right">
+<a href="TalkHowModules"> Next</a></td>
+</tr>
+
+</p>
+</table>
+</div>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-01 18:39:02 by <span title="roam59-224.fas.harvard.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/TalkHowHigherOrder
===================================================================
--- mlton/trunk/doc/guide/TalkHowHigherOrder	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/TalkHowHigherOrder	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,102 @@
+<!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>TalkHowHigherOrder - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      TalkHowHigherOrder
+    <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">
+<h3 id="head-3dde582718ae466cb705d4335c55389cf4153dcf">Higher-order Functions</h3>
+
+    <ul>
+
+    <li>
+<p>
+ How does one represent SML's higher-order functions? 
+</p>
+</li>
+    <li>
+<p>
+ MLton's answer: defunctionalize 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+<br>
+<br>
+<br>
+<br>
+ 
+<div>
+<table width="100%">
+<tr>
+<td>
+</td>
+</tr>
+<tr>
+<td width="50%" align="left">
+<a href="TalkHowPolymorphism"> Prev</a></td>
+<td width="50%" align="right">
+<a href="TalkWholeProgram"> Next</a></td>
+</tr>
+
+</p>
+</table>
+</div>
+<p>
+See <a href="ClosureConvert">ClosureConvert</a>. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-01 18:36:01 by <span title="cfs38.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/TalkHowModules
===================================================================
--- mlton/trunk/doc/guide/TalkHowModules	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/TalkHowModules	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,102 @@
+<!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>TalkHowModules - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      TalkHowModules
+    <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">
+<h3 id="head-04e9462c0ff02bb9032b92abd45881a3c7e15fb7">Modules</h3>
+
+    <ul>
+
+    <li>
+<p>
+ How does one represent SML's modules? 
+</p>
+</li>
+    <li>
+<p>
+ MLton's answer: defunctorize  
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+<br>
+<br>
+<br>
+<br>
+ 
+<div>
+<table width="100%">
+<tr>
+<td>
+</td>
+</tr>
+<tr>
+<td width="50%" align="left">
+<a href="TalkFromSMLTo"> Prev</a></td>
+<td width="50%" align="right">
+<a href="TalkHowPolymorphism"> Next</a></td>
+</tr>
+
+</p>
+</table>
+</div>
+<p>
+See <a href="Elaborate">Elaborate</a>. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-01 18:36:07 by <span title="cfs38.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/TalkHowPolymorphism
===================================================================
--- mlton/trunk/doc/guide/TalkHowPolymorphism	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/TalkHowPolymorphism	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,102 @@
+<!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>TalkHowPolymorphism - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      TalkHowPolymorphism
+    <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">
+<h3 id="head-989fc91d044783d05d714e433d3e90dca9bdf4da">Polymorphism</h3>
+
+    <ul>
+
+    <li>
+<p>
+ How does one represent SML's polymorphism? 
+</p>
+</li>
+    <li>
+<p>
+ MLton's answer: monomorphise 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+<br>
+<br>
+<br>
+<br>
+ 
+<div>
+<table width="100%">
+<tr>
+<td>
+</td>
+</tr>
+<tr>
+<td width="50%" align="left">
+<a href="TalkHowModules"> Prev</a></td>
+<td width="50%" align="right">
+<a href="TalkHowHigherOrder"> Next</a></td>
+</tr>
+
+</p>
+</table>
+</div>
+<p>
+See <a href="Monomorphise">Monomorphise</a>. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-01 18:36:12 by <span title="cfs38.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/TalkMLtonApproach
===================================================================
--- mlton/trunk/doc/guide/TalkMLtonApproach	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/TalkMLtonApproach	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,99 @@
+<!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>TalkMLtonApproach - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      TalkMLtonApproach
+    <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">
+<h3 id="head-a00c0e74428c246ccf005335d1c43840e88b3de0">MLton's Approach</h3>
+
+    <ul>
+
+    <li>
+<p>
+ whole-program optimization using a simply-typed, first-order intermediate language 
+</p>
+</li>
+    <li>
+<p>
+ ensures programs are not penalized for exploiting abstraction and modularity 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+<br>
+<br>
+<br>
+<br>
+ 
+<div>
+<table width="100%">
+<tr>
+<td>
+</td>
+</tr>
+<tr>
+<td width="50%" align="left">
+<a href="TalkStandardML"> Prev</a></td>
+<td width="50%" align="right">
+<a href="TalkFromSMLTo"> Next</a></td>
+</tr>
+
+</p>
+</table>
+</div>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-01 18:36:17 by <span title="cfs38.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/TalkMLtonFeatures
===================================================================
--- mlton/trunk/doc/guide/TalkMLtonFeatures	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/TalkMLtonFeatures	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,129 @@
+<!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>TalkMLtonFeatures - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      TalkMLtonFeatures
+    <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">
+<h3 id="head-5b1a6fd8c9d60c6ca10ad3d1a22bac14e5a8d802">MLton Features</h3>
+
+    <ul>
+
+    <li>
+<p>
+ Supports full Standard ML language and Basis Library 
+</p>
+</li>
+    <li>
+<p>
+ Generates standalone executables 
+</p>
+</li>
+    <li>
+<p>
+ Extensions 
+</p>
+</li>
+
+            <ul>
+
+            <li>
+<p>
+ Foreign function interface (SML to C, C to SML) 
+</p>
+</li>
+            <li>
+<p>
+ ML Basis system for programming in the very large 
+</p>
+</li>
+            <li>
+<p>
+ Extension libraries 
+</p>
+</li>
+
+            </ul>
+
+
+
+    </ul>
+
+
+<p>
+<br>
+<br>
+<br>
+<br>
+ 
+<div>
+<table width="100%">
+<tr>
+<td>
+</td>
+</tr>
+<tr>
+<td width="50%" align="left">
+<a href="TalkFolkLore"> Prev</a></td>
+<td width="50%" align="right">
+<a href="TalkMLtonHistory"> Next</a></td>
+</tr>
+
+</p>
+</table>
+</div>
+<p>
+See <a href="Features">Features</a>. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-28 21:49:50 by <span title="cfs36.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/TalkMLtonHistory
===================================================================
--- mlton/trunk/doc/guide/TalkMLtonHistory	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/TalkMLtonHistory	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,151 @@
+<!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>TalkMLtonHistory - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      TalkMLtonHistory
+    <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">
+<h3 id="head-029f614592e2bb46252d511b011dedaece877fa4">MLton History</h3>
+
+    <ul>
+
+
+<div>
+<table>
+ <tr>
+<td>
+ April 1997    </td>
+<td>
+ Stephen Weeks wrote a defunctorizer for SML/NJ  </td>
+</tr>
+ <tr>
+<td>
+ Aug. 1997   </td>
+<td>
+ Begin independent compiler (<tt>smlc</tt>)                     </td>
+</tr>
+ <tr>
+<td>
+ Oct. 1997  </td>
+<td>
+ Monomorphiser                                                 </td>
+</tr>
+ <tr>
+<td>
+ Nov. 1997 </td>
+<td>
+ Polyvariant higher-order control-flow analysis (10,000 lines) </td>
+</tr>
+ <tr>
+<td>
+ March 1999    </td>
+<td>
+ First release of MLton (48,006 lines) </td>
+</tr>
+ <tr>
+<td>
+ Jan. 2002     </td>
+<td>
+ MLton at 102,541 lines                </td>
+</tr>
+ <tr>
+<td>
+ Jan. 2003     </td>
+<td>
+ MLton at 112,204 lines                </td>
+</tr>
+ <tr>
+<td>
+ Jan. 2004     </td>
+<td>
+ MLton at 122,299 lines                </td>
+</tr>
+ <tr>
+<td>
+ Nov. 2004     </td>
+<td>
+ MLton at 141,311 lines                </td>
+</tr>
+</table>
+</div>
+
+    </ul>
+
+
+<p>
+<br>
+<br>
+<br>
+<br>
+ 
+<div>
+<table width="100%">
+<tr>
+<td>
+</td>
+</tr>
+<tr>
+<td width="50%" align="left">
+<a href="TalkMLtonFeatures"> Prev</a></td>
+<td width="50%" align="right">
+<a href="TalkDiveIn"> Next</a></td>
+</tr>
+
+</p>
+</table>
+</div>
+<p>
+See <a href="History">History</a>. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-01 18:42:32 by <span title="roam59-224.fas.harvard.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/TalkStandardML
===================================================================
--- mlton/trunk/doc/guide/TalkStandardML	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/TalkStandardML	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,141 @@
+<!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>TalkStandardML - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      TalkStandardML
+    <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">
+<h3 id="head-84688ded485c841f4bf79a10e4d6cac96460cee2">Standard ML</h3>
+
+    <ul>
+
+    <li>
+<p>
+ a high-level language makes 
+</p>
+</li>
+
+            <ul>
+
+            <li>
+<p>
+ a programmer's life easier 
+</p>
+</li>
+            <li>
+<p>
+ a compiler writer's life harder 
+</p>
+</li>
+
+            </ul>
+
+
+    <li class="gap">
+<p>
+ perceived overheads of features discourage their use 
+</p>
+</li>
+
+            <ul>
+
+            <li>
+<p>
+ higher-order functions 
+</p>
+</li>
+            <li>
+<p>
+ polymorphic datatypes 
+</p>
+</li>
+            <li>
+<p>
+ separate modules 
+</p>
+</li>
+
+            </ul>
+
+
+
+    </ul>
+
+
+<p>
+<br>
+<br>
+<br>
+<br>
+ 
+<div>
+<table width="100%">
+<tr>
+<td>
+</td>
+</tr>
+<tr>
+<td width="50%" align="left">
+<a href="Talk"> Prev</a></td>
+<td width="50%" align="right">
+<a href="TalkMLtonApproach"> Next</a></td>
+</tr>
+
+</p>
+</table>
+</div>
+<p>
+Also see <a href="StandardML">Standard ML</a>. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-18 15:02:29 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/TalkTemplate
===================================================================
--- mlton/trunk/doc/guide/TalkTemplate	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/TalkTemplate	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,99 @@
+<!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>TalkTemplate - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      TalkTemplate
+    <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">
+<h3 id="head-768e0c1c69573fb588f61f1308a015c11468e05f">Title</h3>
+
+    <ul>
+
+    <li>
+<p>
+ Bullet 
+</p>
+</li>
+    <li>
+<p>
+ Bullet 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+<br>
+<br>
+<br>
+<br>
+ 
+<div>
+<table width="100%">
+<tr>
+<td>
+</td>
+</tr>
+<tr>
+<td width="50%" align="left">
+<a class="nonexistent" href="ZZZPrev"> Prev</a></td>
+<td width="50%" align="right">
+<a class="nonexistent" href="ZZZNext"> Next</a></td>
+</tr>
+
+</p>
+</table>
+</div>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-01 18:59:26 by <span title="cfs38.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/TalkWholeProgram
===================================================================
--- mlton/trunk/doc/guide/TalkWholeProgram	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/TalkWholeProgram	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,121 @@
+<!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>TalkWholeProgram - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      TalkWholeProgram
+    <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">
+<h3 id="head-52e9f6ea6f9e818afdab5293628ee00ee7798bed">Whole Program Compiler</h3>
+
+    <ul>
+
+    <li>
+<p>
+ Each of these techniques requires whole-program analysis 
+</p>
+</li>
+    <li>
+<p>
+ But, additional benefits: 
+</p>
+</li>
+
+            <ul>
+
+            <li>
+<p>
+ eliminate (some) variablity in programming styles 
+</p>
+</li>
+            <li>
+<p>
+ specialize representations 
+</p>
+</li>
+            <li>
+<p>
+ simplifies and improves runtime system 
+</p>
+</li>
+
+            </ul>
+
+
+
+    </ul>
+
+
+<p>
+<br>
+<br>
+<br>
+<br>
+ 
+<div>
+<table width="100%">
+<tr>
+<td>
+</td>
+</tr>
+<tr>
+<td width="50%" align="left">
+<a href="TalkHowHigherOrder"> Prev</a></td>
+<td width="50%" align="right">
+<a href="TalkFolkLore"> Next</a></td>
+</tr>
+
+</p>
+</table>
+</div>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-01 18:40:55 by <span title="roam59-224.fas.harvard.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/ToMachine
===================================================================
--- mlton/trunk/doc/guide/ToMachine	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/ToMachine	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,75 @@
+<!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>ToMachine - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      ToMachine
+    <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">
+A translation pass from the <a href="RSSA">RSSA</a> <a href="IntermediateLanguage">IntermediateLanguage</a> to the <a href="Machine">Machine</a> <a href="IntermediateLanguage">IntermediateLanguage</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Conversion from a <a href="RSSA">RSSA</a> program into a <a href="Machine">Machine</a> program. 
+</p>
+<p>
+Uses <a href="AllocateRegisters">AllocateRegisters</a>, <a href="Chunkify">Chunkify</a>, and <a href="ParallelMove">ParallelMove</a>. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/backend.sig?view=markup">backend.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/backend.fun?view=markup">backend.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+<p>
+Because the MLton runtime system is shared by all codegens, it is most convenient to decide on stack layout <em>before</em> any codegen takes over.  In particular, we compute all the stack frame info for each <a href="RSSA">RSSA</a> function, including stack size, <a class="nonexistent" href="GarbageCollector">GarbageCollector</a> masks for each frame, etc.  To do so, the <a href="Machine">Machine</a> <a href="IntermediateLanguage">IntermediateLanguage</a> imagines an abstract machine with an infinite number of (pseudo-)registers of every size.  A liveness analysis determines, for each variable, whether or not it is live across a point where the runtime system might take over (for example, any garbage collection point) or a non-tail call to another <a href="RSSA">RSSA</a> function.  Those that are live go on the stack, while those that aren't live go into psuedo-registers.  From this information, we know all we need to about each stack frame.  On the downside, nothing further on is allowed to change this stack info; it is set in stone. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:24:44 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/ToRSSA
===================================================================
--- mlton/trunk/doc/guide/ToRSSA	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/ToRSSA	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,72 @@
+<!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>ToRSSA - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      ToRSSA
+    <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">
+A translation pass from the <a href="SSA2">SSA2</a> <a href="IntermediateLanguage">IntermediateLanguage</a> to the <a href="RSSA">RSSA</a> <a href="IntermediateLanguage">IntermediateLanguage</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Converts a <a href="SSA2">SSA2</a> program into a <a href="RSSA">RSSA</a> program. 
+</p>
+<p>
+Uses <a href="PackedRepresentation">PackedRepresentation</a>. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/backend/ssa-to-rssa.sig?view=markup">ssa-to-rssa.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/backend/ssa-to-rssa.fun?view=markup">ssa-to-rssa.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:24:25 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/ToSSA2
===================================================================
--- mlton/trunk/doc/guide/ToSSA2	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/ToSSA2	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,94 @@
+<!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>ToSSA2 - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      ToSSA2
+    <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">
+A translation pass from the <a href="SSA">SSA</a> <a href="IntermediateLanguage">IntermediateLanguage</a> to the <a href="SSA2">SSA2</a> <a href="IntermediateLanguage">IntermediateLanguage</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Simple conversion from a <a href="SSA">SSA</a> program into a <a href="SSA2">SSA2</a> program. 
+</p>
+<p>
+The only interesting portions of the translation are: 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ a <a href="SSA">SSA</a> <tt>ref</tt> type becomes an object with a single mutable field 
+</p>
+</li>
+    <li>
+<p>
+ <tt>array</tt>, <tt>vector</tt>, and <tt>ref</tt> are eliminated in favor of select and updates 
+</p>
+</li>
+    <li>
+<p>
+ <tt>Case</tt> transfers separate discrimination and constructor argument selects 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/ssa-to-ssa2.sig?view=markup">ssa-to-ssa2.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/ssa-to-ssa2.fun?view=markup">ssa-to-ssa2.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:24:11 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/TrustedGroup
===================================================================
--- mlton/trunk/doc/guide/TrustedGroup	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/TrustedGroup	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,82 @@
+<!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>TrustedGroup - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      TrustedGroup
+    <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">
+<p>
+This list of users is for <a href="AccessControl">AccessControl</a>. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="HenryCejtin">HenryCejtin</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="MatthewFluet">MatthewFluet</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="StephenWeeks">StephenWeeks</a> 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-29 19:54:24 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/TypeChecking
===================================================================
--- mlton/trunk/doc/guide/TypeChecking	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/TypeChecking	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,203 @@
+<!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>TypeChecking - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      TypeChecking
+    <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">
+MLton's type checker follows the Definition of SML closely, so you may find differences between MLton and other SML compilers that do not follow the Definition so closely.  In particular, SML/NJ has many deviations from the Definition -- please see <a href="SMLNJDeviations">SMLNJDeviations</a> for those that we are aware of. <p>
+In some respects MLton's type checker is more powerful than other SML compilers, so there are programs that MLton accepts that are rejected by some other SML compilers.  These kinds of programs fall into a few simple categories. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ MLton resolves flexible record patterns using a larger context than  many other SML compilers.  For example, MLton accepts the  following. 
+<pre class=code>
+<B><FONT COLOR="#A020F0">fun</FONT></B> f {x, ...} = x
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = f {x = <B><FONT COLOR="#5F9EA0">13</FONT></B>, y = <FONT COLOR="#BC8F8F"><B>&quot;foo&quot;</FONT></B>}
+</PRE>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ MLton uses as large a context as possible to resolve the type of  variables constrained by the value resriction to be monotypes.  For  example, MLton accepts the following. 
+<pre class=code>
+<B><FONT COLOR="#0000FF">structure</FONT></B> S:
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">val</FONT></B> f: int -&gt; int
+   <B><FONT COLOR="#0000FF">end</FONT></B> =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#A020F0">val</FONT></B> f = (<B><FONT COLOR="#A020F0">fn</FONT></B> x =&gt; x) (<B><FONT COLOR="#A020F0">fn</FONT></B> y =&gt; y)
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+ 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-05f93ee06dde2d7fa78009c59b64a585bd6ab4ca">Type error messages</h2>
+<p>
+To aid in the understanding of type errors, MLton's type checker displays type errors differently than other SML compilers.  In particular, when two types are different, it is important for the programmer to easily understand why they are different.  So, MLton displays only the differences between two types that don't match, using underscores for the parts that do.  For example, if a function expects <tt>real&nbsp;*&nbsp;int</tt> but gets <tt>real&nbsp;*&nbsp;real</tt>, the type error message would look like 
+</p>
+
+<pre>expects: _ * [int]
+but got: _ * [real]
+</pre><p>
+As another aid to spotting differences, MLton places brackets <tt>[]</tt> around the parts of the types that don't match.  A common situation is when a function receives a different number of arguments than it expects, in which case you might see an error like 
+</p>
+
+<pre>expects: [int * real]
+but got: [int * real * string]
+</pre><p>
+The brackets make it easy to see that the problem is that the tuples have different numbers of components -- not that the components don't match.  Contrast that with a case where a function receives the right number of arguments, but in the wrong order. 
+</p>
+
+<pre>expects: [int] * [real]
+but got: [real] * [int]
+</pre><p>
+Here the brackets make it easy to see that the components do not match. 
+</p>
+<p>
+MLton's type checker is fairly new.  If you encounter a difference between MLton and another SML compiler, or even with an older version of MLton, and are not able to determine if it is a bug, please send mail to <a class="external" href="mailto:MLton@mlton.org"><img src="moin-email.png" alt="[MAILTO]" height="10" width="14">MLton@mlton.org</a>.  We would also appreciate feedback on any type error messages that you find confusing, or suggestions you may have for improvements to error messages. 
+</p>
+<h2 id="head-e849875c2946f3612529e7b5c9eeeb137490f29b">The shortest/most-recent rule for type names</h2>
+<p>
+In a type error message, MLton often has a number of choices in deciding what name to use for a type.  For example, in the following type-incorrect program 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> int
+</FONT></B><B><FONT COLOR="#A020F0">fun</FONT></B> f (x: t) = x
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = f <FONT COLOR="#BC8F8F"><B>&quot;foo&quot;</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<p>
+MLton reports 
+</p>
+
+<pre>Error: z.sml 3.9.
+  Function applied to incorrect argument.
+    expects: [t]
+    but got: [string]
+    in: f "foo"
+</pre><p>
+MLton could have reported <tt>expects:&nbsp;[int]</tt> instead of  <tt>expects:&nbsp;[t]</tt>.  However, MLton uses the shortest/most-recent rule in order to decide what type name to display.  This rule means that, at the point of the error, MLton first looks for the shortest name for a type in terms of number of structure identifiers (e.g. <tt>foobar</tt> is shorter than <tt>A.t</tt>).  Next, if there are multiple names of the same length, then MLton uses the most recently defined name.  It is this tiebreaker that causes MLton to prefer <tt>t</tt> to <tt>int</tt> in the above example. 
+</p>
+<p>
+In signature matching, most recently defined is taken to include all of the definitions introduced by the structure.  For example 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">structure</FONT></B> S:
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">val</FONT></B> x: int
+   <B><FONT COLOR="#0000FF">end</FONT></B> =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> int
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> x = <FONT COLOR="#BC8F8F"><B>&quot;foo&quot;</FONT></B>
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<p>
+MLton reports the error message 
+</p>
+
+<pre>Error: z.sml 2.4.
+  Variable type in structure disagrees with signature.
+    variable: x
+    structure: [string]
+    signature: [t]
+</pre><p>
+in which the <tt>[t]</tt> refers to the type defined in the structure, since that is more recent than the definition of <tt>int</tt>. 
+</p>
+<p>
+In signatures with type equations, this can be somewhat confusing. For example. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">structure</FONT></B> S:
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t
+      </FONT></B><B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> u </FONT></B>=<FONT COLOR="#228B22"><B> t
+   </FONT></B><B><FONT COLOR="#0000FF">end</FONT></B> =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> int
+      </FONT></B><B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> u </FONT></B>=<FONT COLOR="#228B22"><B> char
+   </FONT></B><B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<p>
+MLton reports the error 
+</p>
+
+<pre>Error: z.sml 2.4.
+  Type definition in structure disagrees with signature.
+    type: u
+    structure: [u]
+    signature: [t]
+</pre><p>
+This error reflects the fact that the signature requires type <tt>u</tt> to equal <tt>t</tt>, but that in the structure, <tt>u</tt> is defined to be <tt>char</tt>, whose most-recent name is <tt>u</tt>, while the signature requires <tt>u</tt> to be <tt>int</tt>, whose most-recent name is <tt>t</tt>. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-24 15:10:30 by <span title="cfs35.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/TypeConstructor
===================================================================
--- mlton/trunk/doc/guide/TypeConstructor	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/TypeConstructor	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,102 @@
+<!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>TypeConstructor - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      TypeConstructor
+    <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">
+A type constructor is a function from types to types.  Type constructors can be <em>nullary</em>, meaning that they take no arguments, as in <tt>char</tt>, <tt>int</tt>, and <tt>real</tt>.  Type constructors can be <em>unary</em>, meaning that they take one argument, as in <tt>array</tt>, <tt>list</tt>, and <tt>vector</tt>.  A program can define a new type constructor in two ways: a <tt>type</tt> definition or a <tt>datatype</tt> declaration.  User-defined type constructors can can take any number of arguments. 
+<pre class=code>
+<B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">T</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> int * real            <I><FONT COLOR="#B22222">(* 0 arguments *)</FONT></I>
+</FONT></B><B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> 'a t </FONT></B>=<FONT COLOR="#228B22"><B> 'a * int                    <I><FONT COLOR="#B22222">(* 1 argument *)</FONT></I>
+</FONT></B><B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> ('a, 'b) t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">A</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">B</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> 'a * 'b  <I><FONT COLOR="#B22222">(* 2 arguments *)</FONT></I>
+</FONT></B><B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> ('a, 'b, 'c) t </FONT></B>=<FONT COLOR="#228B22"><B> 'a * ('b  -&gt; 'c)  <I><FONT COLOR="#B22222">(* 3 arguments *)</FONT></I>
+</FONT></B></PRE>
+<p>
+ 
+</p>
+<p>
+Here are the syntax rules for type constructor application. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ Type constructor application is written in postfix.  So, one writes  <tt>int&nbsp;list</tt>, not <tt>list&nbsp;int</tt>.   
+</p>
+</li>
+    <li class="gap">
+<p>
+ Unary type constructors drop the parens, so one writes   <tt>int&nbsp;list</tt>, not <tt>(int)&nbsp;list</tt>.   
+</p>
+</li>
+    <li class="gap">
+<p>
+ Nullary type constructors drop the argument entirely, so one writes  <tt>int</tt>, not <tt>()&nbsp;int</tt>.  
+</p>
+</li>
+    <li class="gap">
+<p>
+ N-ary type consructors use tuple notation; for example,   <tt>(int,&nbsp;real)&nbsp;t</tt>.  
+</p>
+</li>
+    <li class="gap">
+<p>
+ Type constructor application associates to the left.  So,  <tt>int&nbsp;ref&nbsp;list</tt> is the same as <tt>(int&nbsp;ref)&nbsp;list</tt>. 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-29 19:46:56 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/TypeVariableScope
===================================================================
--- mlton/trunk/doc/guide/TypeVariableScope	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/TypeVariableScope	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,225 @@
+<!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>TypeVariableScope - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      TypeVariableScope
+    <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">
+In <a href="StandardML">Standard ML</a>, a type variable can be either implicitly scoped or explicitly scoped.  For example, <tt>'a</tt> is implicitly scoped in 
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> id: 'a -&gt; 'a = <B><FONT COLOR="#A020F0">fn</FONT></B> x =&gt; x
+</PRE>
+<p>
+ 
+</p>
+<p>
+and is implicitly scoped in 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> id = <B><FONT COLOR="#A020F0">fn</FONT></B> x: 'a =&gt; x
+</PRE>
+<p>
+ 
+</p>
+<p>
+On the other hand, <tt>'a</tt> is explicitly scoped in  
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> <FONT COLOR="#228B22"><B>'a</FONT></B> id: 'a -&gt; 'a = <B><FONT COLOR="#A020F0">fn</FONT></B> x =&gt; x
+</PRE>
+<p>
+ 
+</p>
+<p>
+and is explicitly scoped in 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> <FONT COLOR="#228B22"><B>'a</FONT></B> id = <B><FONT COLOR="#A020F0">fn</FONT></B> x: 'a =&gt; x
+</PRE>
+<p>
+ 
+</p>
+<p>
+A type variable can be scoped at a <tt>val</tt> or <tt>fun</tt> declaration. An SML type checker performs scope inference on each top-level declaration to determine the scope of each implicitly scoped type variable.  After scope inference, every type variable is scoped at exactly one enclosing <tt>val</tt> or <tt>fun</tt> declaration.  Scope inference shows that the first and second example above are equivalent to the third and fourth example, respectively. 
+</p>
+<p>
+Section 4.6 of the <a href="DefinitionOfStandardML">Definition</a> specifies precisely the scope of an implicitly scoped type variable.  A free occurrence of a type variable <tt>'a</tt> in a declaration <tt>d</tt> is said to be <em>unguarded</em> in <tt>d</tt> if <tt>'a</tt> is not part of a smaller declaration.  A type variable <tt>'a</tt> is implicitly scoped at <tt>d</tt> if <tt>'a</tt> is unguarded in <tt>d</tt> and <tt>'a</tt> does not occur unguarded in any declaration containing <tt>d</tt>. 
+</p>
+<h2 id="head-f24dd90ad62588fe27464c5912820b859384b6d0">Scope inference examples</h2>
+
+    <ul>
+
+    <li>
+<p>
+ In this example, 
+<pre class=code>
+ <B><FONT COLOR="#A020F0">val</FONT></B> id: 'a -&gt; 'a = <B><FONT COLOR="#A020F0">fn</FONT></B> x =&gt; x
+</PRE>
+  <tt>'a</tt> is unguarded in <tt>val&nbsp;id</tt> and does not occur unguarded in  any containing declaration.  Hence, <tt>'a</tt> is scoped at   <tt>val&nbsp;id</tt> and the declaration is equivalent to the  following. 
+<pre class=code>
+ <B><FONT COLOR="#A020F0">val</FONT></B> <FONT COLOR="#228B22"><B>'a</FONT></B> id: 'a -&gt; 'a = <B><FONT COLOR="#A020F0">fn</FONT></B> x =&gt; x
+</PRE>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ In this example, 
+<pre class=code>
+ <B><FONT COLOR="#A020F0">val</FONT></B> f = <B><FONT COLOR="#A020F0">fn</FONT></B> x =&gt; <B><FONT COLOR="#A020F0">let</FONT></B> <B><FONT COLOR="#A020F0">exception</FONT></B><FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">E</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> 'a </FONT></B><B><FONT COLOR="#A020F0">in</FONT></B> E x <B><FONT COLOR="#A020F0">end</FONT></B>
+</PRE>
+  <tt>'a</tt> is unguarded in <tt>val&nbsp;f</tt> and does not occur unguarded in  any containing declaration.  Hence, <tt>'a</tt> is scoped at <tt>val&nbsp;f</tt>  and the declaration is equivalent to the following. 
+<pre class=code>
+ <B><FONT COLOR="#A020F0">val</FONT></B> <FONT COLOR="#228B22"><B>'a</FONT></B> f = <B><FONT COLOR="#A020F0">fn</FONT></B> x =&gt; <B><FONT COLOR="#A020F0">let</FONT></B> <B><FONT COLOR="#A020F0">exception</FONT></B><FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">E</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> 'a </FONT></B><B><FONT COLOR="#A020F0">in</FONT></B> E x <B><FONT COLOR="#A020F0">end</FONT></B>
+</PRE>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ In this example (taken from the   <a href="DefinitionOfStandardML">Definition</a>), 
+<pre class=code>
+ <B><FONT COLOR="#A020F0">val</FONT></B> x: int -&gt; int = <B><FONT COLOR="#A020F0">let</FONT></B> <B><FONT COLOR="#A020F0">val</FONT></B> id: 'a -&gt; 'a = <B><FONT COLOR="#A020F0">fn</FONT></B> z =&gt; z <B><FONT COLOR="#A020F0">in</FONT></B> id id <B><FONT COLOR="#A020F0">end</FONT></B>
+</PRE>
+  <tt>'a</tt> occurs unguarded in <tt>val&nbsp;id</tt>, but not in <tt>val&nbsp;x</tt>.  Hence, <tt>'a</tt> is implicitly scoped at <tt>val&nbsp;id</tt>, and the  declaration is equivalent to the following. 
+<pre class=code>
+ <B><FONT COLOR="#A020F0">val</FONT></B> x: int -&gt; int = <B><FONT COLOR="#A020F0">let</FONT></B> <B><FONT COLOR="#A020F0">val</FONT></B> <FONT COLOR="#228B22"><B>'a</FONT></B> id: 'a -&gt; 'a = <B><FONT COLOR="#A020F0">fn</FONT></B> z =&gt; z <B><FONT COLOR="#A020F0">in</FONT></B> id id <B><FONT COLOR="#A020F0">end</FONT></B>
+</PRE>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ In this example, 
+<pre class=code>
+ <B><FONT COLOR="#A020F0">val</FONT></B> f = (<B><FONT COLOR="#A020F0">fn</FONT></B> x: 'a =&gt; x) (<B><FONT COLOR="#A020F0">fn</FONT></B> y =&gt; y)
+</PRE>
+  <tt>'a</tt> occurs unguarded in <tt>val&nbsp;f</tt> and does not occur unguarded  in any containing declaration.  Hence, <tt>'a</tt> is implicitly scoped  at <tt>val&nbsp;f</tt>, and the declaration is equivalent to the  following. 
+<pre class=code>
+ <B><FONT COLOR="#A020F0">val</FONT></B> <FONT COLOR="#228B22"><B>'a</FONT></B> f = (<B><FONT COLOR="#A020F0">fn</FONT></B> x: 'a =&gt; x) (<B><FONT COLOR="#A020F0">fn</FONT></B> y =&gt; y)
+</PRE>
+  This does not type check due to the <a href="ValueRestriction">ValueRestriction</a>. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ In this example, 
+<pre class=code>
+ <B><FONT COLOR="#A020F0">fun</FONT></B> f x =
+   <B><FONT COLOR="#A020F0">let</FONT></B>
+      <B><FONT COLOR="#A020F0">fun</FONT></B> g (y: 'a) = <B><FONT COLOR="#A020F0">if</FONT></B> true <B><FONT COLOR="#A020F0">then</FONT></B> x <B><FONT COLOR="#A020F0">else</FONT></B> y
+   <B><FONT COLOR="#A020F0">in</FONT></B>
+      g x
+   <B><FONT COLOR="#A020F0">end</FONT></B>
+</PRE>
+  <tt>'a</tt> occurs unguarded in <tt>fun&nbsp;g</tt>, not in <tt>fun&nbsp;f</tt>.  Hence,  <tt>'a</tt> is implicitly scoped at <tt>fun&nbsp;g</tt>, and the declaration is  equivalent to 
+<pre class=code>
+ <B><FONT COLOR="#A020F0">fun</FONT></B> f x =
+   <B><FONT COLOR="#A020F0">let</FONT></B>
+      <B><FONT COLOR="#A020F0">fun</FONT></B> <FONT COLOR="#228B22"><B>'a</FONT></B> g (y: 'a) = <B><FONT COLOR="#A020F0">if</FONT></B> true <B><FONT COLOR="#A020F0">then</FONT></B> x <B><FONT COLOR="#A020F0">else</FONT></B> y
+   <B><FONT COLOR="#A020F0">in</FONT></B>
+      g x
+   <B><FONT COLOR="#A020F0">end</FONT></B>
+</PRE>
+  This fails to type check because <tt>x</tt> and <tt>y</tt> must have the  same type, and hence <tt>'a</tt> can not be generalized at <tt>fun&nbsp;g</tt>.  MLton reports 
+<pre>Error: scope.sml 3.7.
+  Unable to generalize 'a.
+    in: fun 'a g ((y): 'a) = (if true then x else y)</pre> This problem could be fixed either by adding an explicit type  constraint, as in <tt>fun&nbsp;f&nbsp;(x:&nbsp;'a)</tt>, or by explicitly scoping  <tt>'a</tt>, as in <tt>fun&nbsp;'a&nbsp;f&nbsp;x</tt>. 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-81ce55eaa74172900a5b3e8e477b08f4b4327a0b">Restrictions on type variable scope</h2>
+<p>
+It is not allowed to scope a type variable within a declaration in which it is already in scope (see the last restriction listed on page 9 of the <a href="DefinitionOfStandardML">Definition</a>).  For example, the following program is invalid. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">fun</FONT></B> <FONT COLOR="#228B22"><B>'a</FONT></B> f (x: 'a) =
+   <B><FONT COLOR="#A020F0">let</FONT></B>
+      <B><FONT COLOR="#A020F0">fun</FONT></B> <FONT COLOR="#228B22"><B>'a</FONT></B> g (y: 'a) = y
+   <B><FONT COLOR="#A020F0">in</FONT></B>
+      ()
+   <B><FONT COLOR="#A020F0">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<p>
+MLton reports  
+<pre>Error: z.sml 3.11.
+  Type variable 'a scoped at an outer declaration.
+</pre>
+</p>
+<p>
+This is an error even if the scoping is implicit.  That is, the following program is invalid as well. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">fun</FONT></B> f (x: 'a) =
+   <B><FONT COLOR="#A020F0">let</FONT></B>
+      <B><FONT COLOR="#A020F0">fun</FONT></B> <FONT COLOR="#228B22"><B>'a</FONT></B> g (y: 'a) = y
+   <B><FONT COLOR="#A020F0">in</FONT></B>
+      ()
+   <B><FONT COLOR="#A020F0">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-26 19:41:40 by <span title="cfs36.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Unicode
===================================================================
--- mlton/trunk/doc/guide/Unicode	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Unicode	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,74 @@
+<!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>Unicode - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Unicode
+    <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 current release of MLton does not support Unicode.  We are working on adding support. 
+    <ul>
+
+    <li>
+<p>
+ <tt>WideChar</tt> structure. 
+</p>
+</li>
+    <li>
+<p>
+ UTF-8 encoded source files. 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:52:18 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/UniversalType
===================================================================
--- mlton/trunk/doc/guide/UniversalType	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/UniversalType	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,205 @@
+<!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>UniversalType - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      UniversalType
+    <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">
+A universal type is a type into which all other types can be embedded. Here's a <a href="StandardML">Standard ML</a> signature for a universal type. 
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> UNIVERSAL_TYPE =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t
+
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> embed: unit -&gt; ('a -&gt; t) * (t -&gt; 'a option)
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<p>
+The idea is that <tt>type&nbsp;t</tt> is the universal type and that each call to <tt>embed</tt> returns a new pair of functions  <tt>(inject,&nbsp;project)</tt>, where <tt>inject</tt> embeds a value into the universal type and <tt>project</tt> extracts the value from the universal type.  A pair <tt>(inject,&nbsp;project)</tt> returned by <tt>embed</tt> works together in that <tt>project&nbsp;u</tt> will return <tt>SOME&nbsp;v</tt> if and only if <tt>u</tt> was created by <tt>inject&nbsp;v</tt>.  If <tt>u</tt> was created by a different function <tt>inject'</tt>, then <tt>project</tt> returns <tt>NONE</tt>. 
+</p>
+<p>
+Here's an example embedding integers and reals into a universal type. 
+<pre class=code>
+<B><FONT COLOR="#0000FF">functor</FONT></B> Test (U: UNIVERSAL_TYPE): <B><FONT COLOR="#0000FF">sig</FONT></B> <B><FONT COLOR="#0000FF">end</FONT></B> =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#A020F0">val</FONT></B> (intIn: int -&gt; U.t, intOut) = U.embed ()
+      <B><FONT COLOR="#A020F0">val</FONT></B> r: U.t ref = ref (intIn <B><FONT COLOR="#5F9EA0">13</FONT></B>)
+      <B><FONT COLOR="#A020F0">val</FONT></B> s1 =
+         <B><FONT COLOR="#A020F0">case</FONT></B> intOut (!r) <B><FONT COLOR="#A020F0">of</FONT></B>
+            NONE =&gt; <FONT COLOR="#BC8F8F"><B>&quot;NONE&quot;</FONT></B>
+          | SOME i =&gt; Int.toString i
+      <B><FONT COLOR="#A020F0">val</FONT></B> (realIn: real -&gt; U.t, realOut) = U.embed ()
+      <B><FONT COLOR="#A020F0">val</FONT></B> () = r := realIn <B><FONT COLOR="#5F9EA0">13.0</FONT></B>
+      <B><FONT COLOR="#A020F0">val</FONT></B> s2 =
+         <B><FONT COLOR="#A020F0">case</FONT></B> intOut (!r) <B><FONT COLOR="#A020F0">of</FONT></B>
+            NONE =&gt; <FONT COLOR="#BC8F8F"><B>&quot;NONE&quot;</FONT></B>
+          | SOME i =&gt; Int.toString i
+      <B><FONT COLOR="#A020F0">val</FONT></B> s3 =
+         <B><FONT COLOR="#A020F0">case</FONT></B> realOut (!r) <B><FONT COLOR="#A020F0">of</FONT></B>
+            NONE =&gt; <FONT COLOR="#BC8F8F"><B>&quot;NONE&quot;</FONT></B>
+          | SOME x =&gt; Real.toString x
+      <B><FONT COLOR="#A020F0">val</FONT></B> () = print (concat [s1, <FONT COLOR="#BC8F8F"><B>&quot; &quot;</FONT></B>, s2, <FONT COLOR="#BC8F8F"><B>&quot; &quot;</FONT></B>, s3, <FONT COLOR="#BC8F8F"><B>&quot;\n&quot;</FONT></B>])
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+ 
+</p>
+<p>
+Applying <tt>Test</tt> to an appropriate implementation will print 
+<pre>13 NONE 13.0
+</pre>
+</p>
+<p>
+Note that two different calls to embed on the same type return different embeddings. 
+</p>
+<p>
+Standard ML does not have explicit support for universal types; however, there are at least two ways to implement them. 
+</p>
+<h2 id="head-5ab5e9f7a9267673649cd34bf0a7cf4b914d2288">Implementation Using Exceptions</h2>
+<p>
+While the intended use of SML exceptions is for exception handling, an accidental feature of their design is that the <tt>exn</tt> type is a universal type.  The implementation relies on being able to declare exceptions locally to a function and on the fact that exceptions are <a href="GenerativeException">generative</a>. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">structure</FONT></B> U:&gt; UNIVERSAL_TYPE =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> exn
+
+      </FONT></B><B><FONT COLOR="#A020F0">fun</FONT></B> <FONT COLOR="#228B22"><B>'a</FONT></B> embed () =
+         <B><FONT COLOR="#A020F0">let</FONT></B>
+            <B><FONT COLOR="#A020F0">exception</FONT></B><FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">E</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> 'a
+            </FONT></B><B><FONT COLOR="#A020F0">fun</FONT></B> project (e: t): 'a option =
+               <B><FONT COLOR="#A020F0">case</FONT></B> e <B><FONT COLOR="#A020F0">of</FONT></B>
+                  E a =&gt; SOME a
+                | _ =&gt; NONE
+         <B><FONT COLOR="#A020F0">in</FONT></B>
+            (E, project)
+         <B><FONT COLOR="#A020F0">end</FONT></B>
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<h2 id="head-ce424b82430977939b90a4c1cb21f7a8e6f6301c">Implementation Using Functions and References</h2>
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">structure</FONT></B> U:&gt; UNIVERSAL_TYPE =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">T</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> {clear: unit -&gt; unit,
+                         store: unit -&gt; unit}
+
+      </FONT></B><B><FONT COLOR="#A020F0">fun</FONT></B> <FONT COLOR="#228B22"><B>'a</FONT></B> embed () =
+         <B><FONT COLOR="#A020F0">let</FONT></B>
+            <B><FONT COLOR="#A020F0">val</FONT></B> r: 'a option ref = ref NONE
+            <B><FONT COLOR="#A020F0">fun</FONT></B> inject (a: 'a): t =
+               T {clear = <B><FONT COLOR="#A020F0">fn</FONT></B> () =&gt; r := NONE,
+                  store = <B><FONT COLOR="#A020F0">fn</FONT></B> () =&gt; r := SOME a}
+            <B><FONT COLOR="#A020F0">fun</FONT></B> project (T {clear, store}): 'a option =
+               <B><FONT COLOR="#A020F0">let</FONT></B>
+                  <B><FONT COLOR="#A020F0">val</FONT></B> () = store ()
+                  <B><FONT COLOR="#A020F0">val</FONT></B> res = !r
+                  <B><FONT COLOR="#A020F0">val</FONT></B> () = clear ()
+               <B><FONT COLOR="#A020F0">in</FONT></B>
+                  res
+               <B><FONT COLOR="#A020F0">end</FONT></B>
+         <B><FONT COLOR="#A020F0">in</FONT></B>
+            (inject, project)
+         <B><FONT COLOR="#A020F0">end</FONT></B>
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<p>
+Note that due to the use of a shared ref cell, the above implementation is not thread safe. 
+</p>
+<p>
+One could try to simplify the above implementation by eliminating the <tt>clear</tt> function, making <tt>type&nbsp;t&nbsp;=&nbsp;unit&nbsp;-&gt;&nbsp;unit</tt>. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#0000FF">structure</FONT></B> U:&gt; UNIVERSAL_TYPE =
+   <B><FONT COLOR="#0000FF">struct</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> unit -&gt; unit
+
+      </FONT></B><B><FONT COLOR="#A020F0">fun</FONT></B> <FONT COLOR="#228B22"><B>'a</FONT></B> embed () =
+         <B><FONT COLOR="#A020F0">let</FONT></B>
+            <B><FONT COLOR="#A020F0">val</FONT></B> r: 'a option ref = ref NONE
+            <B><FONT COLOR="#A020F0">fun</FONT></B> inject (a: 'a): t = <B><FONT COLOR="#A020F0">fn</FONT></B> () =&gt; r := SOME a
+            <B><FONT COLOR="#A020F0">fun</FONT></B> project (f: t): 'a option = (r := NONE; f (); !r)
+         <B><FONT COLOR="#A020F0">in</FONT></B>
+            (inject, project)
+         <B><FONT COLOR="#A020F0">end</FONT></B>
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<p>
+While correct, this approach keeps the contents of the ref cell alive longer than necessary, which could cause a space leak.  The problem is in <tt>project</tt>, where the call to <tt>f</tt> stores some value in some ref cell <tt>r'</tt>.  Perhaps <tt>r'</tt> is the same ref cell as <tt>r</tt>, but perhaps not.  If we do not clear <tt>r'</tt> before returning from <tt>project</tt>, then <tt>r'</tt> will keep the value alive, even though it is useless. 
+</p>
+<h2 id="head-a4bc8bf5caf54b18cea9f58e83dd4acb488deb17">Also see</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="PropertyList">PropertyList</a>: Lisp-style property lists implemented with a  universal type. 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-05-29 03:04:34 by <span title="cs78147114.pp.htv.fi"><a href="VesaKarvonen">VesaKarvonen</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/UnresolvedBugs
===================================================================
--- mlton/trunk/doc/guide/UnresolvedBugs	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/UnresolvedBugs	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,118 @@
+<!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>UnresolvedBugs - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      UnresolvedBugs
+    <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">
+Here are the places where MLton deviates from the <a href="DefinitionOfStandardML">Definition of SML</a>.  In general, MLton complies with the Definition quite closely, typically much more closely than other SML compilers (see, e.g., our list of <a href="SMLNJDeviations">SML/NJ's deviations</a>).  In fact, the three deviations listed here are the only known deviations that we have no plans to fix.  If you find a deviation not listed here, please report a <a href="Bug">Bug</a>. <p>
+We don't plan to fix these bugs because one of them (parsing nested cases) has historically never been accepted by any SML compiler, while the other two clearly indicate problems in the Definition. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ MLton does not correctly parse case expressions nested within other  matches. For example, the following fails. 
+<pre class=code>
+<B><FONT COLOR="#A020F0">fun</FONT></B> f <B><FONT COLOR="#5F9EA0">0</FONT></B> y =
+      <B><FONT COLOR="#A020F0">case</FONT></B> x <B><FONT COLOR="#A020F0">of</FONT></B>
+         <B><FONT COLOR="#5F9EA0">1</FONT></B> =&gt; <B><FONT COLOR="#5F9EA0">2</FONT></B>
+       | _ =&gt; <B><FONT COLOR="#5F9EA0">3</FONT></B>
+  | f _ y = <B><FONT COLOR="#5F9EA0">4</FONT></B>
+</PRE>
+   To do this in a program, simply parenthesize the case expression. 
+</p>
+<p>
+ Allowing such expressions, although compliant with the Definition,  would be a mistake, since using parentheses is clearer and no SML  compiler has ever allowed them.  Furthermore, implementing this would  require serious yacc grammar rewriting followed by postprocessing. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ MLton rejects rebinding of constructors with <tt>val&nbsp;rec</tt>  declarations, as in 
+<pre class=code>
+ <B><FONT COLOR="#A020F0">val</FONT></B> <B><FONT COLOR="#A020F0">rec</FONT></B> NONE = <B><FONT COLOR="#A020F0">fn</FONT></B> () =&gt; ()
+</PRE>
+  The <a href="DefinitionOfStandardML"> Definition</a> (bizarrely) requires this  program to type check, but to raise <tt>Bind</tt>.  
+</p>
+<p>
+ We have no plans to change this behavior, as the Definition's  behavior is clearly an error, a mismatch between the static semantics  and the dynamic semantics. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ MLton does not hide the equality aspect of types declared in  abstype declarations. So, MLton accepts programs like the following,  while the <a href="DefinitionOfStandardML"> Definition</a> rejects them. 
+<pre class=code>
+<B><FONT COLOR="#A020F0">abstype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">T</FONT> </FONT></B><B><FONT COLOR="#A020F0">with</FONT></B> <B><FONT COLOR="#A020F0">end</FONT></B>
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = <B><FONT COLOR="#A020F0">fn</FONT></B> (t1, t2 : t) =&gt; t1 = t2
+
+<B><FONT COLOR="#A020F0">abstype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">T</FONT> </FONT></B><B><FONT COLOR="#A020F0">with</FONT></B> <B><FONT COLOR="#A020F0">val</FONT></B> a = T <B><FONT COLOR="#A020F0">end</FONT></B>
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = a = a
+</PRE>
+  One consequence of this choice is that MLton accepts the following  program, in accordance with the <a href="DefinitionOfStandardML"> Definition</a>. 
+<pre class=code>
+ <B><FONT COLOR="#A020F0">abstype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">T</FONT> </FONT></B><B><FONT COLOR="#A020F0">with</FONT></B> <B><FONT COLOR="#A020F0">val</FONT></B> eq = <B><FONT COLOR="#A020F0">op</FONT></B> = <B><FONT COLOR="#A020F0">end</FONT></B>
+ <B><FONT COLOR="#A020F0">val</FONT></B> _ = <B><FONT COLOR="#A020F0">fn</FONT></B> (t1, t2 : t) =&gt; eq (t1, t2)
+</PRE>
+  Other implementations will typically reject this program, because  they make an early choice for the type of <tt>eq</tt> to be   <tt>''a&nbsp;*&nbsp;''a&nbsp;-&gt;&nbsp;bool</tt> instead of <tt>t&nbsp;*&nbsp;t&nbsp;-&gt;&nbsp;bool</tt>.  The choice  is understandable, since the <a href="DefinitionOfStandardML">Definition</a>  accepts the following program. 
+<pre class=code>
+ <B><FONT COLOR="#A020F0">abstype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">T</FONT> </FONT></B><B><FONT COLOR="#A020F0">with</FONT></B> <B><FONT COLOR="#A020F0">val</FONT></B> eq = <B><FONT COLOR="#A020F0">op</FONT></B> = <B><FONT COLOR="#A020F0">end</FONT></B>
+ <B><FONT COLOR="#A020F0">val</FONT></B> _ = eq (<B><FONT COLOR="#5F9EA0">1</FONT></B>, <B><FONT COLOR="#5F9EA0">2</FONT></B>)
+</PRE>
+ 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-26 20:29:51 by <span title="cfs36.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/UnsafeStructure
===================================================================
--- mlton/trunk/doc/guide/UnsafeStructure	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/UnsafeStructure	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,101 @@
+<!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>UnsafeStructure - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      UnsafeStructure
+    <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">
+This module is a subset of the <tt>Unsafe</tt> module provided by SML/NJ. 
+<pre class=code>
+<B><FONT COLOR="#0000FF">signature</FONT></B> UNSAFE_MONO_ARRAY =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> array
+      </FONT></B><B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> elem
+
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> create: int -&gt; array
+      <B><FONT COLOR="#A020F0">val</FONT></B> sub: array * int -&gt; elem
+      <B><FONT COLOR="#A020F0">val</FONT></B> update: array * int * elem -&gt; unit
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+
+<B><FONT COLOR="#0000FF">signature</FONT></B> UNSAFE_MONO_VECTOR =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> elem
+      </FONT></B><B><FONT COLOR="#A020F0">type</FONT></B><FONT COLOR="#228B22"><B> vector
+
+      </FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> sub: vector * int -&gt; elem
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+
+<B><FONT COLOR="#0000FF">signature</FONT></B> UNSAFE =
+   <B><FONT COLOR="#0000FF">sig</FONT></B>
+      <B><FONT COLOR="#0000FF">structure</FONT></B> Array:
+         <B><FONT COLOR="#0000FF">sig</FONT></B>
+            <B><FONT COLOR="#A020F0">val</FONT></B> create: int * 'a -&gt; 'a array
+            <B><FONT COLOR="#A020F0">val</FONT></B> sub: 'a array * int -&gt; 'a
+            <B><FONT COLOR="#A020F0">val</FONT></B> update: 'a array * int * 'a -&gt; unit
+         <B><FONT COLOR="#0000FF">end</FONT></B>
+      <B><FONT COLOR="#0000FF">structure</FONT></B> CharArray: UNSAFE_MONO_ARRAY
+      <B><FONT COLOR="#0000FF">structure</FONT></B> CharVector: UNSAFE_MONO_VECTOR
+      <B><FONT COLOR="#0000FF">structure</FONT></B> Real64Array: UNSAFE_MONO_ARRAY
+      <B><FONT COLOR="#0000FF">structure</FONT></B> Vector:
+         <B><FONT COLOR="#0000FF">sig</FONT></B>
+            <B><FONT COLOR="#A020F0">val</FONT></B> sub: 'a vector * int -&gt; 'a
+         <B><FONT COLOR="#0000FF">end</FONT></B>
+      <B><FONT COLOR="#0000FF">structure</FONT></B> Word8Array: UNSAFE_MONO_ARRAY
+      <B><FONT COLOR="#0000FF">structure</FONT></B> Word8Vector: UNSAFE_MONO_VECTOR
+   <B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-26 20:29:31 by <span title="cfs36.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Useless
===================================================================
--- mlton/trunk/doc/guide/Useless	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Useless	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,113 @@
+<!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>Useless - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Useless
+    <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">
+<p>
+An optimization pass for the <a href="SSA">SSA</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="SSASimplify">SSASimplify</a>. 
+</p>
+<h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Useless thing elimination: 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ remove components of tuples that are constants (use unification) 
+</p>
+</li>
+    <li>
+<p>
+ remove function arguments that are constants 
+</p>
+</li>
+    <li>
+<p>
+ build some kind of dependence graph where  
+</p>
+</li>
+
+            <ul>
+
+   - a value of ground type is useful if it is an arg to a primitive    - a tuple is useful if it contains a useful component    - a constructor is useful if it contains a useful component or is used in a <tt>Case</tt> transfer 
+            </ul>
+
+
+
+    </ul>
+
+
+<p>
+If a useful tuple is coerced to another useful tuple, then all of their components must agree (exactly). It is trivial to convert a useful value to a useless one. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/useless.sig?view=markup">useless.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/useless.fun?view=markup">useless.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+<p>
+It is also trivial to convert a useful tuple to one of its useful components -- but this seems hard. 
+</p>
+<p>
+Suppose that you have a <tt>ref</tt>/<tt>array</tt>/<tt>vector</tt> that is useful, but the components aren't -- then the components are converted to type <tt>unit</tt>, and any primitive args must be as well. 
+</p>
+<p>
+Unify all handler arguments so that <tt>raise</tt>/<tt>handle</tt> has a consistent calling convention. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:23:54 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/UserGuide
===================================================================
--- mlton/trunk/doc/guide/UserGuide	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/UserGuide	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,59 @@
+<!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>UserGuide - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      UserGuide
+    <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">
+See <a href="Documentation">Documentation</a>. </div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-05 19:27:29 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Users
===================================================================
--- mlton/trunk/doc/guide/Users	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Users	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,193 @@
+<!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>Users - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Users
+    <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">
+Here is a list of companies, projects, and courses that use or have used MLton.  If you use MLton and are not here, please add your project with a brief description and a link.  Thanks. <h2 id="head-9dba7ad7c5bdb2aa80495855ae01b2cbb94d11c9">Companies</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a class="external" href="http://www.hardcoreprocessing.com/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Hardcore Processing</a> uses MLton as a <a class="external" href="http://www.hardcoreprocessing.com/Freeware/MLTonWin32.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">crosscompiler from Linux to Windows</a> for graphics and game software. 
+</p>
+</li>
+
+        <ul>
+
+        <li>
+<p>
+ <a class="external" href="http://www.cex3d.net/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">CEX3D Converter</a>, a conversion program for 3D objects. 
+</p>
+</li>
+        <li>
+<p>
+ <a class="external" href="http://www.hardcoreprocessing.com/company/showreel/index.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Interactive Showreel</a>, which contains a crossplatform GUI-toolkit and a realtime renderer for a subset of R<strong></strong>enderMan written in Standard ML. 
+</p>
+</li>
+        <li>
+<p>
+ various <a class="external" href="http://www.hardcoreprocessing.com/entertainment/index.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">games</a> 
+</p>
+</li>
+
+        </ul>
+
+
+    <li>
+<p>
+ <a class="external" href="http://www.polyspace.com/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">PolySpace Technologies</a> builds their product that detects runtime errors in embedded systems based on abstract interpretation.  
+</p>
+</li>
+    <li>
+<p>
+ <a class="external" href="http://www.sourcelight.com/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Sourcelight Technologies</a> uses MLton internally for prototyping and for processing databases as part of their system that makes personalized movie recommendations. 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-53e890d5f0fffe09587c55dce74e9a6febf59b5c">Projects</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a class="external" href="http://www-ia.hiof.no/%7Erolando/adate_intro.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ADATE</a>, Automatic Design of Algorithms Through Evolution, a system for automatic programming i.e., inductive inference of algorithms. ADATE can automatically generate non-trivial and novel algorithms written in Standard ML. 
+</p>
+</li>
+    <li>
+<p>
+ <a class="external" href="http://types.bu.edu/reports/Dim+Wes+Mul+Tur+Wel+Con:TIC-2000-LNCS.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">CIL</a>, a compiler for SML based on intersection and union types. 
+</p>
+</li>
+    <li>
+<p>
+ <a class="external" href="http://www.cs.cmu.edu/%7Econcert/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">ConCert</a>, a project investigating certified code for grid computing. 
+</p>
+</li>
+    <li>
+<p>
+ <a class="external" href="http://hcoop.sourceforge.net/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Cooperative Internet hosting tools</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a class="external" href="http://www.fantasy-coders.de/projects/gh/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Guugelhupf</a>, a simple search engine. 
+</p>
+</li>
+    <li>
+<p>
+ <a class="external" href="http://www.ps.uni-sb.de/hamlet/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">HaMLet</a> a model implementation of Standard ML. 
+</p>
+</li>
+    <li>
+<p>
+ <a class="external" href="http://www.cl.cam.ac.uk/users/jeh1004/research/metis/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Metis</a>, a first-order prover used in the <a class="external" href="http://hol.sourceforge.net/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">HOL4 theorem proving system</a>. 
+</p>
+</li>
+    <li>
+<p>
+ <a class="external" href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tom7misc/net/mlftpd"><img src="moin-www.png" alt="[WWW]" height="11" width="11">mlftpd</a>, an ftp daemon written in SML.  Tom Murphy is also working on <a class="external" href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tom7misc/net/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">replacements for standard network services</a> in SML.  He also uses MLton to build his entries (<a class="external" href="http://www.cs.cmu.edu/~tom7/icfp2001/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">2001</a>, <a class="external" href="http://www.cs.cmu.edu/~tom7/icfp2002/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">2002</a>, <a class="external" href="http://www.cs.cmu.edu/~tom7/icfp2004/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">2004</a>) in the annual ICFP programming contest. 
+</p>
+</li>
+    <li>
+<p>
+ <a class="external" href="http://www.informatik.uni-freiburg.de/proglang/research/software/mlope/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">MLOPE</a>, an offline partial evaluator for Standard ML. 
+</p>
+</li>
+    <li>
+<p>
+ <a class="external" href="http://www.cis.ksu.edu/~allen/smlnjtrans.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">SMLNJtrans</a>, a program for generating SML/NJ transcripts in LaTeX. 
+</p>
+</li>
+    <li>
+<p>
+ <a class="external" href="http://www-2.cs.cmu.edu/%7Etom7/ssapre/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">SSA PRE</a>, an implementation of Partial Redundancy Elimination for MLton. 
+</p>
+</li>
+    <li>
+<p>
+ <a class="external" href="http://www.laas.fr/tina"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Tina</a> (Time Petri net Analyzer) 
+</p>
+</li>
+    <li>
+<p>
+ <a class="external" href="http://www.twelf.org/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Twelf</a> an implementation of the LF logical framework. 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-a16536d78dc34897436003938234d72482a1d526">Courses</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a class="external" href="http://www.eecs.harvard.edu/%7Enr/cs152/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Harvard CS-152</a>, undergraduate programming languages. 
+</p>
+</li>
+    <li>
+<p>
+ <a class="external" href="http://www.ia-stud.hiof.no/%7Erolando/PL/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Høgskolen i Østfold IAI30202</a>, programming languages. 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-03-12 10:39:14 by <span title="adsl-63-195-184-47.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/ValueRestriction
===================================================================
--- mlton/trunk/doc/guide/ValueRestriction	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/ValueRestriction	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,349 @@
+<!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>ValueRestriction - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      ValueRestriction
+    <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 value restriction is a rule that governs when type inference is allowed to polymorphically generalize a value declaration.  In short, the value restriction says that generalization can only occur if the right-hand side of an expression is syntactically a value.  For example, in 
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> f = <B><FONT COLOR="#A020F0">fn</FONT></B> x =&gt; x
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = (f <FONT COLOR="#BC8F8F"><B>&quot;foo&quot;</FONT></B>; f <B><FONT COLOR="#5F9EA0">13</FONT></B>)
+</PRE>
+<p>
+ 
+</p>
+<p>
+the expression <tt>fn&nbsp;x&nbsp;=&gt;&nbsp;x</tt> is syntactically a value, so <tt>f</tt> has polymorphic type <tt>'a&nbsp;-&gt;&nbsp;'a</tt> and both calls to <tt>f</tt> type check.  On the other hand, in 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> f = <B><FONT COLOR="#A020F0">let</FONT></B> <B><FONT COLOR="#A020F0">in</FONT></B> <B><FONT COLOR="#A020F0">fn</FONT></B> x =&gt; x <B><FONT COLOR="#A020F0">end</FONT></B>
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = (f <FONT COLOR="#BC8F8F"><B>&quot;foo&quot;</FONT></B>; f <B><FONT COLOR="#5F9EA0">13</FONT></B>)
+</PRE>
+<p>
+ 
+</p>
+<p>
+the expression <tt>let&nbsp;in&nbsp;fn&nbsp;x&nbsp;=&gt;&nbsp;end&nbsp;end</tt> is not syntactically a value and so <tt>f</tt> can either have type <tt>int&nbsp;-&gt;&nbsp;int</tt> or  <tt>string&nbsp;-&gt;&nbsp;string</tt>, but not <tt>'a&nbsp;-&gt;&nbsp;'a</tt>.  Hence, the program does not type check. 
+</p>
+<p>
+The <a href="DefinitionOfStandardML">Definition of SML</a> spells out precisely which expressions are syntactic values (it refers to such expressions as <em>non-expansive</em>).  An expression is a value if it is of one of the following forms. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ a constant (<tt>13</tt>, <tt>"foo"</tt>, <tt>13.0</tt>, ...) 
+</p>
+</li>
+    <li>
+<p>
+ a variable (<tt>x</tt>, <tt>y</tt>, ...) 
+</p>
+</li>
+    <li>
+<p>
+ a function (<tt>fn&nbsp;x&nbsp;=&gt;&nbsp;e</tt>) 
+</p>
+</li>
+    <li>
+<p>
+ the application of a constructor other than <tt>ref</tt> to a value (<tt>Foo&nbsp;v</tt>) 
+</p>
+</li>
+    <li>
+<p>
+ a type constrained value (<tt>v:&nbsp;t</tt>) 
+</p>
+</li>
+    <li>
+<p>
+ a tuple in which each field is a value <tt>(v1,&nbsp;v2,&nbsp;...)</tt> 
+</p>
+</li>
+    <li>
+<p>
+ a record in which each field is a value <tt>{l1&nbsp;=&nbsp;v1,&nbsp;l2&nbsp;=&nbsp;v2,&nbsp;...}&nbsp;</tt> 
+</p>
+</li>
+    <li>
+<p>
+ a list in which each element is a value <tt>[v1,&nbsp;v2,&nbsp;...]</tt> 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-703900d855ba7be2afdc98e4967fa5c011bfcb4f">Why the value restriction exists</h2>
+<p>
+The value restriction prevents a ref cell (or an array) from holding values of different types, which would allow a value of one type to be cast to another and break type safety.  If the restriction were not in place, the following program would type check. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> r: 'a option ref = ref NONE
+<B><FONT COLOR="#A020F0">val</FONT></B> r1: string option ref = r
+<B><FONT COLOR="#A020F0">val</FONT></B> r2: int option ref = r
+<B><FONT COLOR="#A020F0">val</FONT></B> () = r1 := SOME <FONT COLOR="#BC8F8F"><B>&quot;foo&quot;</FONT></B>
+<B><FONT COLOR="#A020F0">val</FONT></B> v: int = valOf (!r2)
+</PRE>
+<p>
+ 
+</p>
+<p>
+The first line violates the value restriction because <tt>ref&nbsp;NONE</tt> is not a value.  All other lines are type correct.  By its last line, the program has cast the string <tt>"foo"</tt> to an integer.  This breaks type safety, because now we can add a string to an integer with an expression like <tt>v&nbsp;+&nbsp;13</tt>.  We could even be more devious, by adding the following two lines, which allow us to threat the string <tt>"foo"</tt> as a function. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> r3: (int -&gt; int) option ref = r
+<B><FONT COLOR="#A020F0">val</FONT></B> v: int -&gt; int = valOf (!r3)
+</PRE>
+<p>
+ 
+</p>
+<p>
+Eliminating the explicit <tt>ref</tt> does nothing to fix the problem. For example, we could replace the declaration of <tt>r</tt> with the following. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> f: unit -&gt; 'a option ref = <B><FONT COLOR="#A020F0">fn</FONT></B> () =&gt; ref NONE
+<B><FONT COLOR="#A020F0">val</FONT></B> r: 'a option ref = f ()
+</PRE>
+<p>
+ 
+</p>
+<p>
+The declaration of <tt>f</tt> is well typed, while the declaration of <tt>r</tt> violates the value restriction because <tt>f&nbsp;()</tt> is not a value. 
+</p>
+<h2 id="head-e905be28be086b28f36f5a2dca87846208574296">Unnecessarily rejected programs</h2>
+<p>
+Unfortunately, the value restriction rejects some programs that could be accepted. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> id: 'a -&gt; 'a = <B><FONT COLOR="#A020F0">fn</FONT></B> x =&gt; x
+<B><FONT COLOR="#A020F0">val</FONT></B> f: 'a -&gt; 'a = id id
+</PRE>
+<p>
+ 
+</p>
+<p>
+The type constraint on <tt>f</tt> requires <tt>f</tt> to be polymorphic, which is disallowed because <tt>id&nbsp;id</tt> is not a value.  MLton reports the following type error. 
+</p>
+
+<pre>Error: z.sml 2.19.
+  Can't bind type variable: 'a.
+    in: val 'a (f): ('a -&gt; 'a) = id id
+</pre><p>
+MLton indicates the inability to make <tt>f</tt> polymorphic by saying that it can't bind the type variable <tt>'a</tt> at the declaration. MLton doesn't explicitly mention the value restriction, but that is the reason.  If we leave the type constraint off of <tt>f</tt> 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> id: 'a -&gt; 'a = <B><FONT COLOR="#A020F0">fn</FONT></B> x =&gt; x
+<B><FONT COLOR="#A020F0">val</FONT></B> f = id id
+</PRE>
+<p>
+ 
+</p>
+<p>
+then the program succeeds; however, MLton gives us the following warning. 
+</p>
+
+<pre>Warning: z.sml 2.1.
+  Unable to locally determine type of variable: f.
+    type: ??? -&gt; ???
+    in: val f = id id
+</pre><p>
+This warning indicates that neither could MLton polymorphically generalize <tt>f</tt>, nor was there enough context using <tt>f</tt> to determine its type.  This in itself is not a type error, but it it is a hint that something is wrong with our program.  Using <tt>f</tt> provides enough context to eliminate the warning. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> id: 'a -&gt; 'a = <B><FONT COLOR="#A020F0">fn</FONT></B> x =&gt; x
+<B><FONT COLOR="#A020F0">val</FONT></B> f = id id
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = f <B><FONT COLOR="#5F9EA0">13</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<p>
+But attempting to use <tt>f</tt> as a polymorphic function will fail. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> id: 'a -&gt; 'a = <B><FONT COLOR="#A020F0">fn</FONT></B> x =&gt; x
+<B><FONT COLOR="#A020F0">val</FONT></B> f = id id
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = f <B><FONT COLOR="#5F9EA0">13</FONT></B>
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = f <FONT COLOR="#BC8F8F"><B>&quot;foo&quot;</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<h2 id="head-235ee4a39a94ff98f4111b9a8cf77b0a6043c516">Alternatives to the value restriction</h2>
+<p>
+There would be nothing wrong with treating <tt>f</tt> as polymorphic in 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> id: 'a -&gt; 'a = <B><FONT COLOR="#A020F0">fn</FONT></B> x =&gt; x
+<B><FONT COLOR="#A020F0">val</FONT></B> f = id id
+</PRE>
+<p>
+ 
+</p>
+<p>
+One might think that the value restriction could be relaxed, and that only types involving <tt>ref</tt> should be disallowed.  Unfortunately, the following example shows that even the type <tt>'a&nbsp;-&gt;&nbsp;'a</tt> can cause problems.  If this program were allowed, then we could cast an integer to a string (or any other type). 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> f: 'a -&gt; 'a =
+   <B><FONT COLOR="#A020F0">let</FONT></B>
+      <B><FONT COLOR="#A020F0">val</FONT></B> r: 'a option ref = ref NONE
+   <B><FONT COLOR="#A020F0">in</FONT></B>
+      <B><FONT COLOR="#A020F0">fn</FONT></B> x =&gt;
+      <B><FONT COLOR="#A020F0">let</FONT></B>
+         <B><FONT COLOR="#A020F0">val</FONT></B> y = !r
+         <B><FONT COLOR="#A020F0">val</FONT></B> () = r := SOME x
+      <B><FONT COLOR="#A020F0">in</FONT></B>
+         <B><FONT COLOR="#A020F0">case</FONT></B> y <B><FONT COLOR="#A020F0">of</FONT></B>
+            NONE =&gt; x
+          | SOME y =&gt; y
+      <B><FONT COLOR="#A020F0">end</FONT></B>
+   <B><FONT COLOR="#A020F0">end</FONT></B>
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = f <B><FONT COLOR="#5F9EA0">13</FONT></B>
+<B><FONT COLOR="#A020F0">val</FONT></B> _ = f <FONT COLOR="#BC8F8F"><B>&quot;foo&quot;</FONT></B>
+</PRE>
+<p>
+ 
+</p>
+<p>
+The previous version of Standard ML took a different approach (<a href = "References#MilnerEtAl90">MilnerEtAl90</a>, <a href = "References#Tofte90">Tofte90</a>, <a href="ImperativeTypeVariable">ImperativeTypeVariable</a>) than the value restriction.  It encoded information in the type system about when ref cells would be created, and used this to prevent a ref cell from holding multiple types.  Although it allowed more programs to be type checked, this approach had significant drawbacks.  First, it was significantly more complex, both for implementors and for programmers. Second, it had an unfortunate interaction with the modularity, because information about ref usage was exposed in module signatures.  This either prevented the use of references for implementing a signature, or required information that one would like to keep hidden to propagate across modules. 
+</p>
+<p>
+In the early nineties, Andrew Wright studied about 250,000 lines of existing SML code and discovered that it did not make significant use of the extended typing ability, and proposed the value restriction as a simpler alternative (<a href = "References#Wright95">Wright95</a>).  This was adopted in the revised <a href="DefinitionOfStandardML">Definition of SML</a>. 
+</p>
+<h2 id="head-1d4c424ddb52840fa9f2ee0bf01858170229b540">Working with the value restriction</h2>
+<p>
+One technique for making code meet the value restriction is to <em>eta-expand</em>, which means replacing an expression <tt>e</tt> of arrow type with <tt>fn&nbsp;z&nbsp;=&gt;&nbsp;e&nbsp;z</tt> (where <tt>z</tt> does not occur in <tt>e</tt>). We can make our <tt>id&nbsp;id</tt> example type check follows. 
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> id: 'a -&gt; 'a = <B><FONT COLOR="#A020F0">fn</FONT></B> x =&gt; x
+<B><FONT COLOR="#A020F0">val</FONT></B> f: 'a -&gt; 'a = <B><FONT COLOR="#A020F0">fn</FONT></B> z =&gt; (id id) z
+</PRE>
+ This solution means that the computation (in this case <tt>id&nbsp;id</tt>) will be performed each time <tt>f</tt> is applied, instead of just once when <tt>f</tt> is declared.  In this case, that is not a problem, but it could be if the declaration of <tt>f</tt> performs substantial computation or creates a shared data structure. 
+</p>
+<p>
+Another technique that sometimes works is to move a monomorphic computation prior to a (would-be) polymorphic declaration so that the expression is a value.  Consider the following program, which fails due to the value restriction. 
+<pre class=code>
+<B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> 'a t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">A</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> string </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">B</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> 'a
+</FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> x: 'a t = A (<B><FONT COLOR="#A020F0">if</FONT></B> true <B><FONT COLOR="#A020F0">then</FONT></B> <FONT COLOR="#BC8F8F"><B>&quot;yes&quot;</FONT></B> <B><FONT COLOR="#A020F0">else</FONT></B> <FONT COLOR="#BC8F8F"><B>&quot;no&quot;</FONT></B>)
+</PRE>
+ It is easy to rewrite this program as 
+<pre class=code>
+<B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> 'a t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">A</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> string </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">B</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> 'a
+</FONT></B><B><FONT COLOR="#0000FF">local</FONT></B>
+   <B><FONT COLOR="#A020F0">val</FONT></B> s = <B><FONT COLOR="#A020F0">if</FONT></B> true <B><FONT COLOR="#A020F0">then</FONT></B> <FONT COLOR="#BC8F8F"><B>&quot;yes&quot;</FONT></B> <B><FONT COLOR="#A020F0">else</FONT></B> <FONT COLOR="#BC8F8F"><B>&quot;no&quot;</FONT></B>
+<B><FONT COLOR="#0000FF">in</FONT></B> 
+   <B><FONT COLOR="#A020F0">val</FONT></B> x: 'a t = A s
+<B><FONT COLOR="#0000FF">end</FONT></B>
+</PRE>
+ 
+</p>
+<p>
+The following example (taken from <a href = "References#Wright95">Wright95</a>) creates a ref cell to count the number of times a function is called. 
+<pre class=code>
+<B><FONT COLOR="#A020F0">val</FONT></B> count: ('a -&gt; 'a) -&gt; ('a -&gt; 'a) * (unit -&gt; int) =
+   <B><FONT COLOR="#A020F0">fn</FONT></B> f =&gt;
+   <B><FONT COLOR="#A020F0">let</FONT></B>
+      <B><FONT COLOR="#A020F0">val</FONT></B> r = ref <B><FONT COLOR="#5F9EA0">0</FONT></B>
+   <B><FONT COLOR="#A020F0">in</FONT></B>
+      (<B><FONT COLOR="#A020F0">fn</FONT></B> x =&gt; (r := <B><FONT COLOR="#5F9EA0">1</FONT></B> + !r; f x), <B><FONT COLOR="#A020F0">fn</FONT></B> () =&gt; !r)
+   <B><FONT COLOR="#A020F0">end</FONT></B>
+<B><FONT COLOR="#A020F0">val</FONT></B> id: 'a -&gt; 'a = <B><FONT COLOR="#A020F0">fn</FONT></B> x =&gt; x
+<B><FONT COLOR="#A020F0">val</FONT></B> (countId: 'a -&gt; 'a, numCalls) = count id
+</PRE>
+ 
+</p>
+<p>
+The example does not type check, due to the value restriction. However, it is easy to rewrite the program, staging the ref cell creation before the polymorphic code. 
+</p>
+
+<pre class=code>
+<B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">T</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> int ref
+</FONT></B><B><FONT COLOR="#A020F0">val</FONT></B> count1: unit -&gt; t = <B><FONT COLOR="#A020F0">fn</FONT></B> () =&gt; T (ref <B><FONT COLOR="#5F9EA0">0</FONT></B>)
+<B><FONT COLOR="#A020F0">val</FONT></B> count2: t * ('a -&gt; 'a) -&gt; (unit -&gt; int) * ('a -&gt; 'a) =
+   <B><FONT COLOR="#A020F0">fn</FONT></B> (T r, f) =&gt; (<B><FONT COLOR="#A020F0">fn</FONT></B> () =&gt; !r, <B><FONT COLOR="#A020F0">fn</FONT></B> x =&gt; (r := <B><FONT COLOR="#5F9EA0">1</FONT></B> + !r; f x))
+<B><FONT COLOR="#A020F0">val</FONT></B> id: 'a -&gt; 'a = <B><FONT COLOR="#A020F0">fn</FONT></B> x =&gt; x
+<B><FONT COLOR="#A020F0">val</FONT></B> t = count1 ()
+<B><FONT COLOR="#A020F0">val</FONT></B> countId: 'a -&gt; 'a = <B><FONT COLOR="#A020F0">fn</FONT></B> z =&gt; #<B><FONT COLOR="#5F9EA0">2</FONT></B> (count2 (t, id)) z
+<B><FONT COLOR="#A020F0">val</FONT></B> numCalls = #<B><FONT COLOR="#5F9EA0">1</FONT></B> (count2 (t, id))
+</PRE>
+<p>
+ 
+</p>
+<p>
+Of course, one can hide the constructor <tt>T</tt> inside a <tt>local</tt> or behind a signature. 
+</p>
+<h2 id="head-a4bc8bf5caf54b18cea9f58e83dd4acb488deb17">Also see</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="ImperativeTypeVariable">ImperativeTypeVariable</a> 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-02-27 02:12:16 by <span title="pool-141-151-144-215.pitt.east.verizon.net">AdamGoode</span>.
+</body></html>

Added: mlton/trunk/doc/guide/Variant
===================================================================
--- mlton/trunk/doc/guide/Variant	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Variant	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,69 @@
+<!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>Variant - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Variant
+    <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">
+A variant is an arm of a datatype declaration.  For example, the datatype 
+<pre class=code>
+<B><FONT COLOR="#A020F0">datatype</FONT></B><FONT COLOR="#228B22"><B> t </FONT></B>=<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">A</FONT> </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">B</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> int </FONT></B>|<FONT COLOR="#228B22"><B> <FONT COLOR="#B8860B">C</FONT> <B><FONT COLOR="#A020F0">of</FONT></B> real
+</FONT></B></PRE>
+<p>
+ 
+</p>
+<p>
+has three variants: <tt>A</tt>, <tt>B</tt>, and <tt>C</tt>. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-26 20:29:14 by <span title="cfs36.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/VesaKarvonen
===================================================================
--- mlton/trunk/doc/guide/VesaKarvonen	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/VesaKarvonen	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,109 @@
+<!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>VesaKarvonen - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      VesaKarvonen
+    <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">
+Vesa Karvonen is a student at the <a class="external" href="http://www.cs.helsinki.fi/index.en.html"><img src="moin-www.png" alt="[WWW]" height="11" width="11">University of Helsinki</a>. His interests lie in the design and implementation of programming languages. <p>
+Things he'd like to see for SML and hopes to be able to contribute towards: 
+</p>
+
+        <ul>
+
+        <li>
+<p>
+ A practical tool for documenting libraries. Preferably one that is   based on extracting the documentation from source code comments. 
+</p>
+</li>
+        <li class="gap">
+<p>
+ A good IDE. Possibly an enhanced SML mode (<tt>esml-mode</tt>) for Emacs.   Google for <a class="external" href="http://www.google.com/search?&amp;q=SLIME+video"><img src="moin-www.png" alt="[WWW]" height="11" width="11">SLIME video</a> to   get an idea of what he'd like to see. Some specific notes: 
+</p>
+</li>
+
+                <ul>
+
+                <li>
+<p>
+ show type at point 
+</p>
+</li>
+                <li>
+<p>
+ robust, consistent indentation 
+</p>
+</li>
+                <li>
+<p>
+ show documentation 
+</p>
+</li>
+                <li>
+<p>
+ jump to definition 
+</p>
+</li>
+
+                </ul>
+
+
+        <li class="gap">
+<p>
+ Documented and cataloged libraries. Perhaps something like   <a class="external" href="http://www.boost.org"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Boost</a>, but for SML libraries. 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-12 13:52:37 by <span title="cs78147176.pp.htv.fi"><a href="VesaKarvonen">VesaKarvonen</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/WantedPages
===================================================================
--- mlton/trunk/doc/guide/WantedPages	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/WantedPages	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,121 @@
+<!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>WantedPages - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      WantedPages
+    <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">
+Pages that don't exist and the pages that link to them. Please help fill these in.  Also see <a href="OrphanedPages">OrphanedPages</a>. <p>
+<ol>
+<li>
+<a class="nonexistent" href="CCodegen">CCodegen</a>: <a href="Chunkify">Chunkify</a></li>
+<li>
+<a href="CVS">CVS</a>: <a href="Sources">Sources</a>, <a href="Subversion">Subversion</a></li>
+<li>
+<a class="nonexistent" href="Closures">Closures</a>: <a href="MLNLFFIImplementation">MLNLFFIImplementation</a></li>
+<li>
+<a class="nonexistent" href="Codegen">Codegen</a>: <a href="Machine">Machine</a></li>
+<li>
+<a class="nonexistent" href="Defunctionalization">Defunctionalization</a>: <a href="ClosureConvert">ClosureConvert</a></li>
+<li>
+<a class="nonexistent" href="FirstOrder">FirstOrder</a>: <a href="IntermediateLanguage">IntermediateLanguage</a>, <a href="SSA">SSA</a>, <a href="SSA2">SSA2</a></li>
+<li>
+<a class="nonexistent" href="FlatLattice">FlatLattice</a>: <a href="CommonArg">CommonArg</a></li>
+<li>
+<a class="nonexistent" href="GarbageCollector">GarbageCollector</a>: <a href="ToMachine">ToMachine</a></li>
+<li>
+<a class="nonexistent" href="HelpForBeginners">HelpForBeginners</a>: <a href="WikiName">WikiName</a></li>
+<li>
+<a class="nonexistent" href="HigherOrder">HigherOrder</a>: <a href="IntermediateLanguage">IntermediateLanguage</a></li>
+<li>
+<a class="nonexistent" href="LambdaLift">LambdaLift</a>: <a href="SXMLSimplify">SXMLSimplify</a></li>
+<li>
+<a class="nonexistent" href="LookupConstants">LookupConstants</a>: <a href="Defunctorize">Defunctorize</a></li>
+<li>
+<a class="nonexistent" href="MLDoc">MLDoc</a>: <a href="Libraries">Libraries</a></li>
+<li>
+<a class="nonexistent" href="MLLex">MLLex</a>: <a href="Documentation">Documentation</a>, <a href="Features">Features</a>, <a href="FrontEnd">FrontEnd</a>, <a href="Installation">Installation</a>, <a href="Libraries">Libraries</a></li>
+<li>
+<a class="nonexistent" href="MLRISC">MLRISC</a>: <a href="Libraries">Libraries</a>, <a href="PropertyList">PropertyList</a></li>
+<li>
+<a class="nonexistent" href="MLYacc">MLYacc</a>: <a href="Documentation">Documentation</a>, <a href="Features">Features</a>, <a href="FrontEnd">FrontEnd</a>, <a href="Installation">Installation</a>, <a href="Libraries">Libraries</a>, <a href="MLBasisAvailableLibraries">MLBasisAvailableLibraries</a></li>
+<li>
+<a class="nonexistent" href="PackWord">PackWord</a>: <a href="RayRacine">RayRacine</a></li>
+<li>
+<a class="nonexistent" href="SimplyTyped">SimplyTyped</a>: <a href="IntermediateLanguage">IntermediateLanguage</a>, <a href="SSA">SSA</a>, <a href="SSA2">SSA2</a></li>
+<li>
+<a class="nonexistent" href="TypeInference">TypeInference</a>: <a href="FirstClassPolymorphism">FirstClassPolymorphism</a></li>
+<li>
+<a class="nonexistent" href="Uncurry">Uncurry</a>: <a href="SXMLSimplify">SXMLSimplify</a></li>
+<li>
+<a class="nonexistent" href="Untyped">Untyped</a>: <a href="Machine">Machine</a></li>
+<li>
+<a class="nonexistent" href="ZZA">ZZA</a>: <a href="CompilerPassTemplate">CompilerPassTemplate</a></li>
+<li>
+<a class="nonexistent" href="ZZB">ZZB</a>: <a href="CompilerPassTemplate">CompilerPassTemplate</a></li>
+<li>
+<a class="nonexistent" href="ZZZ">ZZZ</a>: <a href="CompilerPassTemplate">CompilerPassTemplate</a></li>
+<li>
+<a class="nonexistent" href="ZZZNext">ZZZNext</a>: <a href="TalkTemplate">TalkTemplate</a></li>
+<li>
+<a class="nonexistent" href="ZZZOtherPass">ZZZOtherPass</a>: <a href="CompilerPassTemplate">CompilerPassTemplate</a></li>
+<li>
+<a class="nonexistent" href="ZZZPrev">ZZZPrev</a>: <a href="TalkDiveIn">TalkDiveIn</a>, <a href="TalkTemplate">TalkTemplate</a></li>
+<li>
+<a class="nonexistent" href="ZZZSimplify">ZZZSimplify</a>: <a href="CompilerPassTemplate">CompilerPassTemplate</a></li>
+</ol>
+
+ 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-11-09 02:12:23 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/WebSite
===================================================================
--- mlton/trunk/doc/guide/WebSite	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/WebSite	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,143 @@
+<!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>WebSite - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      WebSite
+    <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">
+This web site is a Wiki and is implemented using <a href="MoinMoin">MoinMoin</a>.  If you're new to Wikis or to <a href="MoinMoin">MoinMoin</a>, they have a lot of <a class="external" href="http://moinmoin.wikiwikiweb.de/HelpContents"><img src="moin-www.png" alt="[WWW]" height="11" width="11">help</a> pages.  We have customized the look and feel, so some of their descriptions may not apply. <h2 id="head-3f170caead65df254d786032a409a6f6d204bca6">Next Steps</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="AccessControl">AccessControl</a>.  Who can edit what. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a href="CreatingPages">CreatingPages</a>. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a href="EditingPages">EditingPages</a>.   
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a href="SystemInfo">SystemInfo</a>.  What version of <a href="MoinMoin">MoinMoin</a> we use, plus more. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a href="WikiMacros">WikiMacros</a>.  Special macros for this site. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a href="WikiTool">WikiTool</a>.  Edit pages with your favorite text editor. 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-377ca2d4e81ad5d1416aa86e62b20ee91d4c6759">Site Maintenance</h2>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="OrphanedPages">OrphanedPages</a>.  Pages that no other page links to.  Please help by  linking to these.  
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a href="WantedPages">WantedPages</a>.  Pages that don't exist and the pages that link to  them.  Please help fill these in.  
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a href="http://mlton.org/OldPages">OldPages</a>.  Pages with the oldest modification times. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a href="PageSize">PageSize</a>.  Pages sorted in decreasing order of size. 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <a href="http://mlton.org/RecentChanges">RecentChanges</a>.  Pages that have been changed recently. 
+</p>
+</li>
+
+    </ul>
+
+
+<h2 id="head-cf03cf2e9cdf95a20af09137dfb9071db0c31bf2">Navigation</h2>
+<p>
+The box in the upper-right corner is to Google search the entire web site.  Also in the upper right is a link to an <a href="Index">Index</a> of all pages, sorted by page title. 
+</p>
+<p>
+You can also do a search of just the wiki.  
+</p>
+<p>
+Wiki full-text search <form method="GET"><input type="hidden" name="action" value="fullsearch"><input name="value" size="30" value="">&nbsp;<input type="submit" value="Go"><br><input type="checkbox" name="context" value="40" checked="checked">Display context of search results<br><input type="checkbox" name="case" value="1">Case-sensitive searching</form> 
+</p>
+<p>
+Wiki title search <form method="GET"><input type="hidden" name="action" value="titlesearch"><input name="value" size="30" value="">&nbsp;<input type="submit" value="Go"></form> 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-03 00:40:23 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/WesleyTerpstra
===================================================================
--- mlton/trunk/doc/guide/WesleyTerpstra	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/WesleyTerpstra	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,110 @@
+<!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>WesleyTerpstra - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      WesleyTerpstra
+    <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">
+Wesley W. Terpstra is a PhD student at the Technische Universität Darmstadt (Germany). <p>
+Research interests 
+</p>
+
+        <ul>
+
+        <li>
+<p>
+ Distributed systems (P2P) 
+</p>
+</li>
+        <li>
+<p>
+ Number theory (Error-correcting codes) 
+</p>
+</li>
+
+        </ul>
+
+
+<p>
+My interest in SML is centered on the fact the the language is able to directly express ideas from number theory which are important for my work. Modules and Functors seem to be a very natural basis for implementing many algebraic structures. MLton provides an ideal platform for actual implementation as it is fast and has unboxed words. 
+</p>
+<p>
+Things I would like from MLton in the future: 
+</p>
+
+        <ul>
+
+        <li>
+<p>
+ Some better optimization of mathematical expressions 
+</p>
+</li>
+        <li>
+<p>
+ IPv6 and multicast support 
+</p>
+</li>
+        <li>
+<p>
+ A complete GUI toolkit like mGTK 
+</p>
+</li>
+        <li>
+<p>
+ More supported platforms so that applications written under MLton have a wider audience 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-19 03:55:34 by <span title="d0-113.dip.isp-service.de"><a href="WesleyTerpstra">WesleyTerpstra</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/WholeProgramOptimization
===================================================================
--- mlton/trunk/doc/guide/WholeProgramOptimization	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/WholeProgramOptimization	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,62 @@
+<!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>WholeProgramOptimization - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      WholeProgramOptimization
+    <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">
+Whole-program optimization is a compilation technique in which optimizations operate over the entire program.  This allows the compiler many optimization opportunities that are not available when analyzing modules separately (as with separate compilation). <p>
+Most of MLton's optimizations are whole-program optimizations. Because MLton compiles the whole program at once, it can perform optimization across module boundaries.  As a consequence, MLton often reduces or eliminates the run-time penalty that arises with separate compilation of SML features such as functors, modules, polymorphism, and higher-order functions.  MLton takes advantage of having the entire program to perform transformations such as: defunctorization, monomorphisation, higher-order control-flow analysis, inlining, unboxing, argument flattening, redundant-argument removal, constant folding, and representation selection.  Whole-program compilation is an integral part of the design of MLton and is not likely to change. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-06 06:01:10 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/WikiMacros
===================================================================
--- mlton/trunk/doc/guide/WikiMacros	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/WikiMacros	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,126 @@
+<!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>WikiMacros - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      WikiMacros
+    <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">
+Here are the wiki macros available in addition to the usual <a href="MoinMoin">MoinMoin</a> ones. 
+    <ul>
+
+    <li>
+<p>
+ <tt>[[Cite(anchor,&nbsp;text)]]</tt> displays text as a link to the  corresponding reference on the <a href="References">References</a> page.  <br>
+Examples: <a href = "References#FluetWeeks01"> a paper</a> 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <tt>[[DownloadSVN(pathToFile)]]</tt> displays a download link to the ViewCVS page for  <tt>pathToFile</tt>.   <br>
+Examples: 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/*checkout*/mlton/trunk/Makefile">Makefile</a>
+, 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/*checkout*/mlton/trunk/mlton/main/main.fun">main.fun</a>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <tt>[[IncludeSVN(pathToFile,&nbsp;type)]]</tt> textually includes the latest contents of <tt>pathToFile</tt>, formatted with <a href="Enscript">Enscript</a> as <tt>type</tt> (as in the <tt>!#syntax</tt> processor).  If <tt>type</tt> is omitted, use the extension of <tt>pathToFile</tt>.  <br>
+Example: 
+</p>
+<p>
+ <pre class=code><I><FONT COLOR="#B22222">(* Copyright (C) 1999-2005 Henry Cejtin, Matthew Fluet, Suresh
+ *    Jagannathan, and Stephen Weeks.
+ * Copyright (C) 1997-2000 NEC Research Institute.
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)</FONT></I>
+
+<B><FONT COLOR="#0000FF">structure</FONT></B> Main = Main ()
+
+<B><FONT COLOR="#A020F0">val</FONT></B> _ =
+   <B><FONT COLOR="#A020F0">let</FONT></B>
+      <B><FONT COLOR="#0000FF">open</FONT></B> Trace.Immediate
+   <B><FONT COLOR="#A020F0">in</FONT></B>
+      debug := Out Out.error
+      ; flagged ()
+      ; on []
+   <B><FONT COLOR="#A020F0">end</FONT></B>
+</PRE>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <tt>[[ViewSVN(pathToFile)]]</tt> displays a link to the ViewCVS page for  <tt>pathToFile</tt>.   <br>
+Examples: 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/Makefile?view=markup">Makefile</a>
+, 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/main/main.fun?view=markup">main.fun</a>
+ 
+</p>
+</li>
+    <li class="gap">
+<p>
+ <tt>[[ViewSVNSDir(pathToDir)]]</tt> displays a link to the ViewCVS  page for <tt>pathToDir</tt>.   <br>
+Examples: 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/main">main</a>
+ 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-10 12:43:15 by <span title="net-79206.roam.fas.harvard.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/WikiName
===================================================================
--- mlton/trunk/doc/guide/WikiName	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/WikiName	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,59 @@
+<!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>WikiName - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      WikiName
+    <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">
+A WikiName is a word that uses capitalized words. WikiName<strong></strong>s automatically become hyperlinks to the WikiName's page.  Also see <a class="nonexistent" href="HelpForBeginners">HelpForBeginners</a>, "Arbitrary Page Names". </div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-10 18:20:16 by <span title="adsl-67-124-249-200.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/WikiTool
===================================================================
--- mlton/trunk/doc/guide/WikiTool	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/WikiTool	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,159 @@
+<!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>WikiTool - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      WikiTool
+    <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">
+We have written a simple command-line tool that makes it possible to edit wiki pages using your favorite text editor instead of within a browser text box.  The tool provides a cvs-like command-line interface that can be used to update local copies of files from the web and to commit local modifications to the web.   <p>
+The tool is written in SML (of course) and is  <a class="external" href="http://mlton.org/cgi-bin/viewcvs.cgi/mlton/wiki/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">available in the MLton CVS</a>. To compile it, you need to have the latest CVS of the MLton library sources, and point the mlb path variable <tt>MLTON_SRC_LIB</tt> at the <tt>lib/mlton</tt> dir in the sources. 
+</p>
+<p>
+Here's a quick tutorial on how to use the tool 
+</p>
+
+    <ol type="1">
+
+    <li>
+<p>
+Create a new directory for your local copy of the wiki files. 
+</p>
+</li>
+    <li class="gap">
+<p>
+In that directory, login.  
+<pre> wiki login http://mlton.org StephenWeeks &lt;my password&gt;</pre>
+</p>
+</li>
+    <li class="gap">
+<p>
+Checkout (the raw wiki markup) files with commands like:  
+<pre> wiki checkout Home
+ wiki checkout Index Documentation</pre>
+</p>
+</li>
+    <li class="gap">
+<p>
+Edit the files using your favorite text editor.  
+</p>
+</li>
+    <li class="gap">
+<p>
+Commit your changes with a command like   
+<pre> wiki commit UserGuide</pre>
+</p>
+</li>
+    <li class="gap">
+<p>
+Logout.  
+<pre> wiki logout</pre>
+</p>
+</li>
+
+    </ol>
+
+
+<p>
+That's it for the simple use.  There are also other commands like cvs. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ Download the new version of a file from the web if there is one.  
+<pre> wiki update UserGuide</pre>
+</p>
+</li>
+    <li class="gap">
+<p>
+ Schedule a new file to be added (must be later committed, just like  CVS) .  
+<pre> wiki add NewFile</pre>
+</p>
+</li>
+    <li class="gap">
+<p>
+ Rename a page  
+<pre> wiki rename OldFile NewFile</pre>
+</p>
+</li>
+    <li class="gap">
+<p>
+ Remove a page  
+<pre> wiki remove DeletedFile</pre>
+</p>
+</li>
+    <li class="gap">
+<p>
+ Attach files to a page  
+<pre> wiki attach &lt;file&gt; &lt;attachment&gt;</pre>
+</p>
+</li>
+    <li class="gap">
+<p>
+ Detach files to a page  
+<pre> wiki detach &lt;file&gt; &lt;attachment&gt;</pre>
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+<tt>rename</tt> and <tt>remove</tt> shouldn't work for most people on <tt>mlton.org</tt> because of the way our <a href="AccessControl">AccessControl</a> is set up. 
+</p>
+<p>
+This code is a two-day hack and is not widely used.  But we've found it useful.  Please send bug reports to <a class="external" href="mailto:MLton@mlton.org"><img src="moin-email.png" alt="[MAILTO]" height="10" width="14">MLton@mlton.org</a>. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-24 15:11:41 by <span title="cfs35.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/XML
===================================================================
--- mlton/trunk/doc/guide/XML	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/XML	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,114 @@
+<!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>XML - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      XML
+    <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">
+An <a href="IntermediateLanguage">IntermediateLanguage</a>,  translated from <a href="CoreML">CoreML</a> by <a href="Defunctorize">Defunctorize</a>,  optimized by <a href="XMLSimplify">XMLSimplify</a>, and  translated by <a href="Monomorphise">Monomorphise</a> to <a href="SXML">SXML</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+XML is polymorphic, higher-order, with flat patterns.  Every XML expression is annotated with its type.  Polymorphic generalization is made explicit through type variables annotating <tt>val</tt> and <tt>fun</tt> declarations.  Polymorphic instantiation is made explicit by specifying type arguments at variable references. XML patterns can not be nested and can not contain wildcards, constraints, flexible records, or layering. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/xml/xml.sig?view=markup">xml.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/xml/xml.fun?view=markup">xml.fun</a>
+<br>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/xml/xml-tree.sig?view=markup">xml-tree.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/xml/xml-tree.fun?view=markup">xml-tree.fun</a>
+ <h2 id="head-a6de4b535fedeaa8890bd890b60fe09f87b5f96a">Type Checking</h2>
+<p>
+XML also has a type checker, used for debugging.  At present, the type checker is also the best specification of the type system of XML.  If you need more details, the type checker (
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/xml/type-check.sig?view=markup">type-check.sig</a>
+,
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/xml/type-check.fun?view=markup">type-check.fun</a>
+), is pretty short. 
+</p>
+<p>
+Since the type checker does not affect the output of the compiler (unless it reports an error), it can be turned off.  The type checker recursively descends the program, checking that the type annotating each node is the same as the type synthesized from the types of the expressions subnodes. 
+</p>
+<h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+<p>
+XML uses the same atoms as Core ML, hence all identifiers (constructors, variables, etc.) are unique and can have properties attached to them.  Finally, XML has a simplifier (<a href="XMLShrink">XMLShrink</a>), which implements a reduction system. 
+</p>
+<h4 id="head-93b9e289e2842469d001eccf7ad5d79f3c302dc9">Types</h4>
+<p>
+XML types are either type variables or applications of n-ary type constructors.  There are many utility functions for constructing and destructing types involving built-in type constructors. 
+</p>
+<p>
+A type scheme binds list of type variables in a type.  The only interesting operation on type schemes is the application of a type scheme to a list of types, which performs a simultaneous substitution of the type arguments for the bound type variables of the scheme.  For the purposes of type checking, it is necessary to know the type scheme of variables, constructors, and primitives.  This is done by associating the scheme with the identifier using its property list. This approach is used instead of the more traditional environment approach for reasons of speed. 
+</p>
+<h4 id="head-a7be579adae76065044668534f763ced06dbf2b3">XmlTree</h4>
+<p>
+Before defining <tt>XML</tt>, the signature for language XML, we need to define an auxiliary signature <tt>XML_TREE</tt>, that contains the datatype declarations for the expression trees of XML.  This is done solely for the purpose of modularity -- it allows the simplifier and type checker to be defined by separate functors (which take a structure matching <tt>XML_TREE</tt>).  Then, <tt>Xml</tt> is defined as the signature for a module containing the expression trees, the simplifier, and the type checker. 
+</p>
+<p>
+Both constructors and variables can have type schemes, hence both constructor and variable references specify the instance of the scheme at the point of references.  An instance is specified with a vector of types, which corresponds to the type variables in the scheme. 
+</p>
+<p>
+XML patterns are flat (i.e. not nested).  A pattern is a constructor with an optional argument variable.  Patterns only occur in <tt>case</tt> expressions.  To evaluate a case expression, compare the test value sequentially against each pattern.  For the first pattern that matches, destruct the value if necessary to bind the pattern variables and evaluate the corresponding expression.  If no pattern matches, evaluate the default.  All patterns of a case statement are of the same variant of <tt>Pat.t</tt>, although this is not enforced by ML's type system.  The type checker, however, does enforce this.  Because tuple patterns are irrefutable, there will only ever be one tuple pattern in a case expression and there will be no default. 
+</p>
+<p>
+XML contains value, exception, and mutually recursive function declarations.  There are no free type variables in XML.  All type variables are explicitly bound at either a value or function declaration.  At some point in the future, exception declarations may go away, and exceptions may be represented with a single datatype containing a <tt>unit&nbsp;ref</tt> component to implement genericity. 
+</p>
+<p>
+XML expressions are like those of <a href="CoreML">CoreML</a>, with the following exceptions.  There are no records expressions.  After type inference, all records (some of which may have originally been tuples in the source) are converted to tuples, because once flexible record patterns have been resolved, tuple labels are superfluous.  Tuple components are ordered based on the field ordering relation.  XML eta expands primitives and constructors so that there are always fully applied. Hence, the only kind of value of arrow type is a lambda.  This property is useful for flow analysis and later in code generation. 
+</p>
+<p>
+An XML program is a list of toplevel datatype declarations and a body expression.  Because datatype declarations are not generative, the defunctorizer can safely move them to toplevel. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:23:34 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/XMLShrink
===================================================================
--- mlton/trunk/doc/guide/XMLShrink	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/XMLShrink	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,128 @@
+<!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>XMLShrink - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      XMLShrink
+    <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">
+An optimization pass for the <a href="XML">XML</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="XMLSimplify">XMLSimplify</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Performs optimizations based on a reduction system. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/xml/shrink.sig?view=markup">shrink.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/xml/shrink.fun?view=markup">shrink.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+<p>
+The simplifier is based on <a href = "References#AppelJim97">Shrinking Lambda Expressions in Linear Time</a>. 
+</p>
+<p>
+The source program may contain functions that are only called once, or not even called at all.  Match compilation introduces many such functions.  In order to reduce the program size, speed up later phases, and improve the flow analysis, a source to source simplifier is run on <a href="XML">XML</a> after type inference and match compilation. 
+</p>
+<p>
+The simplifier implements the reductions shown below.  The reductions eliminate unnecessary declarations (see the side constraint in the figure), applications where the function is immediate, and case statements where the test is immediate.  Declarations can be eliminated only when the expression is nonexpansive (see Section 4.7 of the <a href="DefinitionOfStandardML"> Definition</a>), which is a syntactic condition that ensures that the expression has no effects (assignments, raises, or nontermination).  The reductions on case statements do not show the other irrelevant cases that may exist.  The reductions were chosen so that they were strongly normalizing and so that they never increased tree size. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ 
+<pre>let x = e1 in e2
+</pre> reduces to 
+<pre>e2 [x -&gt; e1] 
+</pre> if <tt>e1</tt> is a constant or variable or if <tt>e1</tt> is nonexpansive and <tt>x</tt> occurs zero or one time in <tt>e2</tt>
+</p>
+</li>
+    <li class="gap">
+<p>
+ 
+<pre>(fn x =&gt; e1) e2
+</pre> reduces to 
+<pre>let x = e2 in e1
+</pre>
+</p>
+</li>
+    <li class="gap">
+<p>
+ 
+<pre>e1 handle e2
+</pre> reduces to 
+<pre>e1
+</pre> if <tt>e1</tt> is nonexpansive
+</p>
+</li>
+    <li class="gap">
+<p>
+ 
+<pre>case let d in e end of p1 =&gt; e1 ...
+</pre> reduces to 
+<pre>let d in case e of p1 =&gt; e1 ... end
+</pre>
+</p>
+</li>
+    <li class="gap">
+<p>
+ 
+<pre>case C e1 of C x =&gt; e2
+</pre> reduces to 
+<pre>let x = e1 in e2
+</pre>
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:23:16 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/XMLSimplify
===================================================================
--- mlton/trunk/doc/guide/XMLSimplify	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/XMLSimplify	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,111 @@
+<!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>XMLSimplify - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      XMLSimplify
+    <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 optimization passes for the <a href="XML">XML</a> <a href="IntermediateLanguage">IntermediateLanguage</a> are collected and controlled by the <tt>XmlSimplify</tt> functor (
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/xml/xml-simplify.sig?view=markup">xml-simplify.sig</a>
+,
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/xml/xml-simplify.fun?view=markup">xml-simplify.fun</a>
+).   <p>
+The following optimization passes are implemented: 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="XMLSimplifyTypes">XMLSimplifyTypes</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="XMLShrink">XMLShrink</a> 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+The optimization passes can be controlled from the command-line by the options 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <tt>diag-pass&nbsp;&lt;pass&gt;</tt> -- keep diagnostic info for pass 
+</p>
+</li>
+    <li>
+<p>
+ <tt>drop-pass&nbsp;&lt;pass&gt;</tt> -- omit optimization pass 
+</p>
+</li>
+    <li>
+<p>
+ <tt>keep-pass&nbsp;&lt;pass&gt;</tt> -- keep the results of pass 
+</p>
+</li>
+    <li>
+<p>
+ <tt>xml-passes&nbsp;&lt;passes&gt;</tt> -- xml optimization passes 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:22:55 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/XMLSimplifyTypes
===================================================================
--- mlton/trunk/doc/guide/XMLSimplifyTypes	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/XMLSimplifyTypes	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,78 @@
+<!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>XMLSimplifyTypes - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      XMLSimplifyTypes
+    <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">
+<p>
+An optimization pass for the <a href="XML">XML</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="XMLSimplify">XMLSimplify</a>. 
+</p>
+<h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Simplifies types in an <a href="XML">XML</a> program, eliminating all unused type arguments. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/xml/simplify-types.sig?view=markup">simplify-types.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/xml/simplify-types.fun?view=markup">simplify-types.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+<p>
+It first computes a simple fixpoint on all the <tt>datatype</tt> declarations to determine which <tt>datatype</tt> <tt>tycon</tt> args are actually used.  Then it does a single pass over the program to determine which polymorphic declaration type variables are used, and rewrites types to eliminate unused type arguments. 
+</p>
+<p>
+This pass should eliminate any spurious duplication that the <a href="Monomorphise">Monomorphise</a> pass might perform due to phantom types. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:22:37 by <span title="cfs32.cs.cornell.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/ZZZOrphanedPages
===================================================================
--- mlton/trunk/doc/guide/ZZZOrphanedPages	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/ZZZOrphanedPages	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,94 @@
+<!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>ZZZOrphanedPages - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      ZZZOrphanedPages
+    <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 contents of these pages have been moved to other pages. 
+    <ul>
+
+    <li>
+<p>
+ <a href="Papers">Papers</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="UserGuide">UserGuide</a> 
+</p>
+</li>
+
+    </ul>
+
+
+<p>
+These templates are used by other pages. 
+</p>
+
+    <ul>
+
+    <li>
+<p>
+ <a href="CompilerPassTemplate">CompilerPassTemplate</a> 
+</p>
+</li>
+    <li>
+<p>
+ <a href="TalkTemplate">TalkTemplate</a> 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2004-12-26 19:11:47 by <span title="adsl-10-6-82.mia.bellsouth.net"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/Zone
===================================================================
--- mlton/trunk/doc/guide/Zone	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/Zone	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,84 @@
+<!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>Zone - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Zone
+    <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">
+An optimization pass for the <a href="SSA2">SSA2</a> <a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="SSA2Simplify">SSA2Simplify</a>. <h2 id="head-55f8ebc805e65b5b71ddafdae390e3be2bcd69af">Description</h2>
+<p>
+Breaks large <a href="SSA2">SSA2</a> functions into zones, which are connected subgraphs of the dominator tree.  For each zone, at the node that dominates the zone (the "zone root"), it places a tuple collecting all of the live variables at that node.  It replaces any variables used in that zone with offsets from the tuple.  The goal is to decrease the liveness information in large <a href="SSA">SSA</a> functions. 
+</p>
+<h2 id="head-8781d615fd77be9578225c40ac67b9471394cced">Implementation</h2>
+
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/zone.sig?view=markup">zone.sig</a>
+ 
+<a href = "http://mlton.org/cgi-bin/viewsvn.cgi/mlton/trunk/mlton/ssa/zone.fun?view=markup">zone.fun</a>
+ <h2 id="head-35ec00231a68203708e39f0e2cc10b50c6bf62de">Details and Notes</h2>
+<p>
+Compute strongly-connected components to avoid put tuple constructions in loops. 
+</p>
+<p>
+There are two (expert) flags that govern the use of this pass 
+<pre>  -max-function-size &lt;n&gt;
+  -zone-cut-depth &lt;n&gt; 
+</pre> Zone splitting only works when the number of basic blocks in a function is &gt; <tt>n</tt>.  The <tt>n</tt> used to cut the dominator tree is set by <tt>-zone-cut-depth</tt>. 
+</p>
+<p>
+There is currently no attempt to be safe-for-space.  That is, the tuples are not restricted to containing only "small" values. 
+</p>
+<p>
+In the <tt>HOL</tt> program, the particular problem is the main function, which has 161,783 blocks and 257,519 variables -- the product of those two numbers being about 41 billion.  Now, we're not likely going to need that much space since we use a sparse representation.  But even 1/100th would really hurt.  And of course this rules out bit vectors. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-08-19 15:23:59 by <span title="net-79206.roam.fas.harvard.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/common.css
===================================================================
--- mlton/trunk/doc/guide/common.css	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/common.css	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,135 @@
+/*  common.css - MoinMoin Default Styles
+
+    Copyright (c) 2001, 2002, 2003 by Jürgen Hermann
+*/
+
+/* content styles */
+
+/* survey */
+input[type="checkbox"] {
+	vertical-align: middle;
+}
+input[type="radio"] {
+	vertical-align: 10%;
+}
+
+div.improvements table {
+	border-width: 0px;
+}
+
+div.improvements td {
+	border-width: 0px;
+	text-align: center;
+	width: 1.5em;
+}
+
+div.improvements td.improvement-description {
+	padding-left: 1em;
+	text-align: left;
+	width: 20em;
+}
+
+span.importance {
+	color: red;
+	font-size: 75%;
+	vertical-align: middle;
+}
+
+span.improvement-group {
+	font-weight: bold;
+}
+
+div.lines table {
+	border-width: 0px;
+}
+div.lines td {
+	border-width: 0px;
+	text-align: center;
+	width: 4em;
+}
+div.years table {
+	border-width: 0px;
+}
+div.years td {
+	border-width: 0px;
+	text-align: center;
+	width: 3em;
+}
+/* end survey */
+
+html {
+	background-color: white;
+	color: black;
+}
+
+h2 {
+	font-size: 130%;
+}
+
+h3 {
+	font-size: 1.3em;
+}
+
+h4, h5, h6 {
+	font-size: 1em;
+}
+
+li p {
+	margin: .2em 0;
+}
+
+li.gap {
+    margin-top: 8pt;
+}
+    
+a img {
+	border: 0;
+}
+
+img.drawing {
+	border: 0;
+}
+
+dt {
+	font-weight: bold;
+}
+
+pre {
+	padding: .5em;
+    white-space: pre-wrap;
+}
+
+#content {
+    /* style for content generated by wiki markup */
+}
+
+.footnotes ul {
+	padding: 0 2em;
+	margin: 0 0 1em;
+}
+
+.footnotes li {
+	list-style: none;
+}
+
+/* eye catchers */
+.warning 
+{
+    color: #000000;
+    background-color: #EDD097;
+    padding: 1pt;
+}
+
+.error 
+{
+    color: #FF0000;
+    background-color: #EDD097;
+    padding: 1pt;
+}
+
+strong.highlight 
+{
+    background-color: #FFAA00;
+    padding: 1pt;
+}
+

Added: mlton/trunk/doc/guide/index.html
===================================================================
--- mlton/trunk/doc/guide/index.html	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/index.html	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,106 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<meta name="robots" content="index,follow">
+
+
+
+<title>Home - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      Home
+    <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">
+<h2 id="head-0e2e052318497534ae5631e175d61d7203de1499">What is MLton?</h2>
+MLton is an open-source, whole-program, optimizing <a href="StandardML">Standard ML</a> compiler. <h2 id="head-11fc14203dd0f4441645a9c34d5dd022905f56e4">Next steps</h2>
+
+    <ul>
+
+    <li>
+<p>
+ Read about MLton's <a href="Features">Features</a>. 
+</p>
+</li>
+    <li>
+<p>
+ Look at <a href="Documentation">Documentation</a>. 
+</p>
+</li>
+    <li>
+<p>
+ See some <a href="Users">Users</a> of MLton. 
+</p>
+</li>
+    <li>
+<p>
+ <a href="http://mlton.org/Download">Download</a> MLton. 
+</p>
+</li>
+    <li>
+<p>
+ Meet the MLton <a href="Developers">Developers</a>. 
+</p>
+</li>
+    <li>
+<p>
+ Get involved with MLton <a href="Development">Development</a>. 
+</p>
+</li>
+    <li>
+<p>
+ User-maintained <a href="FAQ">FAQ</a>. 
+</p>
+</li>
+    <li>
+<p>
+ <a href="Contact">Contact</a> us. 
+</p>
+</li>
+</ul>
+
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-02-07 01:07:19 by <span title="adsl-64-166-224-38.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/mGTK
===================================================================
--- mlton/trunk/doc/guide/mGTK	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/mGTK	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,65 @@
+<!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>mGTK - 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">
+
+<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 20050905</a>
+    <td style = "
+		border: 0px;
+		font-size: 150%;
+		text-align: center;
+		width: 50%;">
+      mGTK
+    <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">
+<a class="external" href="http://mgtk.sourceforge.net/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">mGTK</a> is a wrapper for <a class="external" href="http://www.gtk.org/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">GTK+</a>, a GUI toolkit. <p>
+At the <a class="external" href="http://mgtk.sourceforge.net/"><img src="moin-www.png" alt="[WWW]" height="11" width="11">mGTK site</a>, they say that MLton support is "almost ready", however there is a version (0.93) that works with MLton 20041109.  mGTK 0.93 is not listed on the site, but is available at the <a class="external" href="http://sourceforge.net/project/showfiles.php?group_id=23226&amp;package_id=16523"><img src="moin-www.png" alt="[WWW]" height="11" width="11">file release page</a>. To test it, after unpacking, do <tt>cd&nbsp;examples;&nbsp;make&nbsp;mlton</tt>, after which you should be able to run the many examples (<tt>signup-mlton</tt>, <tt>listview-mlton</tt>, ...). 
+</p>
+<p>
+There is an older verision (0.92) of mGTK that works with MLton 20040227. 
+</p>
+</div>
+
+
+
+<p>
+<hr>
+Last edited on 2005-01-13 17:57:57 by <span title="p253.n-dapop04.stsn.com"><a href="StephenWeeks">StephenWeeks</a></span>.
+</body></html>

Added: mlton/trunk/doc/guide/moin-bottom.png
===================================================================
(Binary files differ)


Property changes on: mlton/trunk/doc/guide/moin-bottom.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: mlton/trunk/doc/guide/moin-email.png
===================================================================
(Binary files differ)


Property changes on: mlton/trunk/doc/guide/moin-email.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: mlton/trunk/doc/guide/moin-ftp.png
===================================================================
(Binary files differ)


Property changes on: mlton/trunk/doc/guide/moin-ftp.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: mlton/trunk/doc/guide/moin-top.png
===================================================================
(Binary files differ)


Property changes on: mlton/trunk/doc/guide/moin-top.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: mlton/trunk/doc/guide/moin-www.png
===================================================================
(Binary files differ)


Property changes on: mlton/trunk/doc/guide/moin-www.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: mlton/trunk/doc/guide/print.css
===================================================================
--- mlton/trunk/doc/guide/print.css	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/print.css	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,109 @@
+/*  print.css - MoinMoin Default Styles
+
+    Copyright (c) 2001, 2002, 2003 by Jürgen Hermann
+*/
+
+/* content styles */
+
+h2, h3, h4, h5, h6 {
+	border-bottom: solid 1pt black;
+}
+
+a {
+	background-color: inherit;
+	color: inherit;
+}
+
+pre {
+	border: 1pt solid black;
+	background-color: inherit
+	color: black;
+}
+
+hr {
+	clear: both;
+	border-style: none;
+	background-color: black;
+	color: black;
+	height: 1pt;
+}
+
+td {
+	border: 1pt solid gray;
+}
+
+a.interwiki:before, a.badinterwiki:before {
+	content: attr(title) ":";
+}
+
+a.interwiki img, a.badinterwiki img {
+	display: none;
+}
+
+.footnotes div {
+	width: 5em;
+	border-top: 1pt solid black;
+}
+
+/* user interface styles */
+
+h1 {
+	padding: .2em 1em;
+}
+
+#logo {
+	float: left;
+	margin: 0 .5em;
+}
+
+*[dir="rtl"] #logo {
+	float: right;
+}
+
+#title a {
+	text-decoration: none;
+}
+
+#username, #navibar, #pagetrail, #iconbar, #message, #footer, #timings {
+	display: none;
+}
+
+table.recentchanges {
+	width: 100%;
+}
+
+.recentchanges td {
+	padding: 0 .3em;
+}
+
+.rcdaybreak td {
+	background-color: #CCCCFF;
+	padding: .2em;
+}
+
+.rcicon1, .rcicon2 {
+	text-align: center;
+}
+
+.rcpagelink {
+	width: 33%;
+}
+
+.rctime {
+	font-size: .9em;
+	color: #4D4D4D;
+}
+
+.rceditor {
+	color: green;
+}
+
+.rccomment {
+	color: red;
+	width: 66%;
+}
+
+.rcrss {
+	float: right;
+}
+

Added: mlton/trunk/doc/guide/screen.css
===================================================================
--- mlton/trunk/doc/guide/screen.css	2005-09-06 04:17:48 UTC (rev 4069)
+++ mlton/trunk/doc/guide/screen.css	2005-09-06 04:18:56 UTC (rev 4070)
@@ -0,0 +1,286 @@
+/*  screen.css - MoinMoin Default Styles
+
+    Copyright (c) 2001, 2002, 2003 by Jürgen Hermann
+*/
+
+/* content styles */
+
+a.mltona:link {
+	color: darkblue;
+	text-decoration: none;
+}
+
+a.mltona:visited {
+	color: darkblue;
+	text-decoration: none;
+}
+
+a.entaina:link {
+	color: #888888;
+	text-decoration: none;
+}
+
+a.entaina:visited {
+	color: #888888;
+	text-decoration: none;
+}
+
+a.sweeksa:link {
+	color: darkblue;
+	text-decoration: none;
+}
+
+a.sweeksa:visited {
+	color: darkblue;
+	text-decoration: none;
+}
+
+a.nonexistent, a.badinterwiki {
+	background-color: inherit;
+	color: #404040;
+}
+
+pre {
+	border: 1px solid #CBCBCB;
+	background-color: #FFF8ED;
+	color: black;
+}
+
+hr {
+	clear: both;
+	border-style: none;
+	background-color: #CBCBCB;
+	color: #CBCBCB;
+}
+
+table {
+	border: 2px;
+	border-spacing: 0px;
+	border-style: ridge;
+}
+
+table.title {
+	background-color: lightblue;
+	width: 100%;
+}
+
+td {
+	border: 1px;
+	border-style: ridge;
+	padding: 5px;
+}
+
+.footnotes div {
+	width: 5em;
+	border-top: 1px solid #CBCBCB;
+}
+
+/* user interface styles */
+
+h1 {
+	padding: .2em 1em;
+}
+
+#logo {
+	float: left;
+	margin: 0 .5em;
+}
+
+*[dir="rtl"] #logo {
+	float: right;
+}
+
+#username {
+	float: right;
+	margin: 1em .3em;
+	text-align: right;
+}
+
+*[dir="rtl"] #username {
+	float: left;
+}
+
+#navibar {
+	clear: left;
+}
+
+*[dir="rtl"] #navibar {
+	clear: right;
+}
+
+#pagetrail {
+	clear: left;
+}
+
+*[dir="rtl"] #pagetrail {
+	clear: right;
+}
+
+#navibar, #pagetrail, #iconbar {
+	margin: .5em 0;
+	padding: 0;
+}
+
+#navibar a, #pagetrail a {
+	text-decoration: none;
+}
+
+#navibar li, #pagetrail li, #iconbar li {
+	display: inline;
+	padding: 0 2px;
+	margin: 0;
+}
+
+#navibar li {
+	border: 3px solid #CBCBCB;
+	background-color: #E5E5E5;
+	color: black;
+	line-height: 2em;
+}
+
+#pagetrail li span {
+	border: 1px solid #EEEECC;
+	background-color: #FFFFDD;
+	color: black;
+}
+
+#pagetrail li:before {
+	content: "» ";
+}
+
+*[dir="rtl"] #pagetrail li:before {
+	content: " «";
+}
+
+#pagetrail li:first-child:before {
+	content: "";
+}
+
+#iconbar {
+	clear: both;
+	float: right;
+	text-align: right;
+	width: 30%;
+	white-space: nowrap;
+}
+
+*[dir="rtl"] #iconbar {
+	float: left;
+	text-align: left;
+}
+
+#message, #footer {
+	clear: both;
+	border: 1px solid #CBCBCB;
+	background-color: #E5E5E5;
+	color: black;
+	margin: .5em 0;
+	padding: .5em;
+}
+
+#footer p, #footer form {
+	margin: 0;
+}
+
+#credits {
+	float: right;
+	text-align: right;
+	max-width: 30%;
+}
+
+*[dir="rtl"] #credits {
+	float: left;
+	text-align: left;
+}
+
+#timings {
+	padding: 0;
+	font-size: 0.8em;
+}
+
+#timings li {
+	display: inline;
+	background-color: #E5E5E5;
+	color: black;
+}
+
+#preview {
+	border: 2px solid #CBCBCB;
+	padding: .5em;
+	background: url(../img/draft.png);
+}
+
+/* 
+.recentchanges table {
+	width: 100%;
+}
+*/
+
+#pageinfo td, .recentchanges td {
+	padding: 0 .3em;
+}
+
+.rcdaybreak td {
+	background-color: #CCCCFF;
+	padding: .2em;
+}
+
+.rcicon1, .rcicon2 {
+	text-align: center;
+}
+
+.rcpagelink {
+	width: 33%;
+}
+
+.rctime {
+	font-size: .9em;
+	color: #4D4D4D;
+}
+
+.rceditor {
+	color: green;
+}
+
+.rccomment {
+	color: red;
+	width: 66%;
+}
+
+.rcrss {
+	float: right;
+}
+
+.recentchanges[dir="rtl"] .rcrss {
+	float: left;
+}
+
+.diff {
+        width:99%;
+}
+    
+.diff-title {
+	background-color: #C0C0C0;
+}
+
+.diff-added {
+	background-color: #E0FFE0;
+	vertical-align: sub;
+}
+
+.diff-removed {
+	background-color: #FFFFE0;
+	vertical-align: sub;
+}
+
+.diff-added span {
+	background-color: #80FF80;
+}
+
+.diff-removed span {
+	background-color: #FFFF80;
+}
+
+.searchresult dd span {
+	font-weight: bold;
+}