@@ -143,14 +143,14 @@ desugarImports modules = do
143143-- Rethrow an error with the name of the current module in the case of a failure
144144--
145145rethrowForModule :: Module -> Either String a -> Either String a
146−rethrowForModule (Module mn _) = flip catchError $ \e -> throwError ("Error in module '" ++ show mn ++ "':\n" ++ e)
146+rethrowForModule (Module mn _ _) = flip catchError $ \e -> throwError ("Error in module '" ++ show mn ++ "':\n" ++ e)
147147
148148-- |
149149-- Replaces all local names with qualified names within a module.
150150--
151151renameInModule :: ImportEnvironment -> Module -> Either String Module
152−renameInModule imports (Module mn decls) =
153− Module mn <$> mapM updateDecl decls >>= everywhereM (mkM updateType `extM` updateValue `extM` updateBinder `extM` updateVars)
152+renameInModule imports (Module mn decls exps) =
153+ Module mn <$> (mapM updateDecl decls >>= everywhereM (mkM updateType `extM` updateValue `extM` updateBinder `extM` updateVars)) <*> pure exps
154154 where
155155 updateDecl (TypeInstanceDeclaration name cs (Qualified Nothing cn) ts ds) =
156156 TypeInstanceDeclaration name <$> updateConstraints cs <*> updateClassName cn <*> pure ts <*> pure ds
@@ -197,7 +197,7 @@ renameInModule imports (Module mn decls) =
197197findExports :: [Module] -> Either String ExportEnvironment
198198findExports = foldM addModule M.empty
199199 where
200− addModule env m@(Module mn ds) = rethrowForModule m $ foldM (addDecl mn) (addEmptyModule env mn) ds
200+ addModule env m@(Module mn ds exps) = rethrowForModule m $ foldM (addDecl mn) (addEmptyModule env mn) ds
201201 addDecl mn env (TypeClassDeclaration tcn _ ds) = do
202202 env' <- addTypeClass env mn tcn
203203 foldM (\env'' (TypeDeclaration name _) -> addValue env'' mn name) env' ds
@@ -227,7 +227,7 @@ findImports = foldl findImports' M.empty
227227-- Constructs a local environment for a module.
228228--
229229resolveImports :: ExportEnvironment -> Module -> Either String ImportEnvironment
230−resolveImports env (Module currentModule decls) =
230+resolveImports env (Module currentModule decls _) =
231231 foldM resolveImport' (ImportEnvironment M.empty M.empty M.empty M.empty) (M.toList scope)
232232 where
233233 -- A Map from module name to imports from that module, where Nothing indicates everything is to be imported