hunk ./filepath.cabal 2 -Version: 1.1.0.3 +Version: 1.1.0.4 hunk ./filepath.cabal 20 - Build-Depends: base >= 3 && < 5 + Build-Depends: base >= 2 && < 5 hunk ./System/FilePath/Internal.hs 77 +import Data.List(isPrefixOf) hunk ./filepath.cabal 2 -Version: 1.1.0.4 +Version: 1.2.0.0 hunk ./System/FilePath/Internal.hs 518 + _ = isPrefixOf x -- warning suppression hunk ./System/FilePath/Internal.hs 205 - (a,b) = splitFileName x + (a,b) = splitFileName_ x hunk ./System/FilePath/Internal.hs 263 +-- > uncurry (++) (splitExtensions x) == x +-- > uncurry addExtension (splitExtensions x) == x hunk ./System/FilePath/Internal.hs 269 - (a,b) = splitFileName x + (a,b) = splitFileName_ x hunk ./System/FilePath/Internal.hs 410 --- > uncurry (++) (splitFileName x) == x --- > Valid x => uncurry combine (splitFileName x) == x +-- > Valid x => uncurry () (splitFileName x) == x || fst (splitFileName x) == "./" +-- > Valid x => isValid (fst (splitFileName x)) hunk ./System/FilePath/Internal.hs 414 --- > splitFileName "bob" == ("", "bob") +-- > splitFileName "bob" == ("./", "bob") hunk ./System/FilePath/Internal.hs 418 -splitFileName x = (c ++ reverse b, reverse a) +splitFileName x = (if null dir then "./" else dir, name) + where + (dir, name) = splitFileName_ x + +-- version of splitFileName where, if the FilePath has no directory +-- component, the returned directory is "" rather than "./". This +-- is used in cases where we are going to combine the returned +-- directory to make a valid FilePath, and having a "./" appear would +-- look strange and upset simple equality properties. See +-- e.g. replaceFileName. +splitFileName_ :: FilePath -> (String, String) +splitFileName_ x = (c ++ reverse b, reverse a) hunk ./System/FilePath/Internal.hs 434 - hunk ./System/FilePath/Internal.hs 438 -replaceFileName x y = dropFileName x y +replaceFileName x y = a y where (a,_) = splitFileName_ x hunk ./System/FilePath/Internal.hs 474 --- > replaceBaseName x (takeBaseName x) == x +-- > Valid x => replaceBaseName x (takeBaseName x) == x hunk ./System/FilePath/Internal.hs 478 - (a,b) = splitFileName pth + (a,b) = splitFileName_ pth hunk ./System/FilePath/Internal.hs 502 --- > not (hasTrailingPathSeparator (dropTrailingPathSeparator x)) || isDrive x +-- > Posix: not (hasTrailingPathSeparator (dropTrailingPathSeparator x)) || isDrive x hunk ./System/FilePath/Internal.hs 515 --- > takeDirectory x `isPrefixOf` x --- > takeDirectory "foo" == "" +-- > takeDirectory x `isPrefixOf` x || takeDirectory x == "." +-- > takeDirectory "foo" == "." hunk ./System/FilePath/Internal.hs 534 --- > replaceDirectory x (takeDirectory x) `equalFilePath` x +-- > Valid x => replaceDirectory x (takeDirectory x) `equalFilePath` x