git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Tidy up
commitb57566fdd802ed8c943343ead35aca785434580a authorGary Burgess <gary.burgess@gmail.com> dateFri 28 Feb 2014, 00:31 (13 years ago) parent4df0d73
2 files changed+4−4
src/Language/PureScript/Sugar/Names.hs+3−3 src/Language/PureScript/TypeChecker/Monad.hs+1−1
src/Language/PureScript/Sugar/Names.hs+3−3
@@ -92,7 +92,7 @@ addTypeclass env mn name = do
9292addExport :: (Ord s, Show s) => M.Map ModuleName (S.Set s) -> ModuleName -> s -> Either String (M.Map ModuleName (S.Set s))
9393addExport exports mn name = case M.lookup mn exports of
9494 Just s -> if S.member name s
95− then Left $ "Module '" ++ show mn ++ "' has multiple definitions for '" ++ (show name) ++ "'"
95+ then Left $ "Module '" ++ show mn ++ "' has multiple definitions for '" ++ show name ++ "'"
9696 else Right $ M.insert mn (S.insert name s) exports
9797 Nothing -> Right $ M.insert mn (S.singleton name) exports
9898
@@ -113,7 +113,7 @@ rename modules = do
113113--
114114renameInModule :: ImportEnvironment -> Module -> Either String Module
115115renameInModule imports (Module mn decls) =
116− Module mn <$> mapM updateDecl decls >>= everywhereM ((mkM updateType) `extM` updateValue `extM` updateBinder)
116+ Module mn <$> mapM updateDecl decls >>= everywhereM (mkM updateType `extM` updateValue `extM` updateBinder)
117117 where
118118 updateDecl (TypeInstanceDeclaration cs (Qualified Nothing cn) ts ds) = do
119119 cn' <- updateClassName cn
@@ -197,7 +197,7 @@ resolveImports env (Module currentModule decls) = do
197197 resolveDcons result (mn, tcons) = case M.lookup mn scope of
198198 Just Nothing -> foldM (\result (tcon, dcons) -> foldM (resolveDef mn) result dcons) result (S.toList tcons)
199199 Just (Just expl) ->
200− let selectedTcons = filter (\(tcon, _) -> any (either (const False) ((==) tcon)) expl) (S.toList tcons) in
200+ let selectedTcons = filter (\(tcon, _) -> any (either (const False) (tcon ==)) expl) (S.toList tcons) in
201201 foldM (\result (tcon, dcons) -> foldM (resolveDef mn) result dcons) result selectedTcons
202202 Nothing -> Right result
203203 filterTypes result = either (const result) (`S.insert` result)
src/Language/PureScript/TypeChecker/Monad.hs+1−1
@@ -154,7 +154,7 @@ bindLocalVariables moduleName bindings =
154154--
155155bindLocalTypeVariables :: (Functor m, MonadState CheckState m) => ModuleName -> [(ProperName, Kind)] -> m a -> m a
156156bindLocalTypeVariables moduleName bindings =
157− bindTypes (M.fromList $ flip map bindings $ \(name, k) -> (Qualified (Just moduleName) name, k))
157+ bindTypes (M.fromList $ flip map bindings $ first $ Qualified (Just moduleName))
158158
159159-- |
160160-- Lookup the type of a value by name in the @Environment@