summaryrefslogtreecommitdiff
path: root/utils/hpc/HpcUtils.hs
diff options
context:
space:
mode:
Diffstat (limited to 'utils/hpc/HpcUtils.hs')
-rw-r--r--utils/hpc/HpcUtils.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/utils/hpc/HpcUtils.hs b/utils/hpc/HpcUtils.hs
index 5655f837f3..73d9cd3a87 100644
--- a/utils/hpc/HpcUtils.hs
+++ b/utils/hpc/HpcUtils.hs
@@ -3,6 +3,10 @@ module HpcUtils where
import Trace.Hpc.Util
import qualified Data.Map as Map
+dropWhileEndLE :: (a -> Bool) -> [a] -> [a]
+-- Spec: dropWhileEndLE p = reverse . dropWhileEnd . reverse
+dropWhileEndLE p = foldr (\x r -> if null r && p x then [] else x:r) []
+
-- turns \n into ' '
-- | grab's the text behind a HpcPos;
grabHpcPos :: Map.Map Int String -> HpcPos -> String