@@ -198,7 +198,7 @@ renameInModule imports exports (Module mn decls exps) =
198198 where
199199 (go, _, _, _, _) = everywhereWithContextOnValuesM (Nothing, []) updateDecl updateValue updateBinder updateCase defS
200200
201− updateDecl :: (Maybe SourcePos, [Ident]) -> Declaration -> Either ErrorStack ((Maybe SourcePos, [Ident]), Declaration)
201+ updateDecl :: (Maybe SourceSpan, [Ident]) -> Declaration -> Either ErrorStack ((Maybe SourceSpan, [Ident]), Declaration)
202202 updateDecl (_, bound) d@(PositionedDeclaration pos _) = return ((Just pos, bound), d)
203203 updateDecl (pos, bound) (DataDeclaration dtype name args dctors) =
204204 (,) (pos, bound) <$> (DataDeclaration dtype name args <$> mapM (sndM (mapM (updateTypesEverywhere pos))) dctors)
@@ -216,7 +216,7 @@ renameInModule imports exports (Module mn decls exps) =
216216 (,) (pos, name : bound) <$> (ExternDeclaration fit name js <$> updateTypesEverywhere pos ty)
217217 updateDecl s d = return (s, d)
218218
219− updateValue :: (Maybe SourcePos, [Ident]) -> Expr -> Either ErrorStack ((Maybe SourcePos, [Ident]), Expr)
219+ updateValue :: (Maybe SourceSpan, [Ident]) -> Expr -> Either ErrorStack ((Maybe SourceSpan, [Ident]), Expr)
220220 updateValue (_, bound) v@(PositionedValue pos' _) = return ((Just pos', bound), v)
221221 updateValue (pos, bound) (Abs (Left arg) val') = return ((pos, arg : bound), Abs (Left arg) val')
222222 updateValue (pos, bound) (Let ds val') =
@@ -234,12 +234,12 @@ renameInModule imports exports (Module mn decls exps) =
234234 updateValue s@(pos, _) (TypedValue check val ty) = (,) s <$> (TypedValue check val <$> updateTypesEverywhere pos ty)
235235 updateValue s v = return (s, v)
236236
237− updateBinder :: (Maybe SourcePos, [Ident]) -> Binder -> Either ErrorStack ((Maybe SourcePos, [Ident]), Binder)
237+ updateBinder :: (Maybe SourceSpan, [Ident]) -> Binder -> Either ErrorStack ((Maybe SourceSpan, [Ident]), Binder)
238238 updateBinder (_, bound) v@(PositionedBinder pos _) = return ((Just pos, bound), v)
239239 updateBinder s@(pos, _) (ConstructorBinder name b) = (,) s <$> (ConstructorBinder <$> updateDataConstructorName name pos <*> pure b)
240240 updateBinder s v = return (s, v)
241241
242− updateCase :: (Maybe SourcePos, [Ident]) -> CaseAlternative -> Either ErrorStack ((Maybe SourcePos, [Ident]), CaseAlternative)
242+ updateCase :: (Maybe SourceSpan, [Ident]) -> CaseAlternative -> Either ErrorStack ((Maybe SourceSpan, [Ident]), CaseAlternative)
243243 updateCase (pos, bound) c@(CaseAlternative bs _) = return ((pos, concatMap binderNames bs ++ bound), c)
244244
245245 letBoundVariable :: Declaration -> Maybe Ident
@@ -247,10 +247,10 @@ renameInModule imports exports (Module mn decls exps) =
247247 letBoundVariable (PositionedDeclaration _ d) = letBoundVariable d
248248 letBoundVariable _ = Nothing
249249
250− updateTypesEverywhere :: Maybe SourcePos -> Type -> Either ErrorStack Type
250+ updateTypesEverywhere :: Maybe SourceSpan -> Type -> Either ErrorStack Type
251251 updateTypesEverywhere pos0 = everywhereOnTypesM (updateType pos0)
252252 where
253− updateType :: Maybe SourcePos -> Type -> Either ErrorStack Type
253+ updateType :: Maybe SourceSpan -> Type -> Either ErrorStack Type
254254 updateType pos (TypeConstructor name) = TypeConstructor <$> updateTypeName name pos
255255 updateType pos (SaturatedTypeSynonym name tys) = SaturatedTypeSynonym <$> updateTypeName name pos <*> pure tys
256256 updateType pos (ConstrainedType cs t) = ConstrainedType <$> updateConstraints pos cs <*> pure t
@@ -269,7 +269,7 @@ renameInModule imports exports (Module mn decls exps) =
269269 -> (ImportEnvironment -> M.Map (Qualified a) (Qualified a))
270270 -> (Exports -> a -> Bool)
271271 -> Qualified a
272− -> Maybe SourcePos
272+ -> Maybe SourceSpan
273273 -> Either ErrorStack (Qualified a)
274274 update t getI checkE qname@(Qualified mn' name) pos = positioned $ case (M.lookup qname imports', mn') of
275275 (Just qname', _) -> return qname'
@@ -385,7 +385,7 @@ filterExports mn exps env = do
385385-- Finds the imports within a module, mapping the imported module name to an optional set of
386386-- explicitly imported declarations.
387387--
388−findImports :: [Declaration] -> M.Map ModuleName (Maybe SourcePos, ImportDeclarationType, Maybe ModuleName)
388+findImports :: [Declaration] -> M.Map ModuleName (Maybe SourceSpan, ImportDeclarationType, Maybe ModuleName)
389389findImports = foldl (findImports' Nothing) M.empty
390390 where
391391 findImports' pos result (ImportDeclaration mn typ qual) = M.insert mn (pos, typ, qual) result
@@ -403,10 +403,10 @@ resolveImports env (Module currentModule decls _) =
403403 -- A Map from module name to the source position for the import, the list of imports from that
404404 -- module (where Nothing indicates everything is to be imported), and optionally a qualified name
405405 -- for the module
406− scope :: M.Map ModuleName (Maybe SourcePos, ImportDeclarationType, Maybe ModuleName)
406+ scope :: M.Map ModuleName (Maybe SourceSpan, ImportDeclarationType, Maybe ModuleName)
407407 scope = M.insert currentModule (Nothing, Unqualified, Nothing) (findImports decls)
408408
409− resolveImport' :: ImportEnvironment -> (ModuleName, (Maybe SourcePos, ImportDeclarationType, Maybe ModuleName)) -> Either ErrorStack ImportEnvironment
409+ resolveImport' :: ImportEnvironment -> (ModuleName, (Maybe SourceSpan, ImportDeclarationType, Maybe ModuleName)) -> Either ErrorStack ImportEnvironment
410410 resolveImport' imp (mn, (pos, typ, impQual)) = do
411411 modExports <- positioned $ maybe (throwError $ mkErrorStack ("Cannot import unknown module '" ++ show mn ++ "'") Nothing) return $ mn `M.lookup` env
412412 positioned $ resolveImport currentModule mn modExports imp impQual typ