Replace mapMaybe and concatMap with list comprehensions
This commit is contained in:
parent
61b073d507
commit
1e32139f66
|
@ -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 ()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue