changeset 1387:dd99e1702432

Handle opening of modules that define signatures
author Adam Chlipala <adam@chlipala.net>
date Thu, 06 Jan 2011 19:26:31 -0500
parents 64724ef86149
children 3913cbfd72e9
files src/elaborate.sml
diffstat 1 files changed, 12 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/elaborate.sml	Thu Jan 06 14:45:52 2011 -0500
+++ b/src/elaborate.sml	Thu Jan 06 19:26:31 2011 -0500
@@ -2682,15 +2682,18 @@
       | L'.SgnVar _ => sgn
 
       | L'.SgnConst sgis =>
-        (L'.SgnConst (ListUtil.mapConcat (fn (L'.SgiConAbs (x, n, k), loc) =>
-                              [(L'.SgiCon (x, n, k, (L'.CModProj (str, strs, x), loc)), loc)]
-                            | (L'.SgiDatatype dts, loc) =>
-                              map (fn (x, n, xs, xncs) => (L'.SgiDatatypeImp (x, n, str, strs, x, xs, xncs), loc)) dts
-                            | (L'.SgiClassAbs (x, n, k), loc) =>
-                              [(L'.SgiClass (x, n, k, (L'.CModProj (str, strs, x), loc)), loc)]
-                            | (L'.SgiStr (x, n, sgn), loc) =>
-                              [(L'.SgiStr (x, n, selfify env {str = str, strs = strs @ [x], sgn = sgn}), loc)]
-                            | x => [x]) sgis), #2 sgn)
+        (L'.SgnConst (#1 (ListUtil.foldlMapConcat
+                              (fn (sgi, env) =>
+                                  (case sgi of (L'.SgiConAbs (x, n, k), loc) =>
+                                               [(L'.SgiCon (x, n, k, (L'.CModProj (str, strs, x), loc)), loc)]
+                                             | (L'.SgiDatatype dts, loc) =>
+                                               map (fn (x, n, xs, xncs) => (L'.SgiDatatypeImp (x, n, str, strs, x, xs, xncs), loc)) dts
+                                             | (L'.SgiClassAbs (x, n, k), loc) =>
+                                               [(L'.SgiClass (x, n, k, (L'.CModProj (str, strs, x), loc)), loc)]
+                                             | (L'.SgiStr (x, n, sgn), loc) =>
+                                               [(L'.SgiStr (x, n, selfify env {str = str, strs = strs @ [x], sgn = sgn}), loc)]
+                                             | x => [x],
+                                   E.sgiBinds env sgi)) env sgis)), #2 sgn)
       | L'.SgnFun _ => sgn
       | L'.SgnWhere _ => sgn
       | L'.SgnProj (m, ms, x) =>