summaryrefslogtreecommitdiff
path: root/src/elaborate.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2011-01-06 19:26:31 -0500
committerGravatar Adam Chlipala <adam@chlipala.net>2011-01-06 19:26:31 -0500
commitfb8539bea137355f9a7891bb8e4a775512971d5e (patch)
treebb211cb4e516325822ef56d7e76060ffeabce244 /src/elaborate.sml
parentbf12a298f6505ef0e4a204222e3231c89c3c2182 (diff)
Handle opening of modules that define signatures
Diffstat (limited to 'src/elaborate.sml')
-rw-r--r--src/elaborate.sml21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/elaborate.sml b/src/elaborate.sml
index 4e59a8ed..3dc351b7 100644
--- a/src/elaborate.sml
+++ b/src/elaborate.sml
@@ -2682,15 +2682,18 @@ and selfify env {str, strs, sgn} =
| 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) =>