P      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~     SafeACeThis class allows selective behaviour for file and directory paths and is mostly for internal use.E*Will become a top-level function in futureFhThis class allows selective behaviour for absolute and relative paths and is mostly for internal use.GSee  /https://wiki.haskell.org/Closed_world_instances for the used technique.H*Will become a top-level function in futureJThis class provides a way to prevent other modules from making further F or C instancesQ+This is the main filepath abstract datatypeV$Map over the components of the path. g> Posix.pathMap (map toLower) "/tmp/Reports/SpreadSheets" == Posix.asAbsDir "/tmp/reports/spreadsheets"Currently not exportedCurrently not exportedW Convert the Q into a plain  as required for OS calls.ZUse a  as a Q, whose type is determined by its context. 1> Posix.asPath "/tmp" == Posix.asAbsDir "/tmp" > Posix.asPath "file.txt" == Posix.asRelFile "file.txt" > Posix.isAbsolute (Posix.asAbsDir "/tmp") > Posix.isRelative (Posix.asRelDir "/tmp") > Posix.getPathString (Posix.asPath "/tmp" :: Posix.AbsDir) == "/tmp" > Posix.getPathString (Posix.asPath "/tmp" :: Posix.RelDir) == "tmp" > Windows.getPathString (Windows.asPath "\\tmp" :: Windows.AbsDir) == "\\tmp" > Windows.getPathString (Windows.asPath "a:\\tmp" :: Windows.AbsDir) == "a:\\tmp" > Windows.getPathString (Windows.asPath "tmp" :: Windows.RelDir) == "tmp"[Use a  as a O. No checking is done. > Posix.getPathString (Posix.asRelFile "file.txt") == "file.txt" > Posix.getPathString (Posix.asRelFile "/file.txt") == "file.txt" > Posix.getPathString (Posix.asRelFile "tmp") == "tmp" > Posix.getPathString (Posix.asRelFile "/tmp") == "tmp"\Use a  as a M. No checking is done. > Posix.getPathString (Posix.asRelDir ".") == "." > Posix.getPathString (Posix.asRelDir "file.txt") == "file.txt" > Posix.getPathString (Posix.asRelDir "/file.txt") == "file.txt" > Posix.getPathString (Posix.asRelDir "tmp") == "tmp" > Posix.getPathString (Posix.asRelDir "/tmp") == "tmp"]Use a  as an P. No checking is done. > Posix.getPathString (Posix.asAbsFile "file.txt") == "/file.txt" > Posix.getPathString (Posix.asAbsFile "/file.txt") == "/file.txt" > Posix.getPathString (Posix.asAbsFile "tmp") == "/tmp" > Posix.getPathString (Posix.asAbsFile "/tmp") == "/tmp"^Use a  as an N. No checking is done. > Posix.getPathString (Posix.asAbsDir "file.txt") == "/file.txt" > Posix.getPathString (Posix.asAbsDir "/file.txt") == "/file.txt" > Posix.getPathString (Posix.asAbsDir "tmp") == "/tmp" > Posix.getPathString (Posix.asAbsDir "/tmp") == "/tmp"_Use a ( as a 'RelPath fd'. No checking is done.`Use a ) as an 'AbsPath fd'. No checking is done.aUse a ) as a 'FilePath ar'. No checking is done.bUse a ( as a 'DirPath ar'. No checking is done.cYExamines the supplied string and constructs an absolute or relative path as appropriate. H> Posix.mkPathAbsOrRel "/tmp" == Left (Posix.asAbsDir "/tmp") > Posix.mkPathAbsOrRel "tmp" == Right (Posix.asRelDir "tmp") > Windows.mkPathAbsOrRel "\\tmp" == Left (Windows.asAbsDir "\\tmp") > Windows.mkPathAbsOrRel "d:\\tmp" == Left (Windows.asAbsDir "d:\\tmp") > Windows.mkPathAbsOrRel "tmp" == Right (Windows.asRelDir "tmp")dPSearches for a file or directory with the supplied path string and returns a S or RA path as appropriate. If neither exists at the supplied path,  is returned.e Convert a  into an LJ by interpreting it as relative to the supplied directory if necessary. > Posix.mkAbsPath "/tmp" "foo.txt" == Posix.asAbsFile "/tmp/foo.txt" > Posix.mkAbsPath "/tmp" "/etc/foo.txt" == Posix.asAbsFile "/etc/foo.txt"f Convert a  into an L; by interpreting it as relative to the cwd if necessary.gInfix variant of j.  > Posix.getPathString (Posix.asAbsDir "/tmp" </> Posix.asRelFile "file.txt") == "/tmp/file.txt" > Posix.getPathString (Posix.asAbsDir "/tmp" </> Posix.asRelDir "dir" </> Posix.asRelFile "file.txt") == "/tmp/dir/file.txt" > Posix.getPathString (Posix.asRelDir "dir" </> Posix.asRelFile "file.txt") == "dir/file.txt" > Windows.getPathString (Windows.asAbsDir "\\tmp" Windows.</> Windows.asRelFile "file.txt") == "\\tmp\\file.txt" > Windows.getPathString (Windows.asAbsDir "c:\\tmp" Windows.</> Windows.asRelFile "file.txt") == "c:\\tmp\\file.txt" > Windows.getPathString (Windows.asAbsDir "c:" Windows.</> Windows.asRelDir "tmp" Windows.</> Windows.asRelFile "file.txt") == "c:\\tmp\\file.txt" > Windows.getPathString (Windows.asRelDir "dir" Windows.</> Windows.asRelFile "file.txt") == "dir\\file.txt"hInfix variant of is. We only allow files (and not directories) to have extensions added by this function. This is because it's the vastly common case and an attempt to add one to a directory will - more often than not - represent an error. We don't however want to prevent the corresponding operation on directories, and so we provide a function that is more flexible: .i>Add an extension, even if there is already one there. E.g. -addExtension "foo.txt" "bat" -> "foo.txt.bat". > Posix.addExtension (Posix.asRelFile "file.txt") "bib" == "file.txt.bib" > Posix.addExtension (Posix.asRelFile "file.") ".bib" == "file..bib" > Posix.addExtension (Posix.asRelFile "file") ".bib" == "file.bib" > Posix.addExtension (Posix.asRelFile "") "bib" == ".bib" > Posix.addExtension (Posix.asRelFile "") ".bib" == ".bib" > Posix.takeFileName (Posix.addExtension (Posix.asRelFile "") "ext") == ".ext"jmJoin an (absolute or relative) directory path with a relative (file or directory) path to form a new path.k0Remove last extension, and the "." preceding it. 7> Posix.dropExtension x == fst (Posix.splitExtension x)lDrop all extensions 5> not $ Posix.hasAnExtension (Posix.dropExtensions x)m Synonym for vn@Set the extension of a file, overwriting one if already present. r> Posix.replaceExtension (Posix.asRelFile "file.txt") ".bob" == "file.bob" > Posix.replaceExtension (Posix.asRelFile "file.txt") "bob" == "file.bob" > Posix.replaceExtension (Posix.asRelFile "file") ".bob" == "file.bob" > Posix.replaceExtension (Posix.asRelFile "file.txt") "" == "file" > Posix.replaceExtension (Posix.asRelFile "file.fred.bob") "txt" == "file.fred.txt"rSplit on the extension. i is the inverse. P> uncurry (<.>) (Posix.splitExtension x) == x > uncurry Posix.addExtension (Posix.splitExtension x) == x > Posix.splitExtension (Posix.asRelFile "file.txt") == ("file",".txt") > Posix.splitExtension (Posix.asRelFile "file") == ("file","") > Posix.splitExtension (Posix.asRelFile "file/file.txt") == ("file/file",".txt") > Posix.splitExtension (Posix.asRelFile "file.txt/boris") == ("file.txt/boris","") > Posix.splitExtension (Posix.asRelFile "file.txt/boris.ext") == ("file.txt/boris",".ext") > Posix.splitExtension (Posix.asRelFile "file/path.txt.bob.fred") == ("file/path.txt.bob",".fred")sSplit on all extensions M> Posix.splitExtensions (Posix.asRelFile "file.tar.gz") == ("file",".tar.gz")uGet the basename of a file > Posix.takeBaseName (Posix.asAbsFile "/tmp/somedir/myfile.txt") == "myfile" > Posix.takeBaseName (Posix.asRelFile "./myfile.txt") == "myfile" > Posix.takeBaseName (Posix.asRelFile "myfile.txt") == "myfile"w%Get the extension of a file, returns "" for no extension, .ext otherwise. > Posix.takeExtension x == snd (Posix.splitExtension x) > Posix.takeExtension (Posix.addExtension x "ext") == ".ext" > Posix.takeExtension (Posix.replaceExtension x "ext") == ".ext"xGet all extensions C> Posix.takeExtensions (Posix.asRelFile "file.tar.gz") == ".tar.gz"yHGet the filename component of a file path (ie stripping all parent dirs) > Posix.takeFileName (Posix.asAbsFile "/tmp/somedir/myfile.txt") == "myfile.txt" > Posix.takeFileName (Posix.asRelFile "./myfile.txt") == "myfile.txt" > Posix.takeFileName (Posix.asRelFile "myfile.txt") == "myfile.txt"z2Check whether two strings are equal as file paths. > Posix.equalFilePath "/tmp/" "/tmp" > not $ Posix.equalFilePath "/tmp" "tmp" > Windows.equalFilePath "file" "File" > not $ Windows.equalFilePath "file" "dir"{ Constructs a K from a list of components. It is an unchecked error if the path components contain path separators. It is an unchecked error if a O path is empty. > Posix.joinPath ["tmp","someDir","dir"] == Posix.asRelDir "tmp/someDir/dir" > Posix.joinPath ["tmp","someDir","file.txt"] == Posix.asRelFile "tmp/someDir/file.txt"|Currently just transforms: R> Posix.normalise "/tmp/fred/./jim/./file" == Posix.asAbsFile "/tmp/fred/jim/file"}(Deconstructs a path into its components. > Posix.splitPath (Posix.asAbsDir "/tmp/someDir/mydir.dir") == (True, ["tmp","someDir","mydir.dir"], Nothing) > Posix.splitPath (Posix.asAbsFile "/tmp/someDir/myfile.txt") == (True, ["tmp","someDir"], Just "myfile.txt")~SThis function can be used to construct a relative path by removing the supplied N! from the front. It is a runtime  if the supplied L doesn't start with the N. > Posix.makeRelative "/tmp/somedir" "/tmp/somedir/anotherdir/file.txt" == Posix.asRelFile "anotherdir/file.txt" > Posix.makeRelative "/tmp/somedir" "/tmp/somedir/anotherdir/dir" == Posix.asRelDir "anotherdir/dir" > Windows.makeRelative "c:\\tmp\\somedir" "c:\\Tmp\\SomeDir\\AnotherDir\\File.txt" == Windows.asRelFile "AnotherDir\\File.txt" > Windows.makeRelative "c:\\tmp\\somedir" "c:\\tmp\\somedir\\anotherdir\\dir" == Windows.asRelDir "anotherdir\\dir"UJoins an absolute directory with a relative path to construct a new absolute path. > Posix.makeAbsolute "/tmp" "file.txt" == Posix.asAbsFile "/tmp/file.txt" > Posix.makeAbsolute "/tmp" "adir/file.txt" == Posix.asAbsFile "/tmp/adir/file.txt" > Posix.makeAbsolute "/tmp" "adir/dir" == Posix.asAbsDir "/tmp/adir/dir"]Converts a relative path into an absolute one by prepending the current working directory.As for \, but for use when the path may already be absolute (in which case it is left unchanged). j> Posix.genericMakeAbsolute "/tmp" (Posix.asRelFile "file.txt") == "/tmp/file.txt" > Posix.genericMakeAbsolute "/tmp" (Posix.asRelFile "adir/file.txt") == "/tmp/adir/file.txt" > Posix.genericMakeAbsolute "/tmp" (Posix.asAbsFile "adir/file.txt") == "/adir/file.txt" > Posix.genericMakeAbsolute "/tmp" (Posix.asAbsFile "/adir/file.txt") == "/adir/file.txt"As for \, but for use when the path may already be absolute (in which case it is left unchanged).Test whether a Q ar fd is absolute. > Posix.isAbsolute (Posix.asAbsFile "fred") > Posix.isAbsolute (Posix.asAbsFile "/fred") > Windows.isAbsolute (Windows.asAbsFile "\\fred") > Windows.isAbsolute (Windows.asAbsFile "c:\\fred")Test whether the = would correspond to an absolute path if interpreted as a Q.7Invariant - this should return True iff arg is of type Q Rel _  isRelative = not . isAbsolute > Posix.isRelative (Posix.asRelFile "fred") > Posix.isRelative (Posix.asRelFile "/fred") > Windows.isRelative (Windows.asRelFile "fred")Test whether the < would correspond to a relative path if interpreted as a Q. )isRelativeString = not . isAbsoluteString*Does the given filename have an extension? >> null (Posix.takeExtension x) == not (Posix.hasAnExtension x)1Does the given filename have the given extension? > Posix.hasExtension ".hs" (Posix.asRelFile "MyCode.hs") > Posix.hasExtension ".hs" (Posix.asRelFile "MyCode.bak.hs") > not $ Posix.hasExtension ".hs" (Posix.asRelFile "MyCode.hs.bak")This is largely for  compatabilityThis is largely for  compatabilityFile extension character > Posix.extSeparator == '.'This is largely for  compatabilitydThe character that separates directories. In the case where more than one character is possible,  is the 'ideal' one. +> Posix.isPathSeparator Posix.pathSeparator$The list of all possible separators. 1> Posix.pathSeparator `elem` Posix.pathSeparatorsUThe character that is used to separate the entries in the $PATH environment variable.(Is the character an extension character? 5> Posix.isExtSeparator a == (a == Posix.extSeparator)Rather than using (== )5, use this. Test if something is a path separator. <> Posix.isPathSeparator a == (a `elem` Posix.pathSeparators)"Is the character a file separator? C> Posix.isSearchPathSeparator a == (a == Posix.searchPathSeparator)#This is a more flexible variant of i / h, which can work with files or directories > Posix.genericAddExtension "/" "x" == Posix.asAbsDir "/.x" > Posix.genericAddExtension "/a" "x" == Posix.asAbsDir "/a.x" > Posix.genericAddExtension "" "x" == Posix.asRelFile ".x" > Posix.genericAddExtension "" "" == Posix.asRelFile "")Allow use of OverloadedStrings if desired !"#$%&'()*+,-./0CDE123FGH456789IJKLMNOP:;<=>?@ABCDQERFSGTHUIJKLVMNOWPQRSXYTUVWZX[\]^_`abcdefYZ[\]^_`abghijklmnopqrsctduvwxyez{|}fg~hijklmnopqrstuvwxyz{|}~WCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~WQUTSRPONMLKJIFGHCDEWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~V !"#$%&'()*+,-./0CDE123FGH456789IJKLMNOP:;<=>?@ABCDQERFSGTHUIJKLVMNOWPQRSXYTUVWZX[\]^_`abcdefYZ[\]^_`abghijklmnopqrsctduvwxyez{|}fg~hijklmnopqrstuvwxyz{|}~SafeSafeAeThis class allows selective behaviour for file and directory paths and is mostly for internal use.*Will become a top-level function in futurehThis class allows selective behaviour for absolute and relative paths and is mostly for internal use.See  /https://wiki.haskell.org/Closed_world_instances for the used technique.*Will become a top-level function in futureJThis class provides a way to prevent other modules from making further  or  instances+This is the main filepath abstract datatype$Map over the components of the path. g> Posix.pathMap (map toLower) "/tmp/Reports/SpreadSheets" == Posix.asAbsDir "/tmp/reports/spreadsheets"Currently not exportedCurrently not exported Convert the  into a plain  as required for OS calls.Use a  as a , whose type is determined by its context. 1> Posix.asPath "/tmp" == Posix.asAbsDir "/tmp" > Posix.asPath "file.txt" == Posix.asRelFile "file.txt" > Posix.isAbsolute (Posix.asAbsDir "/tmp") > Posix.isRelative (Posix.asRelDir "/tmp") > Posix.getPathString (Posix.asPath "/tmp" :: Posix.AbsDir) == "/tmp" > Posix.getPathString (Posix.asPath "/tmp" :: Posix.RelDir) == "tmp" > Windows.getPathString (Windows.asPath "\\tmp" :: Windows.AbsDir) == "\\tmp" > Windows.getPathString (Windows.asPath "a:\\tmp" :: Windows.AbsDir) == "a:\\tmp" > Windows.getPathString (Windows.asPath "tmp" :: Windows.RelDir) == "tmp"Use a  as a . No checking is done. > Posix.getPathString (Posix.asRelFile "file.txt") == "file.txt" > Posix.getPathString (Posix.asRelFile "/file.txt") == "file.txt" > Posix.getPathString (Posix.asRelFile "tmp") == "tmp" > Posix.getPathString (Posix.asRelFile "/tmp") == "tmp"Use a  as a . No checking is done. > Posix.getPathString (Posix.asRelDir ".") == "." > Posix.getPathString (Posix.asRelDir "file.txt") == "file.txt" > Posix.getPathString (Posix.asRelDir "/file.txt") == "file.txt" > Posix.getPathString (Posix.asRelDir "tmp") == "tmp" > Posix.getPathString (Posix.asRelDir "/tmp") == "tmp"Use a  as an . No checking is done. > Posix.getPathString (Posix.asAbsFile "file.txt") == "/file.txt" > Posix.getPathString (Posix.asAbsFile "/file.txt") == "/file.txt" > Posix.getPathString (Posix.asAbsFile "tmp") == "/tmp" > Posix.getPathString (Posix.asAbsFile "/tmp") == "/tmp"Use a  as an . No checking is done. > Posix.getPathString (Posix.asAbsDir "file.txt") == "/file.txt" > Posix.getPathString (Posix.asAbsDir "/file.txt") == "/file.txt" > Posix.getPathString (Posix.asAbsDir "tmp") == "/tmp" > Posix.getPathString (Posix.asAbsDir "/tmp") == "/tmp"Use a ( as a 'RelPath fd'. No checking is done.Use a ) as an 'AbsPath fd'. No checking is done.Use a ) as a 'FilePath ar'. No checking is done.Use a ( as a 'DirPath ar'. No checking is done.YExamines the supplied string and constructs an absolute or relative path as appropriate. H> Posix.mkPathAbsOrRel "/tmp" == Left (Posix.asAbsDir "/tmp") > Posix.mkPathAbsOrRel "tmp" == Right (Posix.asRelDir "tmp") > Windows.mkPathAbsOrRel "\\tmp" == Left (Windows.asAbsDir "\\tmp") > Windows.mkPathAbsOrRel "d:\\tmp" == Left (Windows.asAbsDir "d:\\tmp") > Windows.mkPathAbsOrRel "tmp" == Right (Windows.asRelDir "tmp")PSearches for a file or directory with the supplied path string and returns a  or A path as appropriate. If neither exists at the supplied path,  is returned. Convert a  into an J by interpreting it as relative to the supplied directory if necessary. > Posix.mkAbsPath "/tmp" "foo.txt" == Posix.asAbsFile "/tmp/foo.txt" > Posix.mkAbsPath "/tmp" "/etc/foo.txt" == Posix.asAbsFile "/etc/foo.txt" Convert a  into an ; by interpreting it as relative to the cwd if necessary.Infix variant of .  > Posix.getPathString (Posix.asAbsDir "/tmp" </> Posix.asRelFile "file.txt") == "/tmp/file.txt" > Posix.getPathString (Posix.asAbsDir "/tmp" </> Posix.asRelDir "dir" </> Posix.asRelFile "file.txt") == "/tmp/dir/file.txt" > Posix.getPathString (Posix.asRelDir "dir" </> Posix.asRelFile "file.txt") == "dir/file.txt" > Windows.getPathString (Windows.asAbsDir "\\tmp" Windows.</> Windows.asRelFile "file.txt") == "\\tmp\\file.txt" > Windows.getPathString (Windows.asAbsDir "c:\\tmp" Windows.</> Windows.asRelFile "file.txt") == "c:\\tmp\\file.txt" > Windows.getPathString (Windows.asAbsDir "c:" Windows.</> Windows.asRelDir "tmp" Windows.</> Windows.asRelFile "file.txt") == "c:\\tmp\\file.txt" > Windows.getPathString (Windows.asRelDir "dir" Windows.</> Windows.asRelFile "file.txt") == "dir\\file.txt"Infix variant of s. We only allow files (and not directories) to have extensions added by this function. This is because it's the vastly common case and an attempt to add one to a directory will - more often than not - represent an error. We don't however want to prevent the corresponding operation on directories, and so we provide a function that is more flexible: .>Add an extension, even if there is already one there. E.g. -addExtension "foo.txt" "bat" -> "foo.txt.bat". > Posix.addExtension (Posix.asRelFile "file.txt") "bib" == "file.txt.bib" > Posix.addExtension (Posix.asRelFile "file.") ".bib" == "file..bib" > Posix.addExtension (Posix.asRelFile "file") ".bib" == "file.bib" > Posix.addExtension (Posix.asRelFile "") "bib" == ".bib" > Posix.addExtension (Posix.asRelFile "") ".bib" == ".bib" > Posix.takeFileName (Posix.addExtension (Posix.asRelFile "") "ext") == ".ext"mJoin an (absolute or relative) directory path with a relative (file or directory) path to form a new path.0Remove last extension, and the "." preceding it. 7> Posix.dropExtension x == fst (Posix.splitExtension x)Drop all extensions 5> not $ Posix.hasAnExtension (Posix.dropExtensions x) Synonym for @Set the extension of a file, overwriting one if already present. r> Posix.replaceExtension (Posix.asRelFile "file.txt") ".bob" == "file.bob" > Posix.replaceExtension (Posix.asRelFile "file.txt") "bob" == "file.bob" > Posix.replaceExtension (Posix.asRelFile "file") ".bob" == "file.bob" > Posix.replaceExtension (Posix.asRelFile "file.txt") "" == "file" > Posix.replaceExtension (Posix.asRelFile "file.fred.bob") "txt" == "file.fred.txt"Split on the extension.  is the inverse. P> uncurry (<.>) (Posix.splitExtension x) == x > uncurry Posix.addExtension (Posix.splitExtension x) == x > Posix.splitExtension (Posix.asRelFile "file.txt") == ("file",".txt") > Posix.splitExtension (Posix.asRelFile "file") == ("file","") > Posix.splitExtension (Posix.asRelFile "file/file.txt") == ("file/file",".txt") > Posix.splitExtension (Posix.asRelFile "file.txt/boris") == ("file.txt/boris","") > Posix.splitExtension (Posix.asRelFile "file.txt/boris.ext") == ("file.txt/boris",".ext") > Posix.splitExtension (Posix.asRelFile "file/path.txt.bob.fred") == ("file/path.txt.bob",".fred")Split on all extensions M> Posix.splitExtensions (Posix.asRelFile "file.tar.gz") == ("file",".tar.gz")Get the basename of a file > Posix.takeBaseName (Posix.asAbsFile "/tmp/somedir/myfile.txt") == "myfile" > Posix.takeBaseName (Posix.asRelFile "./myfile.txt") == "myfile" > Posix.takeBaseName (Posix.asRelFile "myfile.txt") == "myfile"%Get the extension of a file, returns "" for no extension, .ext otherwise. > Posix.takeExtension x == snd (Posix.splitExtension x) > Posix.takeExtension (Posix.addExtension x "ext") == ".ext" > Posix.takeExtension (Posix.replaceExtension x "ext") == ".ext"Get all extensions C> Posix.takeExtensions (Posix.asRelFile "file.tar.gz") == ".tar.gz"HGet the filename component of a file path (ie stripping all parent dirs) > Posix.takeFileName (Posix.asAbsFile "/tmp/somedir/myfile.txt") == "myfile.txt" > Posix.takeFileName (Posix.asRelFile "./myfile.txt") == "myfile.txt" > Posix.takeFileName (Posix.asRelFile "myfile.txt") == "myfile.txt"2Check whether two strings are equal as file paths. > Posix.equalFilePath "/tmp/" "/tmp" > not $ Posix.equalFilePath "/tmp" "tmp" > Windows.equalFilePath "file" "File" > not $ Windows.equalFilePath "file" "dir" Constructs a  from a list of components. It is an unchecked error if the path components contain path separators. It is an unchecked error if a  path is empty. > Posix.joinPath ["tmp","someDir","dir"] == Posix.asRelDir "tmp/someDir/dir" > Posix.joinPath ["tmp","someDir","file.txt"] == Posix.asRelFile "tmp/someDir/file.txt"Currently just transforms: R> Posix.normalise "/tmp/fred/./jim/./file" == Posix.asAbsFile "/tmp/fred/jim/file"(Deconstructs a path into its components. > Posix.splitPath (Posix.asAbsDir "/tmp/someDir/mydir.dir") == (True, ["tmp","someDir","mydir.dir"], Nothing) > Posix.splitPath (Posix.asAbsFile "/tmp/someDir/myfile.txt") == (True, ["tmp","someDir"], Just "myfile.txt")SThis function can be used to construct a relative path by removing the supplied ! from the front. It is a runtime  if the supplied  doesn't start with the . > Posix.makeRelative "/tmp/somedir" "/tmp/somedir/anotherdir/file.txt" == Posix.asRelFile "anotherdir/file.txt" > Posix.makeRelative "/tmp/somedir" "/tmp/somedir/anotherdir/dir" == Posix.asRelDir "anotherdir/dir" > Windows.makeRelative "c:\\tmp\\somedir" "c:\\Tmp\\SomeDir\\AnotherDir\\File.txt" == Windows.asRelFile "AnotherDir\\File.txt" > Windows.makeRelative "c:\\tmp\\somedir" "c:\\tmp\\somedir\\anotherdir\\dir" == Windows.asRelDir "anotherdir\\dir"UJoins an absolute directory with a relative path to construct a new absolute path. > Posix.makeAbsolute "/tmp" "file.txt" == Posix.asAbsFile "/tmp/file.txt" > Posix.makeAbsolute "/tmp" "adir/file.txt" == Posix.asAbsFile "/tmp/adir/file.txt" > Posix.makeAbsolute "/tmp" "adir/dir" == Posix.asAbsDir "/tmp/adir/dir"]Converts a relative path into an absolute one by prepending the current working directory.As for \, but for use when the path may already be absolute (in which case it is left unchanged). j> Posix.genericMakeAbsolute "/tmp" (Posix.asRelFile "file.txt") == "/tmp/file.txt" > Posix.genericMakeAbsolute "/tmp" (Posix.asRelFile "adir/file.txt") == "/tmp/adir/file.txt" > Posix.genericMakeAbsolute "/tmp" (Posix.asAbsFile "adir/file.txt") == "/adir/file.txt" > Posix.genericMakeAbsolute "/tmp" (Posix.asAbsFile "/adir/file.txt") == "/adir/file.txt"As for \, but for use when the path may already be absolute (in which case it is left unchanged).Test whether a  ar fd is absolute. > Posix.isAbsolute (Posix.asAbsFile "fred") > Posix.isAbsolute (Posix.asAbsFile "/fred") > Windows.isAbsolute (Windows.asAbsFile "\\fred") > Windows.isAbsolute (Windows.asAbsFile "c:\\fred")Test whether the = would correspond to an absolute path if interpreted as a .7Invariant - this should return True iff arg is of type  Rel _  isRelative = not . isAbsolute > Posix.isRelative (Posix.asRelFile "fred") > Posix.isRelative (Posix.asRelFile "/fred") > Windows.isRelative (Windows.asRelFile "fred")Test whether the < would correspond to a relative path if interpreted as a . )isRelativeString = not . isAbsoluteString*Does the given filename have an extension? >> null (Posix.takeExtension x) == not (Posix.hasAnExtension x)1Does the given filename have the given extension? > Posix.hasExtension ".hs" (Posix.asRelFile "MyCode.hs") > Posix.hasExtension ".hs" (Posix.asRelFile "MyCode.bak.hs") > not $ Posix.hasExtension ".hs" (Posix.asRelFile "MyCode.hs.bak")This is largely for  compatabilityThis is largely for  compatabilityFile extension character > Posix.extSeparator == '.'This is largely for  compatabilitydThe character that separates directories. In the case where more than one character is possible,  is the 'ideal' one. +> Posix.isPathSeparator Posix.pathSeparator$The list of all possible separators. 1> Posix.pathSeparator `elem` Posix.pathSeparatorsUThe character that is used to separate the entries in the $PATH environment variable.(Is the character an extension character? 5> Posix.isExtSeparator a == (a == Posix.extSeparator)Rather than using (== )5, use this. Test if something is a path separator. <> Posix.isPathSeparator a == (a `elem` Posix.pathSeparators)"Is the character a file separator? C> Posix.isSearchPathSeparator a == (a == Posix.searchPathSeparator)#This is a more flexible variant of  / , which can work with files or directories > Posix.genericAddExtension "/" "x" == Posix.asAbsDir "/.x" > Posix.genericAddExtension "/a" "x" == Posix.asAbsDir "/a.x" > Posix.genericAddExtension "" "x" == Posix.asRelFile ".x" > Posix.genericAddExtension "" "" == Posix.asRelFile "")Allow use of OverloadedStrings if desiredWWSafeWSafe An alias for .SRetrieve the contents of a directory path (which may be relative) as absolute pathsReturns paths relative toX the supplied (abs or relative) directory path. eg (for current working directory of /somewhere/cwd/): show (relDirectoryContents "d/e/f/") == (["subDir1A","subDir1B"], ["file1A","file1B"])A convenient alternative to  if you only want files.A convenient alternative to  if you only want directories.   B   B      Safe   K  !"#$%&'()*+,-./0123456789:;<=>?@A  K  876543&%$#=<;:!9 'A@?>210"/.-, +)*(                     !" !# !$ !% !& !' !( !) !* !+ !, !- !. !/ !0 !1 !2 !3 !4 !5 !6 !7 89 8: 8; 8< 8= 8> 8? 8@ 8A 8B 8C DE DF DG DH DI J !K L M N O PQ PR PS PTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~XYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~   efghi      !"#$%&'()*+,-./0123456789:;<efghi      !"#$%&'()*+,-./0123456789:;=patht_BLp6Dvnd35ZGbpHBNDJ2UmSystem.Path.IOSystem.Path.DirectorySystem.Path.WindowsSystem.Path.PosixSystemFilePathSystem.Path.ModificationTime System.Pathbase System.IOprintghc-prim GHC.TypesIOGHC.IO.Handle.TypesHandlefixIOhPrinthReadyreadIOreadLninteract getContentsgetLinegetCharputStrLnputStrputCharGHC.IO.Handle.FDisEOFstderrstdin GHC.IO.HandlehShowhSetBinaryModehIsTerminalDevicehGetEchohSetEcho hIsSeekable hGetBuffering hIsWritable hIsReadable hIsClosedhIsOpenhTellhSeekhSetPosnhGetPosn hSetBuffering hLookAheadhIsEOF hSetFileSize hFileSizehClose HandlePosnGHC.IO.Handle.TexthGetBufNonBlockinghGetBufhPutBufNonBlockinghPutBuf hPutStrLnhPutStrhPutChar hGetContentshGetLinehGetChar hWaitForInput GHC.IO.IOMode ReadWriteMode AppendMode WriteModeReadModeIOModestdouthFlushBlockBuffering LineBuffering NoBuffering BufferMode GHC.IO.Device SeekFromEnd RelativeSeek AbsoluteSeekSeekModedirec_KowvXytSqazBcvN7MGpFtgSystem.Directory Permissions FileDirClass switchFileDirfileDir AbsRelClass switchAbsRelabsRelDirPathRelPathAbsPathRelDirAbsDirRelFileAbsFilePathDirFileRelAbspathMap getPathStringrootDir currentDirasPath asRelFileasRelDir asAbsFileasAbsDir asRelPath asAbsPath asFilePath asDirPathmkPathAbsOrRelmkPathFileOrDir mkAbsPathmkAbsPathFromCwd<.> addExtensioncombine dropExtensiondropExtensions dropFileNamereplaceExtensionreplaceBaseNamereplaceDirectoryreplaceFileNamesplitExtensionsplitExtensions splitFileName takeBaseName takeDirectory takeExtensiontakeExtensions takeFileName equalFilePathjoinPath normalise splitPath makeRelative makeAbsolutemakeAbsoluteFromCwdgenericMakeAbsolutegenericMakeAbsoluteFromCwd isAbsoluteisAbsoluteString isRelativeisRelativeStringhasAnExtension hasExtensionaddTrailingPathSeparatordropTrailingPathSeparator extSeparatorhasTrailingPathSeparator pathSeparatorpathSeparatorssearchPathSeparatorisExtSeparatorisPathSeparatorisSearchPathSeparatorgenericAddExtensiongenericDropExtensiongenericDropExtensionsgenericSplitExtensiongenericSplitExtensionsgenericTakeExtensiongenericTakeExtensionscreateDirectorycreateDirectoryIfMissingremoveDirectoryremoveDirectoryRecursiverenameDirectorygetDirectoryContentsabsDirectoryContentsrelDirectoryContents filesInDir dirsInDirgetCurrentDirectorysetCurrentDirectorygetHomeDirectorygetAppUserDataDirectorygetUserDocumentsDirectorygetTemporaryDirectory removeFile renameFilecopyFilecanonicalizePathmakeRelativeToCurrentDirectoryfindExecutable doesFileExistdoesDirectoryExistgetPermissionssetPermissionsgetModificationTimewithFileopenFilereadFile writeFile appendFilewithBinaryFileopenBinaryFile openTempFileopenBinaryTempFilePrivate _pathAbsRel _pathFileDirGHC.BaseStringNothingGHC.Errerror$fIsStringPathSplitExtensionrunSplitExtension AddExtensionrunAddExtension SplitDrive runSplitDrive FunctorPathgetFunctorPath AbsRelDefaultgetAbsRelDefaultReadsSplitDriverunReadsSplitDriveFileDir runFileDirAbsRel runAbsRelFDMaprunFDMapFuncArg runFuncArg PathComponentRelation runRelation WrapFileDir unwrapFileDir WrapAbsRel unwrapAbsRelswitchRelation absRelPlain fileDirPlainfdMappcMapreadsSplitDrivegetPathStringSprop_asPath_getPathStringisPosix isWindowsrootName currentNamecurrentDirComponent absDirName absRelDefaultmkPathFromComponentsmaybePathFromComponentsmkDirPathFromComponentsmkFilePathFromComponentsmkPathComponents splitDrivepathComponentsfileDirComponent(prop_mkPathFromComponents_pathComponentscombineOperatorprop_split_combineExtprop_split_combineprop_takeFileName_endisAbsolutePlain maybeFileDir prop_makeAbsoluteFromDir_endSame"prop_makeAbsoluteFromDir_startSamemapLast mapLastPairaddExtensionPCsplitExtensionPCsplitExtensionsPC_testallqcFileComponentqcDirComponent qcGenPath qcFilePath qcDirPathqcPath$fArbitraryPath$fArbitraryPathComponent $fReadPath $fShowPath$fFileDirClassDir$fFileDirClassFile$fAbsRelClassRel$fAbsRelClassAbs $fPrivateDir $fPrivateFile $fPrivateRel $fPrivateAbs $fNFDataPath $fNFDataDir $fNFDataFile $fNFDataRel $fNFDataAbs$fNFDataPathComponent$fOrdPathComponent$fEqPathComponent$fOrdWrapFileDir$fEqWrapFileDir$fOrdWrapAbsRel$fEqWrapAbsRel $fOrdPath$fEqPath convertTime