Use dropWhileEndLE p instead of reverse . dropWhile p . reverse
authorDavid Feuer <David.Feuer@gmail.com>
Wed, 1 Oct 2014 21:34:29 +0000 (23:34 +0200)
committerJoachim Breitner <mail@joachim-breitner.de>
Wed, 1 Oct 2014 21:38:32 +0000 (23:38 +0200)
commit2a8856884de7d476e26b4ffa829ccb3a14d6f63e
treea5ba7fc47baf0cf68cf01336a38c963ad19c43b2
parent53a2d46d185bcffe005e84b4e7acf6b196f2329e
Use dropWhileEndLE p instead of reverse . dropWhile p . reverse

Summary: Using `dropWhileEndLE` tends to be faster and easier to read
than the `reverse . dropWhile p . reverse` idiom. This also cleans up
some other, nearby, messes. Fix #9616 (incorrect number formatting
potentially leading to incorrect numbers in output).

Test Plan: Run validate

Reviewers: thomie, rwbarton, nomeata, austin

Reviewed By: nomeata, austin

Subscribers: simonmar, ezyang, carter, thomie

Projects: #ghc

Differential Revision: https://phabricator.haskell.org/D259

GHC Trac Issues: #9623, #9616

Conflicts:
compiler/basicTypes/OccName.lhs
compiler/basicTypes/OccName.lhs
compiler/utils/Util.lhs
libraries/base/GHC/Windows.hs
utils/hpc/HpcMarkup.hs
utils/hpc/HpcUtils.hs