diff src/elaborate.sml @ 18:9a578171de9e

Unification wildcards
author Adam Chlipala <adamc@hcoop.net>
date Sun, 08 Jun 2008 14:25:27 -0400
parents 9bd8669d53c2
children 4ab19c19665f
line wrap: on
line diff
--- a/src/elaborate.sml	Sun Jun 08 14:10:51 2008 -0400
+++ b/src/elaborate.sml	Sun Jun 08 14:25:27 2008 -0400
@@ -36,13 +36,6 @@
 open Print
 open ElabPrint
 
-fun elabKind (k, loc) =
-    case k of
-        L.KType => (L'.KType, loc)
-      | L.KArrow (k1, k2) => (L'.KArrow (elabKind k1, elabKind k2), loc)
-      | L.KName => (L'.KName, loc)
-      | L.KRecord k => (L'.KRecord (elabKind k), loc)
-
 fun elabExplicitness e =
     case e of
         L.Explicit => L'.Explicit
@@ -183,6 +176,14 @@
 
 end
 
+fun elabKind (k, loc) =
+    case k of
+        L.KType => (L'.KType, loc)
+      | L.KArrow (k1, k2) => (L'.KArrow (elabKind k1, elabKind k2), loc)
+      | L.KName => (L'.KName, loc)
+      | L.KRecord k => (L'.KRecord (elabKind k), loc)
+      | L.KWild => kunif ()
+
 fun elabCon env (c, loc) =
     case c of
         L.CAnnot (c, k) =>
@@ -283,6 +284,13 @@
             ((L'.CConcat (c1', c2'), loc), k)
         end
 
+      | L.CWild k =>
+        let
+            val k' = elabKind k
+        in
+            (cunif k', k')
+        end
+
 fun kunifsRemain k =
     case k of
         L'.KUnif (_, ref NONE) => true