Revision 72747d91 src/lint-hints.hs

b/src/lint-hints.hs
20 20
warn = length x > 0 ==> not (null x)
21 21
warn = length x /= 0 ==> not (null x)
22 22
warn = length x == 0 ==> null x
23

  
24
-- Never use head, use 'case' which covers all possibilities
25
warn = head x ==> case x of { y:_ -> y } where note = "Head is unsafe, please use case and handle the empty list as well"
26

  
27
-- Never use tail, use 'case' which covers all possibilities
28
warn = tail x ==> case x of { _:y -> y } where note = "Tail is unsafe, please use case and handle the empty list as well"

Also available in: Unified diff