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>
Thu, 2 Oct 2014 20:13:29 +0000 (22:13 +0200)
commit9bf5228fdc1937f44901a945553eea3cb0f14faa
tree243925bae6f8869cca1df8595c17c0467b9d5998
parentd6d5c127b86dc186b25add2843cb83fc12e72a85
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