ghc-mod/Language/Haskell/GhcMod/Utils.hs

6 lines
216 B
Haskell
Raw Normal View History

2014-04-19 06:17:36 +00:00
module Language.Haskell.GhcMod.Utils where
2014-04-19 06:20:16 +00:00
-- 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) []