dropWhileEnd moves to Utils.

This commit is contained in:
Kazu Yamamoto
2014-04-19 15:20:16 +09:00
parent 82b6519935
commit 3c8fea85fb
2 changed files with 8 additions and 6 deletions

View File

@@ -1 +1,5 @@
module Language.Haskell.GhcMod.Utils where
-- dropWhileEnd is not provided prior to base 4.5.0.0.
dropWhileEnd :: (a -> Bool) -> [a] -> [a]
dropWhileEnd p = foldr (\x xs -> if p x && null xs then [] else x : xs) []