[MLton-commit] r5058
Vesa Karvonen
vesak at mlton.org
Fri Jan 12 04:37:12 PST 2007
Initial commit of a lib of misc utils to be refactored.
----------------------------------------------------------------------
A mltonlib/trunk/com/ssh/misc-util/unstable/structural-type-to-type.fun
----------------------------------------------------------------------
Added: mltonlib/trunk/com/ssh/misc-util/unstable/structural-type-to-type.fun
===================================================================
--- mltonlib/trunk/com/ssh/misc-util/unstable/structural-type-to-type.fun 2007-01-12 12:36:24 UTC (rev 5057)
+++ mltonlib/trunk/com/ssh/misc-util/unstable/structural-type-to-type.fun 2007-01-12 12:37:06 UTC (rev 5058)
@@ -0,0 +1,35 @@
+(* 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.
+ *)
+
+(*
+ * A functor for lifting a structural type-index to a type-index.
+ *)
+
+functor StructuralTypeToType
+ (S : STRUCTURAL_TYPE) :>
+TYPE
+ where type 'a t = 'a S.t
+ where type 'a s = 'a S.t
+ where type ('a, 'k) p = 'a S.t = struct
+ open S
+
+ type 'a s = 'a t
+ type ('a, 'k) p = 'a t
+
+ val isoProduct = iso
+ val isoSum = iso
+
+ val T = id
+ fun R _ = id
+
+ val tuple = id
+ val record = id
+
+ fun C0 _ = unit
+ fun C1 _ = id
+
+ val data = id
+end
Property changes on: mltonlib/trunk/com/ssh/misc-util/unstable/structural-type-to-type.fun
___________________________________________________________________
Name: svn:eol-style
+ native
More information about the MLton-commit
mailing list