[MLton-commit] r6071
Vesa Karvonen
vesak at mlton.org
Mon Oct 15 10:24:05 PDT 2007
Implemented a linear complexity (with respect to source code size) scheme
for combining generics.
----------------------------------------------------------------------
A mltonlib/trunk/com/ssh/generic/unstable/Generate-combination.sh
U mltonlib/trunk/com/ssh/generic/unstable/detail/generic.sml
U mltonlib/trunk/com/ssh/generic/unstable/test/generic.sml
U mltonlib/trunk/com/ssh/generic/unstable/test.mlb
U mltonlib/trunk/com/ssh/generic/unstable/with/arbitrary.sml
U mltonlib/trunk/com/ssh/generic/unstable/with/data-rec-info.sml
U mltonlib/trunk/com/ssh/generic/unstable/with/dynamic.sml
U mltonlib/trunk/com/ssh/generic/unstable/with/eq.sml
U mltonlib/trunk/com/ssh/generic/unstable/with/generic.sml
U mltonlib/trunk/com/ssh/generic/unstable/with/hash.sml
U mltonlib/trunk/com/ssh/generic/unstable/with/ord.sml
U mltonlib/trunk/com/ssh/generic/unstable/with/pickle.sml
U mltonlib/trunk/com/ssh/generic/unstable/with/pretty.sml
U mltonlib/trunk/com/ssh/generic/unstable/with/reduce.sml
U mltonlib/trunk/com/ssh/generic/unstable/with/seq.sml
U mltonlib/trunk/com/ssh/generic/unstable/with/shrink.sml
U mltonlib/trunk/com/ssh/generic/unstable/with/size.sml
U mltonlib/trunk/com/ssh/generic/unstable/with/some.sml
U mltonlib/trunk/com/ssh/generic/unstable/with/transform.sml
U mltonlib/trunk/com/ssh/generic/unstable/with/type-exp.sml
U mltonlib/trunk/com/ssh/generic/unstable/with/type-hash.sml
U mltonlib/trunk/com/ssh/generic/unstable/with/type-info.sml
U mltonlib/trunk/com/ssh/unit-test/unstable/detail/generic.sml
U mltonlib/trunk/com/ssh/unit-test/unstable/detail/unit-test.sml
U mltonlib/trunk/com/ssh/unit-test/unstable/lib-with-default.mlb
----------------------------------------------------------------------
Added: mltonlib/trunk/com/ssh/generic/unstable/Generate-combination.sh
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/Generate-combination.sh 2007-10-15 15:12:31 UTC (rev 6070)
+++ mltonlib/trunk/com/ssh/generic/unstable/Generate-combination.sh 2007-10-15 17:24:00 UTC (rev 6071)
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# Copyright (C) 2007 SSH Communications Security, Helsinki, Finland
+#
+# This code is released under the MLton license, a BSD-style license.
+# See the LICENSE file or http://mlton.org/License for details.
+
+source="$1"
+target="$2"
+
+echo "(* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland
+ *
+ * This code is released under the MLton license, a BSD-style license.
+ * See the LICENSE file or http://mlton.org/License for details.
+ *)
+
+(* WARNING: This file was generated by running '$(basename $0)' script as:
+ *
+ *> $(basename $0) $source $target
+ *)" > "$target"
+
+grep -e '[ /]with/.*\.sml' "$source" \
+ | xargs cat \
+ | grep -v -e '^[( ]\*' \
+ >> "$target"
Property changes on: mltonlib/trunk/com/ssh/generic/unstable/Generate-combination.sh
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:eol-style
+ native
Modified: mltonlib/trunk/com/ssh/generic/unstable/detail/generic.sml
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/detail/generic.sml 2007-10-15 15:12:31 UTC (rev 6070)
+++ mltonlib/trunk/com/ssh/generic/unstable/detail/generic.sml 2007-10-15 17:24:00 UTC (rev 6071)
@@ -4,55 +4,105 @@
* See the LICENSE file or http://mlton.org/License for details.
*)
-(* This whole file is a SML/NJ workaround. *)
+(* WARNING: This file was generated by running 'Generate-combination.sh' script as:
+ *
+ *> Generate-combination.sh lib-with-default.mlb detail/generic.sml
+ *)
-signature Generic = sig structure Open : OPEN_CASES end
-structure Generic : Generic = struct
+signature Generic = sig
+ structure Open : OPEN_CASES
+end
+
+functor MkGeneric (Arg : Generic) : Generic = Arg
+
+structure Generic = struct
structure Open = RootGeneric
end
-signature Generic = sig include Generic EQ end
-structure Generic : Generic = struct
- structure Open = WithEq (Generic)
- open Generic Open
+signature Generic = sig
+ include Generic EQ
end
-signature Generic = sig include Generic TYPE_HASH end
-structure Generic : Generic = struct
- structure Open = WithTypeHash (Generic)
- open Generic Open
+functor MkGeneric (Arg : Generic) = struct
+ structure Open = MkGeneric (Arg)
+ open Arg Open
+ structure EqRep = Open.Rep
end
-signature Generic = sig include Generic TYPE_INFO end
-structure Generic : Generic = struct
- structure Open = WithTypeInfo (Generic)
- open Generic Open
+structure Generic =
+ MkGeneric (structure Open = WithEq (Generic)
+ open Generic Open)
+
+signature Generic = sig
+ include Generic TYPE_HASH
end
-signature Generic = sig include Generic HASH end
-structure Generic : Generic = struct
- structure Open = WithHash
- (open Generic
- structure TypeHashRep = Open.Rep and TypeInfoRep = Open.Rep)
- open Generic Open
+functor MkGeneric (Arg : Generic) = struct
+ structure Open = MkGeneric (Arg)
+ open Arg Open
+ structure TypeHashRep = Open.Rep
end
-signature Generic = sig include Generic ORD end
-structure Generic = struct
- structure Open = WithOrd
- (open Generic
- structure HashRep = Open.Rep)
- open Generic Open
+structure Generic =
+ MkGeneric (structure Open = WithTypeHash (Generic)
+ open Generic Open)
+
+signature Generic = sig
+ include Generic TYPE_INFO
end
-signature Generic = sig include Generic PRETTY end
-structure Generic = struct
- structure Open = WithPretty
- (open Generic
- structure HashRep = Open.Rep)
- open Generic Open
+functor MkGeneric (Arg : Generic) = struct
+ structure Open = MkGeneric (Arg)
+ open Arg Open
+ structure TypeInfoRep = Open.Rep
end
+structure Generic =
+ MkGeneric (structure Open = WithTypeInfo (Generic)
+ open Generic Open)
+
+signature Generic = sig
+ include Generic HASH
+end
+
+functor MkGeneric (Arg : Generic) = struct
+ structure Open = MkGeneric (Arg)
+ open Arg Open
+ structure HashRep = Open.Rep
+end
+
+structure Generic =
+ MkGeneric (structure Open = WithHash (Generic)
+ open Generic Open)
+
+signature Generic = sig
+ include Generic ORD
+end
+
+functor MkGeneric (Arg : Generic) = struct
+ structure Open = MkGeneric (Arg)
+ open Arg Open
+ structure OrdRep = Open.Rep
+end
+
+structure Generic =
+ MkGeneric (structure Open = WithOrd (Generic)
+ open Generic Open)
+
+signature Generic = sig
+ include Generic PRETTY
+end
+
+functor MkGeneric (Arg : Generic) = struct
+ structure Open = MkGeneric (Arg)
+ open Arg Open
+ structure PrettyRep = Open.Rep
+end
+
+structure Generic =
+ MkGeneric (structure Open = WithPretty (Generic)
+ open Generic Open)
+
structure Generic = struct
structure Rep = ClosePrettyWithExtra
(open Generic
Modified: mltonlib/trunk/com/ssh/generic/unstable/test/generic.sml
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/test/generic.sml 2007-10-15 15:12:31 UTC (rev 6070)
+++ mltonlib/trunk/com/ssh/generic/unstable/test/generic.sml 2007-10-15 17:24:00 UTC (rev 6071)
@@ -4,54 +4,95 @@
* See the LICENSE file or http://mlton.org/License for details.
*)
-(* This whole file is a SML/NJ workaround. *)
+(* WARNING: This file was generated by running 'Generate-combination.sh' script as:
+ *
+ *> Generate-combination.sh test.mlb test/generic.sml
+ *)
-signature Generic = sig include Generic DATA_REC_INFO end
-structure Generic : Generic = struct
- structure Open = WithDataRecInfo (Generic)
- open Generic Open
+signature Generic = sig
+ include Generic DATA_REC_INFO
end
-signature Generic = sig include Generic SOME end
-structure Generic : Generic = struct
- structure Open = WithSome
- (open Generic
- structure TypeInfoRep = Open.Rep)
- open Generic Open
+functor MkGeneric (Arg : Generic) = struct
+ structure Open = MkGeneric (Arg)
+ open Arg Open
+ structure DataRecInfoRep = Open.Rep
end
-signature Generic = sig include Generic PICKLE end
-structure Generic : Generic = struct
- structure Open = WithPickle
- (open Generic
- structure DataRecInfoRep = Open.Rep and EqRep = Open.Rep
- and HashRep = Open.Rep and SomeRep = Open.Rep
- and TypeHashRep = Open.Rep and TypeInfoRep = Open.Rep)
- open Generic Open
+structure Generic =
+ MkGeneric (structure Open = WithDataRecInfo (Generic)
+ open Generic Open)
+
+signature Generic = sig
+ include Generic SOME
end
-signature Generic = sig include Generic SEQ end
-structure Generic : Generic = struct
- structure Open = WithSeq
- (open Generic
- structure HashRep = Open.Rep)
- open Generic Open
+functor MkGeneric (Arg : Generic) = struct
+ structure Open = MkGeneric (Arg)
+ open Arg Open
+ structure SomeRep = Open.Rep
end
-signature Generic = sig include Generic REDUCE end
-structure Generic : Generic = struct
- structure Open = WithReduce (Generic)
- open Generic Open
+structure Generic =
+ MkGeneric (structure Open = WithSome (Generic)
+ open Generic Open)
+
+signature Generic = sig
+ include Generic PICKLE
end
-signature Generic = sig include Generic TRANSFORM end
-structure Generic : Generic = struct
- structure Open = WithTransform
- (open Generic
- structure HashRep = Open.Rep)
- open Generic Open
+functor MkGeneric (Arg : Generic) = struct
+ structure Open = MkGeneric (Arg)
+ open Arg Open
+ structure PickleRep = Open.Rep
end
+structure Generic =
+ MkGeneric (structure Open = WithPickle (Generic)
+ open Generic Open)
+
+signature Generic = sig
+ include Generic SEQ
+end
+
+functor MkGeneric (Arg : Generic) = struct
+ structure Open = MkGeneric (Arg)
+ open Arg Open
+ structure SeqRep = Open.Rep
+end
+
+structure Generic =
+ MkGeneric (structure Open = WithSeq (Generic)
+ open Generic Open)
+
+signature Generic = sig
+ include Generic REDUCE
+end
+
+functor MkGeneric (Arg : Generic) = struct
+ structure Open = MkGeneric (Arg)
+ open Arg Open
+ structure ReduceRep = Open.Rep
+end
+
+structure Generic =
+ MkGeneric (structure Open = WithReduce (Generic)
+ open Generic Open)
+
+signature Generic = sig
+ include Generic TRANSFORM
+end
+
+functor MkGeneric (Arg : Generic) = struct
+ structure Open = MkGeneric (Arg)
+ open Arg Open
+ structure TransformRep = Open.Rep
+end
+
+structure Generic =
+ MkGeneric (structure Open = WithTransform (Generic)
+ open Generic Open)
+
structure Generic = struct
structure Rep = ClosePrettyWithExtra
(open Generic
Modified: mltonlib/trunk/com/ssh/generic/unstable/test.mlb
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/test.mlb 2007-10-15 15:12:31 UTC (rev 6070)
+++ mltonlib/trunk/com/ssh/generic/unstable/test.mlb 2007-10-15 17:24:00 UTC (rev 6071)
@@ -16,41 +16,22 @@
"warnUnused true"
in
local
+ with/data-rec-info.sml
+ with/some.sml
+ with/pickle.sml
+ with/seq.sml
+ with/reduce.sml
+ with/transform.sml
+ with/close-pretty-with-extra.sml
with/reg-basis-exns.sml
+
test/utils.fun
in
- local
- with/data-rec-info.sml
- with/some.sml
- with/pickle.sml
- with/seq.sml
- with/close-pretty-with-extra.sml
- in
- test/pickle.sml
- end
-
+ test/pickle.sml
test/pretty.sml
-
- local
- with/reduce.sml
- with/close-pretty-with-extra.sml
- in
- test/reduce.sml
- end
-
- local
- with/some.sml
- with/close-pretty-with-extra.sml
- in
- test/some.sml
- end
-
- local
- with/transform.sml
- with/close-pretty-with-extra.sml
- in
- test/transform.sml
- end
+ test/reduce.sml
+ test/some.sml
+ test/transform.sml
end
end
in
Modified: mltonlib/trunk/com/ssh/generic/unstable/with/arbitrary.sml
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/with/arbitrary.sml 2007-10-15 15:12:31 UTC (rev 6070)
+++ mltonlib/trunk/com/ssh/generic/unstable/with/arbitrary.sml 2007-10-15 17:24:00 UTC (rev 6071)
@@ -8,10 +8,14 @@
include Generic ARBITRARY
end
-structure Generic : Generic = struct
- structure Open = WithArbitrary
- (open Generic
- structure HashRep = Open.Rep and TypeInfoRep = Open.Rep
- structure RandomGen = RanQD1Gen)
- open Generic Open
+functor MkGeneric (Arg : Generic) = struct
+ structure Open = MkGeneric (Arg)
+ open Arg Open
+ structure ArbitraryRep = Open.Rep
end
+
+structure Generic =
+ MkGeneric (structure Open =
+ WithArbitrary (open Generic
+ structure RandomGen = RanQD1Gen)
+ open Generic Open)
Modified: mltonlib/trunk/com/ssh/generic/unstable/with/data-rec-info.sml
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/with/data-rec-info.sml 2007-10-15 15:12:31 UTC (rev 6070)
+++ mltonlib/trunk/com/ssh/generic/unstable/with/data-rec-info.sml 2007-10-15 17:24:00 UTC (rev 6071)
@@ -8,7 +8,12 @@
include Generic DATA_REC_INFO
end
-structure Generic : Generic = struct
- structure Open = WithDataRecInfo (Generic)
- open Generic Open
+functor MkGeneric (Arg : Generic) = struct
+ structure Open = MkGeneric (Arg)
+ open Arg Open
+ structure DataRecInfoRep = Open.Rep
end
+
+structure Generic =
+ MkGeneric (structure Open = WithDataRecInfo (Generic)
+ open Generic Open)
Modified: mltonlib/trunk/com/ssh/generic/unstable/with/dynamic.sml
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/with/dynamic.sml 2007-10-15 15:12:31 UTC (rev 6070)
+++ mltonlib/trunk/com/ssh/generic/unstable/with/dynamic.sml 2007-10-15 17:24:00 UTC (rev 6071)
@@ -8,7 +8,12 @@
include Generic DYNAMIC
end
-structure Generic : Generic = struct
- structure Open = WithDynamic (Generic)
- open Generic Open
+functor MkGeneric (Arg : Generic) = struct
+ structure Open = MkGeneric (Arg)
+ open Arg Open
+ structure DynamicRep = Open.Rep
end
+
+structure Generic =
+ MkGeneric (structure Open = WithDynamic (Generic)
+ open Generic Open)
Modified: mltonlib/trunk/com/ssh/generic/unstable/with/eq.sml
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/with/eq.sml 2007-10-15 15:12:31 UTC (rev 6070)
+++ mltonlib/trunk/com/ssh/generic/unstable/with/eq.sml 2007-10-15 17:24:00 UTC (rev 6071)
@@ -8,7 +8,12 @@
include Generic EQ
end
-structure Generic : Generic = struct
- structure Open = WithEq (Generic)
- open Generic Open
+functor MkGeneric (Arg : Generic) = struct
+ structure Open = MkGeneric (Arg)
+ open Arg Open
+ structure EqRep = Open.Rep
end
+
+structure Generic =
+ MkGeneric (structure Open = WithEq (Generic)
+ open Generic Open)
Modified: mltonlib/trunk/com/ssh/generic/unstable/with/generic.sml
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/with/generic.sml 2007-10-15 15:12:31 UTC (rev 6070)
+++ mltonlib/trunk/com/ssh/generic/unstable/with/generic.sml 2007-10-15 17:24:00 UTC (rev 6071)
@@ -8,6 +8,8 @@
structure Open : OPEN_CASES
end
-structure Generic : Generic = struct
+functor MkGeneric (Arg : Generic) : Generic = Arg
+
+structure Generic = struct
structure Open = RootGeneric
end
Modified: mltonlib/trunk/com/ssh/generic/unstable/with/hash.sml
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/with/hash.sml 2007-10-15 15:12:31 UTC (rev 6070)
+++ mltonlib/trunk/com/ssh/generic/unstable/with/hash.sml 2007-10-15 17:24:00 UTC (rev 6071)
@@ -8,9 +8,12 @@
include Generic HASH
end
-structure Generic : Generic = struct
- structure Open = WithHash
- (open Generic
- structure TypeHashRep = Open.Rep and TypeInfoRep = Open.Rep)
- open Generic Open
+functor MkGeneric (Arg : Generic) = struct
+ structure Open = MkGeneric (Arg)
+ open Arg Open
+ structure HashRep = Open.Rep
end
+
+structure Generic =
+ MkGeneric (structure Open = WithHash (Generic)
+ open Generic Open)
Modified: mltonlib/trunk/com/ssh/generic/unstable/with/ord.sml
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/with/ord.sml 2007-10-15 15:12:31 UTC (rev 6070)
+++ mltonlib/trunk/com/ssh/generic/unstable/with/ord.sml 2007-10-15 17:24:00 UTC (rev 6071)
@@ -8,9 +8,12 @@
include Generic ORD
end
-structure Generic : Generic = struct
- structure Open = WithOrd
- (open Generic
- structure HashRep = Open.Rep)
- open Generic Open
+functor MkGeneric (Arg : Generic) = struct
+ structure Open = MkGeneric (Arg)
+ open Arg Open
+ structure OrdRep = Open.Rep
end
+
+structure Generic =
+ MkGeneric (structure Open = WithOrd (Generic)
+ open Generic Open)
Modified: mltonlib/trunk/com/ssh/generic/unstable/with/pickle.sml
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/with/pickle.sml 2007-10-15 15:12:31 UTC (rev 6070)
+++ mltonlib/trunk/com/ssh/generic/unstable/with/pickle.sml 2007-10-15 17:24:00 UTC (rev 6071)
@@ -8,11 +8,12 @@
include Generic PICKLE
end
-structure Generic : Generic = struct
- structure Open = WithPickle
- (open Generic
- structure DataRecInfoRep = Open.Rep and EqRep = Open.Rep
- and HashRep = Open.Rep and SomeRep = Open.Rep
- and TypeHashRep = Open.Rep and TypeInfoRep = Open.Rep)
- open Generic Open
+functor MkGeneric (Arg : Generic) = struct
+ structure Open = MkGeneric (Arg)
+ open Arg Open
+ structure PickleRep = Open.Rep
end
+
+structure Generic =
+ MkGeneric (structure Open = WithPickle (Generic)
+ open Generic Open)
Modified: mltonlib/trunk/com/ssh/generic/unstable/with/pretty.sml
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/with/pretty.sml 2007-10-15 15:12:31 UTC (rev 6070)
+++ mltonlib/trunk/com/ssh/generic/unstable/with/pretty.sml 2007-10-15 17:24:00 UTC (rev 6071)
@@ -8,9 +8,12 @@
include Generic PRETTY
end
-structure Generic : Generic = struct
- structure Open = WithPretty
- (open Generic
- structure HashRep = Open.Rep)
- open Generic Open
+functor MkGeneric (Arg : Generic) = struct
+ structure Open = MkGeneric (Arg)
+ open Arg Open
+ structure PrettyRep = Open.Rep
end
+
+structure Generic =
+ MkGeneric (structure Open = WithPretty (Generic)
+ open Generic Open)
Modified: mltonlib/trunk/com/ssh/generic/unstable/with/reduce.sml
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/with/reduce.sml 2007-10-15 15:12:31 UTC (rev 6070)
+++ mltonlib/trunk/com/ssh/generic/unstable/with/reduce.sml 2007-10-15 17:24:00 UTC (rev 6071)
@@ -8,7 +8,12 @@
include Generic REDUCE
end
-structure Generic : Generic = struct
- structure Open = WithReduce (Generic)
- open Generic Open
+functor MkGeneric (Arg : Generic) = struct
+ structure Open = MkGeneric (Arg)
+ open Arg Open
+ structure ReduceRep = Open.Rep
end
+
+structure Generic =
+ MkGeneric (structure Open = WithReduce (Generic)
+ open Generic Open)
Modified: mltonlib/trunk/com/ssh/generic/unstable/with/seq.sml
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/with/seq.sml 2007-10-15 15:12:31 UTC (rev 6070)
+++ mltonlib/trunk/com/ssh/generic/unstable/with/seq.sml 2007-10-15 17:24:00 UTC (rev 6071)
@@ -8,9 +8,12 @@
include Generic SEQ
end
-structure Generic : Generic = struct
- structure Open = WithSeq
- (open Generic
- structure HashRep = Open.Rep)
- open Generic Open
+functor MkGeneric (Arg : Generic) = struct
+ structure Open = MkGeneric (Arg)
+ open Arg Open
+ structure SeqRep = Open.Rep
end
+
+structure Generic =
+ MkGeneric (structure Open = WithSeq (Generic)
+ open Generic Open)
Modified: mltonlib/trunk/com/ssh/generic/unstable/with/shrink.sml
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/with/shrink.sml 2007-10-15 15:12:31 UTC (rev 6070)
+++ mltonlib/trunk/com/ssh/generic/unstable/with/shrink.sml 2007-10-15 17:24:00 UTC (rev 6071)
@@ -8,9 +8,12 @@
include Generic SHRINK
end
-structure Generic : Generic = struct
- structure Open = WithShrink
- (open Generic
- structure OrdRep = Open.Rep and SizeRep = Open.Rep)
- open Generic Open
+functor MkGeneric (Arg : Generic) = struct
+ structure Open = MkGeneric (Arg)
+ open Arg Open
+ structure ShrinkRep = Open.Rep
end
+
+structure Generic =
+ MkGeneric (structure Open = WithShrink (Generic)
+ open Generic Open)
Modified: mltonlib/trunk/com/ssh/generic/unstable/with/size.sml
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/with/size.sml 2007-10-15 15:12:31 UTC (rev 6070)
+++ mltonlib/trunk/com/ssh/generic/unstable/with/size.sml 2007-10-15 17:24:00 UTC (rev 6071)
@@ -8,9 +8,12 @@
include Generic SIZE
end
-structure Generic : Generic = struct
- structure Open = WithSize
- (open Generic
- structure HashRep = Open.Rep and TypeInfoRep = Open.Rep)
- open Generic Open
+functor MkGeneric (Arg : Generic) = struct
+ structure Open = MkGeneric (Arg)
+ open Arg Open
+ structure SizeRep = Open.Rep
end
+
+structure Generic =
+ MkGeneric (structure Open = WithSize (Generic)
+ open Generic Open)
Modified: mltonlib/trunk/com/ssh/generic/unstable/with/some.sml
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/with/some.sml 2007-10-15 15:12:31 UTC (rev 6070)
+++ mltonlib/trunk/com/ssh/generic/unstable/with/some.sml 2007-10-15 17:24:00 UTC (rev 6071)
@@ -8,9 +8,12 @@
include Generic SOME
end
-structure Generic : Generic = struct
- structure Open = WithSome
- (open Generic
- structure TypeInfoRep = Open.Rep)
- open Generic Open
+functor MkGeneric (Arg : Generic) = struct
+ structure Open = MkGeneric (Arg)
+ open Arg Open
+ structure SomeRep = Open.Rep
end
+
+structure Generic =
+ MkGeneric (structure Open = WithSome (Generic)
+ open Generic Open)
Modified: mltonlib/trunk/com/ssh/generic/unstable/with/transform.sml
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/with/transform.sml 2007-10-15 15:12:31 UTC (rev 6070)
+++ mltonlib/trunk/com/ssh/generic/unstable/with/transform.sml 2007-10-15 17:24:00 UTC (rev 6071)
@@ -8,9 +8,12 @@
include Generic TRANSFORM
end
-structure Generic : Generic = struct
- structure Open = WithTransform
- (open Generic
- structure HashRep = Open.Rep)
- open Generic Open
+functor MkGeneric (Arg : Generic) = struct
+ structure Open = MkGeneric (Arg)
+ open Arg Open
+ structure TransformRep = Open.Rep
end
+
+structure Generic =
+ MkGeneric (structure Open = WithTransform (Generic)
+ open Generic Open)
Modified: mltonlib/trunk/com/ssh/generic/unstable/with/type-exp.sml
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/with/type-exp.sml 2007-10-15 15:12:31 UTC (rev 6070)
+++ mltonlib/trunk/com/ssh/generic/unstable/with/type-exp.sml 2007-10-15 17:24:00 UTC (rev 6071)
@@ -8,7 +8,12 @@
include Generic TYPE_EXP
end
-structure Generic : Generic = struct
- structure Open = WithTypeExp (Generic)
- open Generic Open
+functor MkGeneric (Arg : Generic) = struct
+ structure Open = MkGeneric (Arg)
+ open Arg Open
+ structure TypeExpRep = Open.Rep
end
+
+structure Generic =
+ MkGeneric (structure Open = WithTypeExp (Generic)
+ open Generic Open)
Modified: mltonlib/trunk/com/ssh/generic/unstable/with/type-hash.sml
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/with/type-hash.sml 2007-10-15 15:12:31 UTC (rev 6070)
+++ mltonlib/trunk/com/ssh/generic/unstable/with/type-hash.sml 2007-10-15 17:24:00 UTC (rev 6071)
@@ -8,7 +8,12 @@
include Generic TYPE_HASH
end
-structure Generic : Generic = struct
- structure Open = WithTypeHash (Generic)
- open Generic Open
+functor MkGeneric (Arg : Generic) = struct
+ structure Open = MkGeneric (Arg)
+ open Arg Open
+ structure TypeHashRep = Open.Rep
end
+
+structure Generic =
+ MkGeneric (structure Open = WithTypeHash (Generic)
+ open Generic Open)
Modified: mltonlib/trunk/com/ssh/generic/unstable/with/type-info.sml
===================================================================
--- mltonlib/trunk/com/ssh/generic/unstable/with/type-info.sml 2007-10-15 15:12:31 UTC (rev 6070)
+++ mltonlib/trunk/com/ssh/generic/unstable/with/type-info.sml 2007-10-15 17:24:00 UTC (rev 6071)
@@ -8,7 +8,12 @@
include Generic TYPE_INFO
end
-structure Generic : Generic = struct
- structure Open = WithTypeInfo (Generic)
- open Generic Open
+functor MkGeneric (Arg : Generic) = struct
+ structure Open = MkGeneric (Arg)
+ open Arg Open
+ structure TypeInfoRep = Open.Rep
end
+
+structure Generic =
+ MkGeneric (structure Open = WithTypeInfo (Generic)
+ open Generic Open)
Modified: mltonlib/trunk/com/ssh/unit-test/unstable/detail/generic.sml
===================================================================
--- mltonlib/trunk/com/ssh/unit-test/unstable/detail/generic.sml 2007-10-15 15:12:31 UTC (rev 6070)
+++ mltonlib/trunk/com/ssh/unit-test/unstable/detail/generic.sml 2007-10-15 17:24:00 UTC (rev 6071)
@@ -4,40 +4,55 @@
* See the LICENSE file or http://mlton.org/License for details.
*)
-(* This whole file is a SML/NJ workaround. *)
-
-(*
- * We assume here that {Eq} and {Pretty} have already been provided. The
- * {Arbitrary} generic is rather specific to randomized testing and has
- * probably little use otherwise. The same goes for {Shrink}. The {Size}
- * generic is probably also not used much outside testing.
+(* WARNING: This file was generated by running 'Generate-combination.sh' script as:
+ *
+ *> Generate-combination.sh lib-with-default.mlb detail/generic.sml
*)
-signature Generic = sig include Generic ARBITRARY end
-structure Generic : Generic = struct
- structure Open = WithArbitrary
- (open Generic
- structure HashRep = Open.Rep and TypeInfoRep = Open.Rep
- structure RandomGen = RanQD1Gen)
- open Generic Open
+signature Generic = sig
+ include Generic ARBITRARY
end
-signature Generic = sig include Generic SIZE end
-structure Generic : Generic = struct
- structure Open = WithSize
- (open Generic
- structure HashRep = Open.Rep and TypeInfoRep = Open.Rep)
- open Generic Open
+functor MkGeneric (Arg : Generic) = struct
+ structure Open = MkGeneric (Arg)
+ open Arg Open
+ structure ArbitraryRep = Open.Rep
end
-signature Generic = sig include Generic SHRINK end
-structure Generic : Generic = struct
- structure Open = WithShrink
- (open Generic
- structure OrdRep = Open.Rep and SizeRep = Open.Rep)
- open Generic Open
+structure Generic =
+ MkGeneric (structure Open =
+ WithArbitrary (open Generic
+ structure RandomGen = RanQD1Gen)
+ open Generic Open)
+
+signature Generic = sig
+ include Generic SIZE
end
+functor MkGeneric (Arg : Generic) = struct
+ structure Open = MkGeneric (Arg)
+ open Arg Open
+ structure SizeRep = Open.Rep
+end
+
+structure Generic =
+ MkGeneric (structure Open = WithSize (Generic)
+ open Generic Open)
+
+signature Generic = sig
+ include Generic SHRINK
+end
+
+functor MkGeneric (Arg : Generic) = struct
+ structure Open = MkGeneric (Arg)
+ open Arg Open
+ structure ShrinkRep = Open.Rep
+end
+
+structure Generic =
+ MkGeneric (structure Open = WithShrink (Generic)
+ open Generic Open)
+
structure Generic = struct
structure Rep = ClosePrettyWithExtra
(open Generic
Modified: mltonlib/trunk/com/ssh/unit-test/unstable/detail/unit-test.sml
===================================================================
--- mltonlib/trunk/com/ssh/unit-test/unstable/detail/unit-test.sml 2007-10-15 15:12:31 UTC (rev 6070)
+++ mltonlib/trunk/com/ssh/unit-test/unstable/detail/unit-test.sml 2007-10-15 17:24:00 UTC (rev 6071)
@@ -4,7 +4,4 @@
* See the LICENSE file or http://mlton.org/License for details.
*)
-structure UnitTest = MkUnitTest
- (open Generic
- structure ArbitraryRep = Open.Rep and EqRep = Open.Rep
- and PrettyRep = Open.Rep and ShrinkRep = Open.Rep)
+structure UnitTest = MkUnitTest (Generic)
Modified: mltonlib/trunk/com/ssh/unit-test/unstable/lib-with-default.mlb
===================================================================
--- mltonlib/trunk/com/ssh/unit-test/unstable/lib-with-default.mlb 2007-10-15 15:12:31 UTC (rev 6070)
+++ mltonlib/trunk/com/ssh/unit-test/unstable/lib-with-default.mlb 2007-10-15 17:24:00 UTC (rev 6071)
@@ -12,10 +12,10 @@
lib.mlb
(* Order matters: *)
- $(MLTON_LIB)/com/ssh/generic/unstable/with/arbitrary.sml
- $(MLTON_LIB)/com/ssh/generic/unstable/with/size.sml
- $(MLTON_LIB)/com/ssh/generic/unstable/with/shrink.sml
- $(MLTON_LIB)/com/ssh/generic/unstable/with/close-pretty-with-extra.sml
+ ../../generic/unstable/with/arbitrary.sml
+ ../../generic/unstable/with/size.sml
+ ../../generic/unstable/with/shrink.sml
+ ../../generic/unstable/with/close-pretty-with-extra.sml
detail/unit-test.sml
end
More information about the MLton-commit
mailing list