diff options
author | Thomas Miedema <thomasmiedema@gmail.com> | 2014-09-23 08:44:02 -0500 |
---|---|---|
committer | Austin Seipp <austin@well-typed.com> | 2014-09-23 08:44:03 -0500 |
commit | 2a743bbddd4de41a77af9b83ec4720cd013292cf (patch) | |
tree | 71cbb04c5c50e50bde9ad30eb3eb50e70a0ed9ee /compiler | |
parent | 01906c7399301e4f69959ecbd3b0d8bee5d5ef70 (diff) | |
download | haskell-2a743bbddd4de41a77af9b83ec4720cd013292cf.tar.gz |
Delete hack when takeDirectory returns ""
Summary:
Since commits 8fe1f8 and bb6731 in the filepath packages (ticket #2034, closed
in 2010), takeDirectory "foo" returns ".", and not "", so this check is no
longer needed.
Other commits:
* Remove trailing whitespace
* Update comments for #2278
Test Plan: harbormaster
Reviewers: austin
Reviewed By: austin
Subscribers: simonmar, ezyang, carter
Differential Revision: https://phabricator.haskell.org/D213
GHC Trac Issues: #2034
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/utils/Util.lhs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/compiler/utils/Util.lhs b/compiler/utils/Util.lhs index 97bafe6f23..999eb90c33 100644 --- a/compiler/utils/Util.lhs +++ b/compiler/utils/Util.lhs @@ -262,7 +262,7 @@ splitEithers (e : es) = case e of chkAppend :: [a] -> [a] -> [a] -- Checks for the second arguemnt being empty -- Used in situations where that situation is common -chkAppend xs ys +chkAppend xs ys | null ys = xs | otherwise = xs ++ ys \end{code} @@ -589,7 +589,7 @@ dropTail :: Int -> [a] -> [a] dropTail n xs = go (drop n xs) xs where - go (_:ys) (x:xs) = x : go ys xs + go (_:ys) (x:xs) = x : go ys xs go _ _ = [] -- Stop when ys runs out -- It'll always run out before xs does @@ -950,9 +950,7 @@ maybeReadFuzzy str = case reads str of -- Verify that the 'dirname' portion of a FilePath exists. -- doesDirNameExist :: FilePath -> IO Bool -doesDirNameExist fpath = case takeDirectory fpath of - "" -> return True -- XXX Hack - _ -> doesDirectoryExist (takeDirectory fpath) +doesDirNameExist fpath = doesDirectoryExist (takeDirectory fpath) ----------------------------------------------------------------------------- -- Backwards compatibility definition of getModificationTime |