[MLton-commit] r5803

Vesa Karvonen vesak at mlton.org
Sat Jul 28 15:53:00 PDT 2007


Documentation.
----------------------------------------------------------------------

U   mltonlib/trunk/com/ssh/extended-basis/unstable/public/data/univ.sig

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

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/data/univ.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/data/univ.sig	2007-07-28 08:40:17 UTC (rev 5802)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/data/univ.sig	2007-07-28 22:52:59 UTC (rev 5803)
@@ -5,8 +5,20 @@
  *)
 
 (**
- * Signature for a basic universal type.
+ * Signature for a basic, non-structural, universal type.
  *
+ * It is important to understand that the universal type is not
+ * structural.  Consider the following code:
+ *
+ *> val a : (Int.t, Univ.t) Emb.t = Univ.newEmb ()
+ *> val b : (Int.t, Univ.t) Emb.t = Univ.newEmb ()
+ *
+ *> val x : Univ.t = Emb.to a 5
+ *
+ * Now {Emb.from a x} is {SOME 5}, but {Emb.from b x} is {NONE}.  The
+ * embeddings {a} and {b} have different identity.  Each time {newEmb} or
+ * {newIso} is called, a new identity is created.
+ *
  * See also: [http://mlton.org/UniversalType]
  *)
 signature UNIV = sig




More information about the MLton-commit mailing list