git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
apply hlint suggestions
commit20f1200532678510ff2ec4ee28d376619c51e3c8 authorChristoph Hegemann <christoph.hegemann1337@gmail.com> dateFri 5 Feb 2016, 02:18 (11 years ago) parent1b5d32d
1 file changed+5−5
src/Language/PureScript/TypeChecker.hs+5−5
src/Language/PureScript/TypeChecker.hs+5−5
@@ -230,14 +230,14 @@ typeCheckAll moduleName _ ds = traverse go ds <* traverse_ checkFixities ds
230230 let args' = args `withKinds` kind
231231 addTypeSynonym moduleName name args' ty kind
232232 return $ TypeSynonymDeclaration name args ty
233− go (TypeDeclaration{}) = internalError "Type declarations should have been removed"
233+ go TypeDeclaration{} = internalError "Type declarations should have been removed"
234234 go (ValueDeclaration name nameKind [] (Right val)) =
235235 warnAndRethrow (addHint (ErrorInValueDeclaration name)) $ do
236236 valueIsNotDefined moduleName name
237237 [(_, (val', ty))] <- typesOf moduleName [(name, val)]
238238 addValue moduleName name ty nameKind
239239 return $ ValueDeclaration name nameKind [] $ Right val'
240− go (ValueDeclaration{}) = internalError "Binders were not desugared"
240+ go ValueDeclaration{} = internalError "Binders were not desugared"
241241 go (BindingGroupDeclaration vals) =
242242 warnAndRethrow (addHint (ErrorInBindingGroup (map (\(ident, _, _) -> ident) vals))) $ do
243243 for_ (map (\(ident, _, _) -> ident) vals) $ \name ->
@@ -264,8 +264,8 @@ typeCheckAll moduleName _ ds = traverse go ds <* traverse_ checkFixities ds
264264 Just _ -> throwError . errorMessage $ RedefinedIdent name
265265 Nothing -> putEnv (env { names = M.insert (moduleName, name) (ty, External, Defined) (names env) })
266266 return d
267− go (d@(FixityDeclaration{})) = return d
268− go (d@(ImportDeclaration{})) = return d
267+ go (d@FixityDeclaration{}) = return d
268+ go (d@ImportDeclaration{}) = return d
269269 go (d@(TypeClassDeclaration pn args implies tys)) = do
270270 addTypeClass moduleName pn args implies tys
271271 return d
@@ -429,7 +429,7 @@ typeCheckModule (Module ss coms mn decls (Just exps)) = warnAndRethrow (addHint
429429 checkNonAliasesAreExported dr@(ValueRef (Op name)) =
430430 case listToMaybe (mapMaybe getAlias decls) of
431431 Just alias ->
432− when (not $ any (== ValueRef alias) exps) $
432+ unless (ValueRef alias `elem` exps) $
433433 throwError . errorMessage $ TransitiveExportError dr [ValueRef alias]
434434 _ -> return ()
435435 where