root / htools / lint-hints.hs @ 96dad12d
History | View | Annotate | Download (432 Bytes)
1 |
-- The following two hints warn to simplify e.g. "map (\v -> (v, |
---|---|
2 |
-- True)) lst" to "zip lst (repeat True)", which is more abstract |
3 |
warn = map (\v -> (v, x)) y ==> zip y (repeat x) |
4 |
where _ = notIn v x |
5 |
warn = map (\v -> (x, v)) ==> zip (repeat x) |
6 |
where _ = notIn v x |
7 |
|
8 |
-- The following warn on use of length instead of null |
9 |
warn = length x > 0 ==> not (null x) |
10 |
warn = length x /= 0 ==> not (null x) |
11 |
warn = length x == 0 ==> null x |