Use forM_ instead of reimplementing it

This commit is contained in:
Joseph C. Sible 2020-02-09 22:08:31 -05:00
parent 962fad038c
commit 7fc9496320
1 changed files with 2 additions and 3 deletions

View File

@ -3090,11 +3090,10 @@ checkUnmatchableCases params t =
tupMap f l = map (\x -> (x, f x)) l
checkDoms ((glob, Just x), rest) =
case filter (\(_, p) -> x `pseudoGlobIsSuperSetof` p) valids of
((first,_):_) -> do
forM_ (find (\(_, p) -> x `pseudoGlobIsSuperSetof` p) valids) $
\(first,_) -> do
warn (getId glob) 2221 $ "This pattern always overrides a later one" <> patternContext (getId first)
warn (getId first) 2222 $ "This pattern never matches because of a previous pattern" <> patternContext (getId glob)
_ -> return ()
where
patternContext :: Id -> String
patternContext id =