Remove use of 'head' and add hlint warning for it
authorIustin Pop <iustin@google.com>
Thu, 7 Feb 2013 13:22:01 +0000 (14:22 +0100)
committerIustin Pop <iustin@google.com>
Thu, 7 Feb 2013 16:14:26 +0000 (17:14 +0100)
commit72747d91e185e4bb53bfae32af1ec8dcd04d5375
tree4b65d629b8b2eb1d1702bb5b07d9f7ce7e992b72
parentb6ad806f59f8b21e1040f4720c65b8a31ccd918d
Remove use of 'head' and add hlint warning for it

Since 'head' is unsafe to use in most cases, this patch removes its
use from most of the code, adds a lint warning for it (and for tail as
well), and adds override annotations in the few cases where it's
actually OK to use it (mainly when using head over the result of
functions which guarantee to return a non-empty list by documentation,
not type).

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
19 files changed:
src/Ganeti/HTools/Backend/IAlloc.hs
src/Ganeti/HTools/Backend/Luxi.hs
src/Ganeti/HTools/Backend/Rapi.hs
src/Ganeti/HTools/Cluster.hs
src/Ganeti/HTools/Graph.hs
src/Ganeti/HTools/Node.hs
src/Ganeti/HTools/Program/Hail.hs
src/Ganeti/HTools/Program/Hbal.hs
src/Ganeti/HTools/Program/Hspace.hs
src/Ganeti/Query/Server.hs
src/Ganeti/Utils.hs
src/lint-hints.hs
test/hs/Test/Ganeti/Common.hs
test/hs/Test/Ganeti/HTools/Container.hs
test/hs/Test/Ganeti/JQueue.hs
test/hs/Test/Ganeti/Objects.hs
test/hs/Test/Ganeti/OpCodes.hs
test/hs/Test/Ganeti/TestCommon.hs
test/hs/Test/Ganeti/Utils.hs