Statistics
| Branch: | Tag: | Revision:

root / htools / lint-hints.hs @ 4c91d2ad

History | View | Annotate | Download (432 Bytes)

1 5a1e31b4 Iustin Pop
-- The following two hints warn to simplify e.g. "map (\v -> (v,
2 5a1e31b4 Iustin Pop
-- True)) lst" to "zip lst (repeat True)", which is more abstract
3 5a1e31b4 Iustin Pop
warn = map (\v -> (v, x)) y ==> zip y (repeat x)
4 5a1e31b4 Iustin Pop
  where _ = notIn v x
5 5a1e31b4 Iustin Pop
warn = map (\v -> (x, v)) ==> zip (repeat x)
6 5a1e31b4 Iustin Pop
  where _ = notIn v x
7 0c76f280 Iustin Pop
8 0c76f280 Iustin Pop
-- The following warn on use of length instead of null
9 0c76f280 Iustin Pop
warn = length x > 0 ==> not (null x)
10 0c76f280 Iustin Pop
warn = length x /= 0 ==> not (null x)
11 0c76f280 Iustin Pop
warn = length x == 0 ==> null x