# HG changeset patch # User Adam Chlipala # Date 1294359991 18000 # Node ID dd99e17024324e4766a6b54052c72a99b5221c3e # Parent 64724ef86149c1d1972adc07ca359802a548e029 Handle opening of modules that define signatures diff -r 64724ef86149 -r dd99e1702432 src/elaborate.sml --- 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) =>