[MLton-commit] r5988

Vesa Karvonen vesak at mlton.org
Sat Sep 1 16:19:23 PDT 2007


Using include for brevity.
----------------------------------------------------------------------

U   mltonlib/trunk/com/ssh/generic/unstable/test/utils.sml

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

Modified: mltonlib/trunk/com/ssh/generic/unstable/test/utils.sml
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/test/utils.sml	2007-09-01 18:04:53 UTC (rev 5987)
+++ mltonlib/trunk/com/ssh/generic/unstable/test/utils.sml	2007-09-01 23:19:22 UTC (rev 5988)
@@ -28,24 +28,23 @@
 local structure ? = RegBasisExns (Generic) open ? in end
 
 (* A simplistic graph for testing with cyclic data. *)
-functor MkGraph (Generic : GENERIC_EXTRA) :> sig
+functor MkGraph (include GENERIC_EXTRA) :> sig
    type 'a t
-   val t : 'a Generic.Rep.t -> 'a t Generic.Rep.t
+   val t : 'a Rep.t -> 'a t Rep.t
    val intGraph1 : Int.t t
 end = struct
    datatype 'a v = VTX of 'a * 'a t
    withtype 'a t = 'a v List.t Ref.t
 
    local
-      open Tie Generic
-      val vtx = C "VTX"
+      val cVTX = C "VTX"
       fun withT aV = refc (list aV)
    in
       fun v a =
-          fix Y
-              (fn aV =>
-                  iso (data (C1 vtx (tuple2 (a, withT aV))))
-                      (fn VTX ? => ?, VTX))
+          (Tie.fix Y)
+             (fn aV =>
+                 iso (data (C1 cVTX (tuple2 (a, withT aV))))
+                     (fn VTX ? => ?, VTX))
       fun t a = withT (v a)
    end
 
@@ -70,12 +69,10 @@
 end
 
 (* A contrived recursive exception constructor for testing with cyclic data. *)
-functor MkExnArray (Generic : GENERIC_EXTRA) :> sig
+functor MkExnArray (include GENERIC_EXTRA) :> sig
    exception ExnArray of Exn.t Array.t
    val exnArray1 : Exn.t Array.t
 end = struct
-   open Generic
-
    exception ExnArray of Exn.t Array.t
    val () = regExn1' "ExnArray" (array exn) ExnArray (fn ExnArray ? => ?)
 
@@ -84,20 +81,19 @@
 end
 
 (* A simple binary tree. *)
-functor MkBinTree (Generic : GENERIC_EXTRA) :> sig
+functor MkBinTree (include GENERIC_EXTRA) :> sig
    datatype 'a t = LF | BR of 'a t * 'a * 'a t
-   val t : 'a Generic.Rep.t -> 'a t Generic.Rep.t
+   val t : 'a Rep.t -> 'a t Rep.t
 end = struct
    datatype 'a t = LF | BR of 'a t * 'a * 'a t
    local
-      open Generic
-      val lf = C "LF"
-      val br = C "BR"
+      val cLF = C "LF"
+      val cBR = C "BR"
    in
       fun t a =
           (Tie.fix Y)
              (fn aT =>
-                 iso (data (C0 lf +` C1 br (tuple3 (aT, a, aT))))
+                 iso (data (C0 cLF +` C1 cBR (tuple3 (aT, a, aT))))
                      (fn LF => INL () | BR ? => INR ?,
                       fn INL () => LF | INR ? => BR ?))
    end




More information about the MLton-commit mailing list