[MLton-commit] r5611

Vesa Karvonen vesak at mlton.org
Sun Jun 10 06:05:07 PDT 2007


Tuned comments.
----------------------------------------------------------------------

U   mltonlib/trunk/com/ssh/generic/unstable/detail/value/type-info.sml
U   mltonlib/trunk/com/ssh/generic/unstable/public/closed-generic-rep.sig
U   mltonlib/trunk/com/ssh/generic/unstable/public/closed-generic.sig
U   mltonlib/trunk/com/ssh/generic/unstable/public/export.sml
U   mltonlib/trunk/com/ssh/generic/unstable/public/generic-extra.sig
U   mltonlib/trunk/com/ssh/generic/unstable/public/generic.sig
U   mltonlib/trunk/com/ssh/generic/unstable/public/generics-util.sig
U   mltonlib/trunk/com/ssh/generic/unstable/public/join-generics-fun.sig
U   mltonlib/trunk/com/ssh/generic/unstable/public/open-generic-rep.sig
U   mltonlib/trunk/com/ssh/generic/unstable/public/open-generic.sig
U   mltonlib/trunk/com/ssh/generic/unstable/public/value/arbitrary.sig
U   mltonlib/trunk/com/ssh/generic/unstable/public/value/dummy.sig
U   mltonlib/trunk/com/ssh/generic/unstable/public/value/eq.sig
U   mltonlib/trunk/com/ssh/generic/unstable/public/value/ord.sig
U   mltonlib/trunk/com/ssh/generic/unstable/public/value/show.sig
U   mltonlib/trunk/com/ssh/generic/unstable/public/value/type-info.sig

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

Modified: mltonlib/trunk/com/ssh/generic/unstable/detail/value/type-info.sml
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/detail/value/type-info.sml	2007-06-10 12:39:40 UTC (rev 5610)
+++ mltonlib/trunk/com/ssh/generic/unstable/detail/value/type-info.sml	2007-06-10 13:05:06 UTC (rev 5611)
@@ -20,7 +20,7 @@
    infixr 0 -->
    (* SML/NJ workaround --> *)
 
-   (* XXX separate datatype for sums, products, and whole indices *)
+   (* XXX separate datatype for sums, products, and whole representations *)
 
    datatype u =
       IN of {alts : Int.t,

Modified: mltonlib/trunk/com/ssh/generic/unstable/public/closed-generic-rep.sig
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/public/closed-generic-rep.sig	2007-06-10 12:39:40 UTC (rev 5610)
+++ mltonlib/trunk/com/ssh/generic/unstable/public/closed-generic-rep.sig	2007-06-10 13:05:06 UTC (rev 5611)
@@ -5,15 +5,15 @@
  *)
 
 (**
- * Signature for the types of type-indices of generic functions.
+ * Signature for the closed representation types of generic values.
  *)
 signature CLOSED_GENERIC_REP = sig
    type 'a t
-   (** Type of complete type-indices. *)
+   (** Type of complete representations. *)
 
    type 'a s
-   (** Type of incomplete sum type-indices. *)
+   (** Type of incomplete sum representations. *)
 
    type ('a, 'k) p
-   (** Type of incomplete product type-indices. *)
+   (** Type of incomplete product representations. *)
 end

Modified: mltonlib/trunk/com/ssh/generic/unstable/public/closed-generic.sig
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/public/closed-generic.sig	2007-06-10 12:39:40 UTC (rev 5610)
+++ mltonlib/trunk/com/ssh/generic/unstable/public/closed-generic.sig	2007-06-10 13:05:06 UTC (rev 5611)
@@ -5,41 +5,40 @@
  *)
 
 (**
- * A signature for type-indexed values based on a generic representation
- * of datatypes.
+ * Signature for closed generic values.
  *)
 signature CLOSED_GENERIC = sig
    structure Rep : CLOSED_GENERIC_REP
 
-   (** == SUPPORT FOR USER-DEFINED TYPES == *)
+   (** == Support for User-Defined Types == *)
 
    val iso : 'b Rep.t -> ('a, 'b) Iso.t -> 'a Rep.t
    (**
-    * Given a type-index {'b Rep.t} and an isomorphism between {'a} and
-    * {'b}, returns a type-index {'a Rep.t}.  The purpose of {iso} is to
-    * support user-defined types.
+    * Given a representation {'b Rep.t} and an isomorphism between {'a}
+    * and {'b}, returns a representation {'a Rep.t}.  The purpose of {iso}
+    * is to support user-defined types.
     *)
 
    val isoProduct : ('b, 'k) Rep.p -> ('a, 'b) Iso.t -> ('a, 'k) Rep.p
    (**
-    * Given a type-index {('b, 'k) Rep.p} and an isomorphism between
-    * {'a} and {'b}, returns a type-index {('a, 'k) Rep.p}.
+    * Given a representation {('b, 'k) Rep.p} and an isomorphism between
+    * {'a} and {'b}, returns a representation {('a, 'k) Rep.p}.
     *)
 
    val isoSum : 'b Rep.s -> ('a, 'b) Iso.t -> 'a Rep.s
    (**
-    * Given a type-index {'b Rep.s} and an isomorphism between {'a} and
-    * {'b}, returns a type-index {'a Rep.s}.
+    * Given a representation {'b Rep.s} and an isomorphism between {'a}
+    * and {'b}, returns a representation {'a Rep.s}.
     *)
 
-   (** == SUPPORT FOR TUPLES AND RECORDS == *)
+   (** == Support for Tuples and Records == *)
 
    val *` :
        ('a, 'k) Rep.p * ('b, 'k) Rep.p -> (('a, 'b) Product.t, 'k) Rep.p
    (**
-    * Given type-indices for fields of type {'a} and {'b} of the same kind
-    * {'k} (tuple or record), returns a type-index for the product {('a,
-    * 'b) Product.t}.
+    * Given representations for fields of type {'a} and {'b} of the same
+    * kind {'k} (tuple or record), returns a representation for the
+    * product {('a, 'b) Product.t}.
     *)
 
    val T : 'a Rep.t -> ('a, Generics.Tuple.t) Rep.p
@@ -54,12 +53,12 @@
    val record : ('a, Generics.Record.t) Rep.p -> 'a Rep.t
    (** Specifies a record. *)
 
-   (** == SUPPORT FOR DATATYPES == *)
+   (** == Support for Datatypes == *)
 
    val +` : 'a Rep.s * 'b Rep.s -> (('a, 'b) Sum.t) Rep.s
    (**
-    * Given type-indices for variants of type {'a} and {'b}, returns a
-    * type-index for the sum {('a, 'b) Sum.t}.
+    * Given representations for variants of type {'a} and {'b}, returns a
+    * representation for the sum {('a, 'b) Sum.t}.
     *)
 
    val C0 : Generics.Con.t -> Unit.t Rep.s
@@ -73,52 +72,52 @@
 
    val unit : Unit.t Rep.t
    (**
-    * Type-index for the {unit} type.  Using {unit} and {+} one can
+    * Representation for the {unit} type.  Using {unit} and {+} one can
     * actually encode {bool}, {word}, and much more.
     *)
 
    val Y : 'a Rep.t Tie.t
-   (** Fixpoint tier to support recursive datatypes. *)
+   (** Fixed-point tier to support recursive datatypes. *)
 
-   (** == SUPPORT FOR FUNCTIONS == *)
+   (** == Support for Functions == *)
 
    val --> : 'a Rep.t * 'b Rep.t -> ('a -> 'b) Rep.t
 
-   (** == SUPPORT FOR EXCEPTIONS == *)
+   (** == Support for Exceptions == *)
 
    val exn : Exn.t Rep.t
-   (** Universal type-index for exceptions. *)
+   (** Universal representation for exceptions. *)
 
    val regExn : 'a Rep.s -> ('a, Exn.t) Emb.t Effect.t
    (** Registers a handler for exceptions. *)
 
-   (** == SUPPORT FOR TYPES WITH IDENTITY == *)
+   (** == Support for Types With Identity == *)
 
    val array : 'a Rep.t -> 'a Array.t Rep.t
    val refc : 'a Rep.t -> 'a Ref.t Rep.t
 
-   (** == SUPPORT FOR FUNCTIONAL AGGREGATE TYPES == *)
+   (** == Support for Functional Aggregate Types == *)
 
    val vector : 'a Rep.t -> 'a Vector.t Rep.t
 
-   (** == SUPPORT FOR ARBITRARY INTEGERS, WORDS, AND REALS == *)
+   (** == Support for Arbitrary Integers, Words, And Reals == *)
 
    val largeInt  : LargeInt.t  Rep.t
    val largeReal : LargeReal.t Rep.t
    val largeWord : LargeWord.t Rep.t
 
-   (** == SUPPORT FOR BINARY DATA == *)
+   (** == Support for Binary Data == *)
 
    val word8  : Word8.t  Rep.t
 (* val word16 : Word16.t Rep.t (* Word16 not provided by SML/NJ *) *)
    val word32 : Word32.t Rep.t
    val word64 : Word64.t Rep.t
 
-   (** == SUPPORT FOR SOME BUILT-IN TYPE CONSTRUCTORS == *)
+   (** == Support for Some Built-In Type Constructors == *)
 
    val list : 'a Rep.t -> 'a List.t Rep.t
 
-   (** == SUPPORT FOR SOME BUILT-IN BASE TYPES == *)
+   (** == Support for Some Built-In Base Types == *)
 
    val bool   : Bool.t   Rep.t
    val char   : Char.t   Rep.t

Modified: mltonlib/trunk/com/ssh/generic/unstable/public/export.sml
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/public/export.sml	2007-06-10 12:39:40 UTC (rev 5610)
+++ mltonlib/trunk/com/ssh/generic/unstable/public/export.sml	2007-06-10 13:05:06 UTC (rev 5611)
@@ -76,17 +76,17 @@
                  ('a, 'b, ('a, 'b, 'c) Arg.Inner.Rep.p) Arg.Outer.Rep.p =
    JoinGenerics (Arg)
 (**
- * Joins two extensible generic functions.  As can be read from the where
- * -constraints, the type-indices of the joined generic are compatible
- * with the type-indices of the {Outer} generic.
+ * Joins two open generic functions.  As can be read from the constraints,
+ * the representation of the joined generic is compatible with the
+ * representation of the {Outer} generic.
  *)
 
 functor WithExtra (Arg : GENERIC) : GENERIC_EXTRA = WithExtra (Arg)
 (**
- * Implements a number of frequently used type-indices for convenience.
- * As a side-effect, this functor also registers handlers for most
- * standard exceptions.  The exact set of extra type-indices is likely to
- * grow over time.
+ * Implements a number of frequently used type representations for
+ * convenience.  As a side-effect, this functor also registers handlers
+ * for most standard exceptions.  The exact set of extra representations
+ * is likely to grow over time.
  *)
 
 (** === Value Functors === *)

Modified: mltonlib/trunk/com/ssh/generic/unstable/public/generic-extra.sig
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/public/generic-extra.sig	2007-06-10 12:39:40 UTC (rev 5610)
+++ mltonlib/trunk/com/ssh/generic/unstable/public/generic-extra.sig	2007-06-10 13:05:06 UTC (rev 5611)
@@ -4,12 +4,15 @@
  * See the LICENSE file or http://mlton.org/License for details.
  *)
 
+(**
+ * Signature for frequently used derived type representations.
+ *)
 signature GENERIC_EXTRA = sig
    include GENERICS GENERIC
 
    (** == Shorthands for Types with Labels or Constructors ==
     *
-    * These should only be used for defining monomorphic type-indices.
+    * These should only be used for defining monomorphic representations.
     *)
 
    val C0' : String.t -> Unit.t Rep.s

Modified: mltonlib/trunk/com/ssh/generic/unstable/public/generic.sig
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/public/generic.sig	2007-06-10 12:39:40 UTC (rev 5610)
+++ mltonlib/trunk/com/ssh/generic/unstable/public/generic.sig	2007-06-10 13:05:06 UTC (rev 5611)
@@ -4,6 +4,9 @@
  * See the LICENSE file or http://mlton.org/License for details.
  *)
 
+(**
+ * Base signature for a module of directly usable generics.
+ *)
 signature GENERIC = sig
    structure Open : OPEN_GENERIC
 

Modified: mltonlib/trunk/com/ssh/generic/unstable/public/generics-util.sig
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/public/generics-util.sig	2007-06-10 12:39:40 UTC (rev 5610)
+++ mltonlib/trunk/com/ssh/generic/unstable/public/generics-util.sig	2007-06-10 13:05:06 UTC (rev 5611)
@@ -5,7 +5,7 @@
  *)
 
 (**
- * Utilities for defining generic functions.
+ * Signature for utilities for defining generic values.
  *)
 signature GENERICS_UTIL = sig
    val failExn : Exn.t -> 'a

Modified: mltonlib/trunk/com/ssh/generic/unstable/public/join-generics-fun.sig
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/public/join-generics-fun.sig	2007-06-10 12:39:40 UTC (rev 5610)
+++ mltonlib/trunk/com/ssh/generic/unstable/public/join-generics-fun.sig	2007-06-10 13:05:06 UTC (rev 5611)
@@ -4,6 +4,9 @@
  * See the LICENSE file or http://mlton.org/License for details.
  *)
 
+(**
+ * Signature for the domain of the {JoinGenerics} functor.
+ *)
 signature JOIN_GENERICS_DOM = sig
    structure Outer : OPEN_GENERIC
    structure Inner : OPEN_GENERIC

Modified: mltonlib/trunk/com/ssh/generic/unstable/public/open-generic-rep.sig
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/public/open-generic-rep.sig	2007-06-10 12:39:40 UTC (rev 5610)
+++ mltonlib/trunk/com/ssh/generic/unstable/public/open-generic-rep.sig	2007-06-10 13:05:06 UTC (rev 5611)
@@ -4,15 +4,21 @@
  * See the LICENSE file or http://mlton.org/License for details.
  *)
 
+(**
+ * Signature for the open representation types of generic values.
+ *)
 signature OPEN_GENERIC_REP = sig
+   (** == Complete Representations == *)
    type ('a, 'x) t
    val getT : ('a, 'x) t -> 'x
    val mapT : 'x UnOp.t -> ('a, 'x) t UnOp.t
 
+   (** == Incomplete Sum Representations == *)
    type ('a, 'x) s
    val getS : ('a, 'x) s -> 'x
    val mapS : 'x UnOp.t -> ('a, 'x) s UnOp.t
 
+   (** == Incomplete Product Representations == *)
    type ('a, 'k, 'x) p
    val getP : ('a, 'k, 'x) p -> 'x
    val mapP : 'x UnOp.t -> ('a, 'k, 'x) p UnOp.t

Modified: mltonlib/trunk/com/ssh/generic/unstable/public/open-generic.sig
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/public/open-generic.sig	2007-06-10 12:39:40 UTC (rev 5610)
+++ mltonlib/trunk/com/ssh/generic/unstable/public/open-generic.sig	2007-06-10 13:05:06 UTC (rev 5611)
@@ -4,6 +4,11 @@
  * See the LICENSE file or http://mlton.org/License for details.
  *)
 
+(**
+ * Signature for open generic values.  This is basically derived from the
+ * {CLOSED_GENERIC} signature by parameterizing the representation to
+ * allow building extended representations.
+ *)
 signature OPEN_GENERIC = sig
    structure Rep : OPEN_GENERIC_REP
    val iso : ('y -> ('a, 'b) Iso.t -> 'x) -> ('b, 'y) Rep.t -> ('a, 'b) Iso.t -> ('a, 'x) Rep.t

Modified: mltonlib/trunk/com/ssh/generic/unstable/public/value/arbitrary.sig
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/public/value/arbitrary.sig	2007-06-10 12:39:40 UTC (rev 5610)
+++ mltonlib/trunk/com/ssh/generic/unstable/public/value/arbitrary.sig	2007-06-10 13:05:06 UTC (rev 5611)
@@ -5,8 +5,8 @@
  *)
 
 (**
- * Signature for a type-indexed function for generating random values of
- * any type.  The design is inspired by the
+ * Signature for a generic function for generating random values of any
+ * type.  The design is inspired by the
  * [http://www.cs.chalmers.se/~rjmh/QuickCheck/ QuickCheck] library by
  * Koen Claessen and John Hughes.
  *)

Modified: mltonlib/trunk/com/ssh/generic/unstable/public/value/dummy.sig
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/public/value/dummy.sig	2007-06-10 12:39:40 UTC (rev 5610)
+++ mltonlib/trunk/com/ssh/generic/unstable/public/value/dummy.sig	2007-06-10 13:05:06 UTC (rev 5611)
@@ -5,13 +5,12 @@
  *)
 
 (**
- * A signature for a type-indexed family of dummy values.  In SML, dummy
- * values are needed for things such as computing fixpoints and building
- * cyclic values.
+ * A signature for a generic dummy value.  In SML, dummy values are needed
+ * for things such as computing fixpoints and building cyclic values.
  *
- * This type-indexed function is unlikely to be directly useful in
- * application programs and is more likely to be used internally in the
- * implementation of some other type-indexed functions (e.g. pickling).
+ * This generic value is unlikely to be directly useful in application
+ * programs and is more likely to be used internally in the implementation
+ * of some other generic values (e.g. pickling).
  *)
 signature DUMMY = sig
    structure Dummy : OPEN_GENERIC_REP
@@ -28,8 +27,8 @@
 
    val noDummy : ('a, 'x) Dummy.t UnOp.t
    (**
-    * Removes the dummy value from the given type-index.  This can be used
-    * for encoding abstract types that can not be given dummy values.
+    * Removes the dummy value from the given representation.  This can be
+    * used for encoding abstract types that can not be given dummy values.
     *)
 end
 

Modified: mltonlib/trunk/com/ssh/generic/unstable/public/value/eq.sig
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/public/value/eq.sig	2007-06-10 12:39:40 UTC (rev 5610)
+++ mltonlib/trunk/com/ssh/generic/unstable/public/value/eq.sig	2007-06-10 13:05:06 UTC (rev 5611)
@@ -5,7 +5,7 @@
  *)
 
 (**
- * Signature for a type-indexed equality relation.  For equality types the
+ * Signature for a generic equality relation.  For equality types the
  * semantics is the same as SML's built-in equality.  User defined types,
  * exceptions, and reals are given a natural, structural, semantics of
  * equality.  Functions, obviously, can't be supported.

Modified: mltonlib/trunk/com/ssh/generic/unstable/public/value/ord.sig
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/public/value/ord.sig	2007-06-10 12:39:40 UTC (rev 5610)
+++ mltonlib/trunk/com/ssh/generic/unstable/public/value/ord.sig	2007-06-10 13:05:06 UTC (rev 5611)
@@ -5,9 +5,9 @@
  *)
 
 (**
- * Signature for a type-indexed family of compare functions.  The idea is
- * that the compare functions just implement some arbitrary logical
- * ordering that you need for things such as search trees.
+ * Signature for a generic compare function.  The idea is that the compare
+ * functions just implement some arbitrary logical ordering that you need
+ * for things such as search trees.
  *
  * Note that comparison of functions is impossible and fails at run-time.
  * Comparison of exceptions only works when both exception constructors

Modified: mltonlib/trunk/com/ssh/generic/unstable/public/value/show.sig
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/public/value/show.sig	2007-06-10 12:39:40 UTC (rev 5610)
+++ mltonlib/trunk/com/ssh/generic/unstable/public/value/show.sig	2007-06-10 13:05:06 UTC (rev 5611)
@@ -5,7 +5,7 @@
  *)
 
 (**
- * Signature for a type-indexed function for pretty printing values of
+ * Signature for a generic function for pretty printing values of
  * arbitrary SML datatypes.  See [http://mlton.org/TypeRepedValues]
  * for further discussion.
  *)

Modified: mltonlib/trunk/com/ssh/generic/unstable/public/value/type-info.sig
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/public/value/type-info.sig	2007-06-10 12:39:40 UTC (rev 5610)
+++ mltonlib/trunk/com/ssh/generic/unstable/public/value/type-info.sig	2007-06-10 13:05:06 UTC (rev 5611)
@@ -5,7 +5,7 @@
  *)
 
 (**
- * Signature for a type-indexed family of type properties.
+ * Signature for generic type properties.
  *
  * These type properties can be useful for both optimizations and for
  * ensuring correctness.  As an optimization one could, for example,
@@ -14,9 +14,9 @@
  * infinite data structures or avoid performing non-terminating operations
  * on infinite data structures.
  *
- * This type-indexed function is unlikely to be directly useful in
- * application programs and is more likely to be used internally in the
- * implementation of some other type-indexed functions (e.g. pickling).
+ * This generic value is unlikely to be directly useful in application
+ * programs and is more likely to be used internally in the implementation
+ * of some other generic values (e.g. pickling).
  *)
 signature TYPE_INFO = sig
    structure TypeInfo : OPEN_GENERIC_REP




More information about the MLton-commit mailing list