ghc-mod/Language/Haskell/GhcMod/Utils.hs
2014-04-22 11:28:27 +09:00

6 lines
216 B
Haskell

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) []