Skip to content

Commit 05bed83

Browse files
committed
Use dropWhileEnd from Data.List
1 parent bb0e5cd commit 05bed83

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

System/FilePath/Internal.hs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ import Data.String (fromString)
122122
import System.Environment(getEnv)
123123
import Prelude (String, map, FilePath, Eq, IO, id, last, init, reverse, dropWhile, null, break, takeWhile, take, all, elem, any, span)
124124
import Data.Char(toLower, toUpper, isAsciiLower, isAsciiUpper)
125-
import Data.List(stripPrefix, isSuffixOf, uncons)
125+
import Data.List(stripPrefix, isSuffixOf, uncons, dropWhileEnd)
126126
#define CHAR Char
127127
#define STRING String
128128
#define FILEPATH FilePath
@@ -1129,11 +1129,6 @@ isAbsolute = not . isRelative
11291129
#ifndef OS_PATH
11301130

11311131
-----------------------------------------------------------------------------
1132-
-- dropWhileEnd (>2) [1,2,3,4,1,2,3,4] == [1,2,3,4,1,2])
1133-
-- Note that Data.List.dropWhileEnd is only available in base >= 4.5.
1134-
dropWhileEnd :: (a -> Bool) -> [a] -> [a]
1135-
dropWhileEnd p = reverse . dropWhile p . reverse
1136-
11371132
-- takeWhileEnd (>2) [1,2,3,4,1,2,3,4] == [3,4])
11381133
takeWhileEnd :: (a -> Bool) -> [a] -> [a]
11391134
takeWhileEnd p = reverse . takeWhile p . reverse

0 commit comments

Comments
 (0)