Replace mapMaybe and concatMap with list comprehensions

This commit is contained in:
Joseph C. Sible 2020-02-09 19:18:43 -05:00
parent 61b073d507
commit 1e32139f66
1 changed files with 2 additions and 9 deletions

View File

@ -87,13 +87,8 @@ runList spec list = notes
getEnableDirectives root = getEnableDirectives root =
case root of case root of
T_Annotation _ list _ -> mapMaybe getEnable list T_Annotation _ list _ -> [s | EnableComment s <- list]
_ -> [] _ -> []
where
getEnable t =
case t of
EnableComment s -> return s
_ -> Nothing
checkList l t = concatMap (\f -> f t) l checkList l t = concatMap (\f -> f t) l
@ -3123,9 +3118,7 @@ checkUnmatchableCases params t =
Just l -> " on line " <> show l <> "." Just l -> " on line " <> show l <> "."
_ -> "." _ -> "."
valids = concatMap f rest valids = [(x,y) | (x, Just y) <- rest]
f (x, Just y) = [(x,y)]
f _ = []
checkDoms _ = return () checkDoms _ = return ()