!{      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyzSafeF{pathtypedThe character that separates directories. In the case where more than one character is possible, { is the 'ideal' one. +> Posix.isPathSeparator Posix.pathSeparator|pathtype$The list of all possible separators. 1> Posix.pathSeparator `elem` Posix.pathSeparators}pathtypeRather than using (== {)5, use this. Test if something is a path separator. <> Posix.isPathSeparator a == (a `elem` Posix.pathSeparators)~pathtype}We cannot have a PathComponent without phantom types plus a Tagged wrapper, because we need specialised Eq and Ord instances."C}|{~DEFGHI Safe#LpathtypeeThis class allows selective behaviour for file and directory paths and is mostly for internal use.PpathtypehThis class allows selective behaviour for absolute and relative paths and is mostly for internal use.QpathtypeSee  /https://wiki.haskell.org/Closed_world_instances for the used technique.pathtypeJThis class provides a way to prevent other modules from making further N or J instances%JKLMNOPQ Safej)Ogpathtype+This is the main filepath abstract datatypehpathtype$Map over the components of the path. m> Path.pathMap (map toLower) (absDir "/tmp/Reports/SpreadSheets") == Posix.absDir "/tmp/reports/spreadsheets"pathtypeCurrently not exportedpathtypeCurrently not exportedkpathtype Convert the g into a plain  as required for OS calls.lpathtype Synonym of k intended for unqualified use.opathtypeThis is a file with path ""O. You will not be able to create a file with this name. We also forbid parsing "" by ue. You might only need this file path as intermediate step when manipulating extensions of files like  ".bashrc".ppathtypeSThis function is intended for checking and parsing paths provided as user input. > fmap Posix.toString (Posix.maybePath "/" :: Maybe Posix.AbsDir) == Just "/" > fmap Posix.toString (Posix.maybePath "/" :: Maybe Posix.AbsFile) == Nothing > fmap Posix.toString (Posix.maybePath "/" :: Maybe Posix.RelDir) == Nothing > fmap Posix.toString (Posix.maybePath "/" :: Maybe Posix.RelFile) == Nothing > fmap Posix.toString (Posix.maybePath "/tmp" :: Maybe Posix.AbsDir) == Just "/tmp" > fmap Posix.toString (Posix.maybePath "/tmp" :: Maybe Posix.AbsFile) == Just "/tmp" > fmap Posix.toString (Posix.maybePath "/tmp" :: Maybe Posix.RelDir) == Nothing > fmap Posix.toString (Posix.maybePath "/tmp" :: Maybe Posix.RelFile) == Nothing > fmap Posix.toString (Posix.maybePath "/tmp/" :: Maybe Posix.AbsDir) == Just "/tmp" > fmap Posix.toString (Posix.maybePath "/tmp/" :: Maybe Posix.AbsFile) == Nothing > fmap Posix.toString (Posix.maybePath "/tmp/" :: Maybe Posix.RelDir) == Nothing > fmap Posix.toString (Posix.maybePath "/tmp/" :: Maybe Posix.RelFile) == Nothing > fmap Posix.toString (Posix.maybePath "/tmp" :: Maybe Posix.AbsRelFileDir) == Just "/tmp" > fmap Posix.toString (Posix.maybePath "/tmp/" :: Maybe Posix.AbsRelFileDir) == Just "/tmp" > fmap Posix.toString (Posix.maybePath "file.txt" :: Maybe Posix.RelFile) == Just "file.txt" > fmap Posix.toString (Posix.maybePath "file.txt" :: Maybe Posix.AbsFile) == Nothing > fmap Windows.toString (Windows.maybePath "\\tmp" :: Maybe Windows.AbsDir) == Just "\\tmp" > fmap Windows.toString (Windows.maybePath "a:\\tmp" :: Maybe Windows.AbsDir) == Just "a:\\tmp" > fmap Windows.toString (Windows.maybePath "a:tmp" :: Maybe Windows.AbsDir) == Just "a:tmp" > fmap Windows.toString (Windows.maybePath "a:\\" :: Maybe Windows.AbsDir) == Just "a:\\" > fmap Windows.toString (Windows.maybePath "a:" :: Maybe Windows.AbsDir) == Just "a:" > fmap Windows.toString (Windows.maybePath "tmp" :: Maybe Windows.RelDir) == Just "tmp" > fmap Windows.toString (Windows.maybePath "\\tmp" :: Maybe Windows.RelDir) == Nothing > fmap Windows.toString (Windows.maybePath "a:\\tmp" :: Maybe Windows.RelDir) == Nothing > fmap Windows.toString (Windows.maybePath "a:tmp" :: Maybe Windows.RelDir) == Nothing > fmap Windows.toString (Windows.maybePath "tmp" :: Maybe Windows.AbsDir) == NothingqpathtypeSThis function is intended for checking and parsing paths provided as user input. > fmap Posix.toString (Posix.maybePath "/" :: Maybe Posix.AbsDir) == Just "/" > fmap Posix.toString (Posix.maybePath "/" :: Maybe Posix.AbsFile) == Nothing > fmap Posix.toString (Posix.maybePath "/" :: Maybe Posix.RelDir) == Nothing > fmap Posix.toString (Posix.maybePath "/" :: Maybe Posix.RelFile) == Nothing > fmap Posix.toString (Posix.maybePath "/tmp" :: Maybe Posix.AbsDir) == Just "/tmp" > fmap Posix.toString (Posix.maybePath "/tmp" :: Maybe Posix.AbsFile) == Just "/tmp" > fmap Posix.toString (Posix.maybePath "/tmp" :: Maybe Posix.RelDir) == Nothing > fmap Posix.toString (Posix.maybePath "/tmp" :: Maybe Posix.RelFile) == Nothing > fmap Posix.toString (Posix.maybePath "/tmp/" :: Maybe Posix.AbsDir) == Just "/tmp" > fmap Posix.toString (Posix.maybePath "/tmp/" :: Maybe Posix.AbsFile) == Nothing > fmap Posix.toString (Posix.maybePath "/tmp/" :: Maybe Posix.RelDir) == Nothing > fmap Posix.toString (Posix.maybePath "/tmp/" :: Maybe Posix.RelFile) == Nothing > fmap Posix.toString (Posix.maybePath "/tmp" :: Maybe Posix.AbsRelFileDir) == Just "/tmp" > fmap Posix.toString (Posix.maybePath "/tmp/" :: Maybe Posix.AbsRelFileDir) == Just "/tmp" > fmap Posix.toString (Posix.maybePath "file.txt" :: Maybe Posix.RelFile) == Just "file.txt" > fmap Posix.toString (Posix.maybePath "file.txt" :: Maybe Posix.AbsFile) == Nothing > fmap Windows.toString (Windows.maybePath "\\tmp" :: Maybe Windows.AbsDir) == Just "\\tmp" > fmap Windows.toString (Windows.maybePath "a:\\tmp" :: Maybe Windows.AbsDir) == Just "a:\\tmp" > fmap Windows.toString (Windows.maybePath "a:tmp" :: Maybe Windows.AbsDir) == Just "a:tmp" > fmap Windows.toString (Windows.maybePath "a:\\" :: Maybe Windows.AbsDir) == Just "a:\\" > fmap Windows.toString (Windows.maybePath "a:" :: Maybe Windows.AbsDir) == Just "a:" > fmap Windows.toString (Windows.maybePath "tmp" :: Maybe Windows.RelDir) == Just "tmp" > fmap Windows.toString (Windows.maybePath "\\tmp" :: Maybe Windows.RelDir) == Nothing > fmap Windows.toString (Windows.maybePath "a:\\tmp" :: Maybe Windows.RelDir) == Nothing > fmap Windows.toString (Windows.maybePath "a:tmp" :: Maybe Windows.RelDir) == Nothing > fmap Windows.toString (Windows.maybePath "tmp" :: Maybe Windows.AbsDir) == NothingtpathtypejThis function is intended for converting path strings with known content, e.g. string literals, to the g type.upathtype Construct a e from a . i> Posix.toString (Posix.relFile "file.txt") == "file.txt" > Posix.toString (Posix.relFile "tmp") == "tmp"vpathtype Construct a c from a . > Posix.toString (Posix.relDir ".") == "." > Posix.toString (Posix.relDir "file.txt") == "file.txt" > Posix.toString (Posix.relDir "tmp") == "tmp"wpathtype Construct an f from a . m> Posix.toString (Posix.absFile "/file.txt") == "/file.txt" > Posix.toString (Posix.absFile "/tmp") == "/tmp"xpathtype Construct an d from a . k> Posix.toString (Posix.absDir "/file.txt") == "/file.txt" > Posix.toString (Posix.absDir "/tmp") == "/tmp"ypathtypeConstruct a 'Rel fd' from a .zpathtypeConstruct an 'Abs fd' from a .{pathtype Construct an 'AbsRel fd' from a .|pathtypeConstruct a 'File ar' from a .}pathtypeConstruct a 'Dir ar' from a .~pathtype Construct a 'FileDir ar' from a .pathtype Construct a 'RelPath fd' from a .pathtype!Construct an 'AbsPath fd' from a .pathtype!Construct a 'FilePath ar' from a .pathtype Construct a 'DirPath ar' from a .pathtypeUse a  as a gO whose type is determined by its context. You should not use this and other as* functions, since they may silently turn a relative path to an absolute one, or vice versa, or they may accept a path as file path although it ends on a slash. If you are certain about the string content then you should use t2. If you got the string as user input then use q or s. [> Posix.asPath "/tmp" == Posix.absDir "/tmp" > Posix.asPath "file.txt" == Posix.relFile "file.txt" > Path.isAbsolute (Posix.asAbsDir "/tmp") > Path.isRelative (Posix.asRelDir "/tmp") > Posix.toString (Posix.asPath "/tmp" :: Posix.AbsDir) == "/tmp" > Posix.toString (Posix.asPath "/tmp" :: Posix.RelDir) == "tmp" > Windows.toString (Windows.asPath "\\tmp" :: Windows.AbsDir) == "\\tmp" > Windows.toString (Windows.asPath "a:\\tmp" :: Windows.AbsDir) == "a:\\tmp" > Windows.toString (Windows.asPath "a:tmp" :: Windows.AbsDir) == "a:tmp" > Windows.toString (Windows.asPath "tmp" :: Windows.RelDir) == "tmp"pathtypeUse a  as a e. No checking is done. > Posix.toString (Posix.asRelFile "file.txt") == "file.txt" > Posix.toString (Posix.asRelFile "/file.txt") == "file.txt" > Posix.toString (Posix.asRelFile "tmp") == "tmp" > Posix.toString (Posix.asRelFile "/tmp") == "tmp"pathtypeUse a  as a c. No checking is done. > Posix.toString (Posix.asRelDir ".") == "." > Posix.toString (Posix.asRelDir "file.txt") == "file.txt" > Posix.toString (Posix.asRelDir "/file.txt") == "file.txt" > Posix.toString (Posix.asRelDir "tmp") == "tmp" > Posix.toString (Posix.asRelDir "/tmp") == "tmp"pathtypeUse a  as an f. No checking is done. q> Posix.toString (Posix.asAbsFile "/file.txt") == "/file.txt" > Posix.toString (Posix.asAbsFile "/tmp") == "/tmp"pathtypeUse a  as an d. No checking is done. o> Posix.toString (Posix.asAbsDir "/file.txt") == "/file.txt" > Posix.toString (Posix.asAbsDir "/tmp") == "/tmp"pathtypeUse a ( as a 'RelPath fd'. No checking is done.pathtypeUse a ) as an 'AbsPath fd'. No checking is done.pathtypeUse a ) as a 'FilePath ar'. No checking is done.pathtypeUse a ( as a 'DirPath ar'. No checking is done.pathtypeYExamines the supplied string and constructs an absolute or relative path as appropriate. r> Path.mkPathAbsOrRel "/tmp" == Left (Posix.absDir "/tmp") > Path.mkPathAbsOrRel "tmp" == Right (Posix.relDir "tmp") > Path.mkPathAbsOrRel "\\tmp" == Left (Windows.absDir "\\tmp") > Path.mkPathAbsOrRel "d:\\tmp" == Left (Windows.absDir "d:\\tmp") > Path.mkPathAbsOrRel "d:tmp" == Left (Windows.absDir "d:tmp") > Path.mkPathAbsOrRel "tmp" == Right (Windows.relDir "tmp")pathtypeYExamines the supplied string and constructs an absolute or relative path as appropriate. r> Path.mkPathAbsOrRel "/tmp" == Left (Posix.absDir "/tmp") > Path.mkPathAbsOrRel "tmp" == Right (Posix.relDir "tmp") > Path.mkPathAbsOrRel "\\tmp" == Left (Windows.absDir "\\tmp") > Path.mkPathAbsOrRel "d:\\tmp" == Left (Windows.absDir "d:\\tmp") > Path.mkPathAbsOrRel "d:tmp" == Left (Windows.absDir "d:tmp") > Path.mkPathAbsOrRel "tmp" == Right (Windows.relDir "tmp")pathtypePSearches for a file or directory with the supplied path string and returns a F or EA path as appropriate. If neither exists at the supplied path,  is returned.pathtype Convert a  into an WJ by interpreting it as relative to the supplied directory if necessary. > Path.mkAbsPath (absDir "/tmp") "foo.txt" == Posix.absFile "/tmp/foo.txt" > Path.mkAbsPath (absDir "/tmp") "/etc/foo.txt" == Posix.absFile "/etc/foo.txt"pathtype Convert a  into an W; by interpreting it as relative to the cwd if necessary.pathtypeQParse path string independent from expectations expressed by the type parameters.pathtypeInfix variant of . > Posix.toString (Posix.absDir "/tmp" </> Posix.relFile "file.txt") == "/tmp/file.txt" > Posix.toString (Posix.absDir "/tmp" </> Posix.relDir "dir" </> Posix.relFile "file.txt") == "/tmp/dir/file.txt" > Posix.toString (Posix.relDir "dir" </> Posix.relFile "file.txt") == "dir/file.txt" > Windows.toString (Windows.absDir "\\tmp" </> Windows.relFile "file.txt") == "\\tmp\\file.txt" > Windows.toString (Windows.absDir "c:\\tmp" </> Windows.relFile "file.txt") == "c:\\tmp\\file.txt" > Windows.toString (Windows.absDir "c:tmp" </> Windows.relFile "file.txt") == "c:tmp\\file.txt" > Windows.toString (Windows.absDir "c:\\" </> Windows.relDir "tmp" </> Windows.relFile "file.txt") == "c:\\tmp\\file.txt" > Windows.toString (Windows.absDir "c:" </> Windows.relDir "tmp" </> Windows.relFile "file.txt") == "c:tmp\\file.txt" > Windows.toString (Windows.relDir "dir" </> Windows.relFile "file.txt") == "dir\\file.txt"pathtypeInfix 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: .pathtype>Add an extension, even if there is already one there. E.g. -addExtension "foo.txt" "bat" -> "foo.txt.bat". > Path.addExtension (relFile "file.txt") "bib" == Posix.relFile "file.txt.bib" > Path.addExtension (relFile "file.") ".bib" == Posix.relFile "file..bib" > Path.addExtension (relFile "file") ".bib" == Posix.relFile "file.bib" > Path.addExtension Path.emptyFile "bib" == Posix.relFile ".bib" > Path.addExtension Path.emptyFile ".bib" == Posix.relFile ".bib" > Path.takeFileName (Path.addExtension Path.emptyFile "ext") == Posix.relFile ".ext"pathtypemJoin an (absolute or relative) directory path with a relative (file or directory) path to form a new path.pathtype0Remove last extension, and the "." preceding it. 5> Path.dropExtension x == fst (Path.splitExtension x)pathtypeDrop all extensions 3> not $ Path.hasAnExtension (Path.dropExtensions x)pathtype Synonym for pathtype@Set the extension of a file, overwriting one if already present. > Path.replaceExtension (relFile "file.txt") ".bob" == Posix.relFile "file.bob" > Path.replaceExtension (relFile "file.txt") "bob" == Posix.relFile "file.bob" > Path.replaceExtension (relFile "file") ".bob" == Posix.relFile "file.bob" > Path.replaceExtension (relFile "file.txt") "" == Posix.relFile "file" > Path.replaceExtension (relFile "file.fred.bob") "txt" == Posix.relFile "file.fred.txt"pathtypeSplit on the extension.  is the inverse. > uncurry (<.>) (Path.splitExtension x) == x > uncurry Path.addExtension (Path.splitExtension x) == x > Path.splitExtension (relFile "file.txt") == (Posix.relFile "file",".txt") > Path.splitExtension (relFile ".bashrc") == (Posix.emptyFile, ".bashrc") > Path.splitExtension (relFile "file") == (Posix.relFile "file","") > Path.splitExtension (relFile "file/file.txt") == (Posix.relFile "file/file",".txt") > Path.splitExtension (relFile "file.txt/boris") == (Posix.relFile "file.txt/boris","") > Path.splitExtension (relFile "file.txt/boris.ext") == (Posix.relFile "file.txt/boris",".ext") > Path.splitExtension (relFile "file/path.txt.bob.fred") == (Posix.relFile "file/path.txt.bob",".fred")pathtypeSplit on all extensions R> Path.splitExtensions (relFile "file.tar.gz") == (Posix.relFile "file",".tar.gz")pathtypeGet the basename of a file > Path.takeBaseName (absFile "/tmp/somedir/myfile.txt") == Posix.relFile "myfile" > Path.takeBaseName (relFile "./myfile.txt") == Posix.relFile "myfile" > Path.takeBaseName (relFile "myfile.txt") == Posix.relFile "myfile"pathtype%Get the extension of a file, returns "" for no extension, .ext otherwise. > Path.takeExtension x == snd (Path.splitExtension x) > Path.takeExtension (Path.addExtension x "ext") == ".ext" > Path.takeExtension (Path.replaceExtension x "ext") == ".ext"pathtypeGet all extensions @> Path.takeExtensions (Posix.relFile "file.tar.gz") == ".tar.gz"pathtypeHGet the filename component of a file path (ie stripping all parent dirs) > Path.takeFileName (absFile "/tmp/somedir/myfile.txt") == Posix.relFile "myfile.txt" > Path.takeFileName (relFile "./myfile.txt") == Posix.relFile "myfile.txt" > Path.takeFileName (relFile "myfile.txt") == Posix.relFile "myfile.txt"pathtype2Check whether two strings are equal as file paths. > Posix.equalFilePath "abc/def" "abc/def" > Posix.equalFilePath "abc/def" "abc//def" > Posix.equalFilePath "/tmp/" "/tmp" > Posix.equalFilePath "/tmp" "//tmp" > Posix.equalFilePath "/tmp" "///tmp" > not $ Posix.equalFilePath "abc" "def" > not $ Posix.equalFilePath "/tmp" "tmp" > Windows.equalFilePath "abc\\def" "abc\\def" > Windows.equalFilePath "abc\\def" "abc\\\\def" > Windows.equalFilePath "file" "File" > Windows.equalFilePath "\\file" "\\\\file" > Windows.equalFilePath "\\file" "\\\\\\file" > not $ Windows.equalFilePath "abc" "def" > not $ Windows.equalFilePath "file" "dir"pathtype Constructs a V from a list of components. It is an unchecked error if the path components contain path separators. It is an unchecked error if a e path is empty. > Path.joinPath ["tmp","someDir","dir"] == Posix.relDir "tmp/someDir/dir" > Path.joinPath ["tmp","someDir","file.txt"] == Posix.relFile "tmp/someDir/file.txt"pathtypeCurrently just transforms: Y> Path.normalise (absFile "/tmp/fred/./jim/./file") == Posix.absFile "/tmp/fred/jim/file"pathtype(Deconstructs a path into its components. > Path.splitPath (Posix.absDir "/tmp/someDir/mydir.dir") == (True, map relDir ["tmp","someDir","mydir.dir"], Nothing) > Path.splitPath (Posix.absFile "/tmp/someDir/myfile.txt") == (True, map relDir ["tmp","someDir"], Just $ relFile "myfile.txt")pathtypeSThis function can be used to construct a relative path by removing the supplied d! from the front. It is a runtime  if the supplied W doesn't start with the d. ~> Path.makeRelative (absDir "/tmp/somedir") (absFile "/tmp/somedir/anotherdir/file.txt") == Posix.relFile "anotherdir/file.txt" > Path.makeRelative (absDir "/tmp/somedir") (absDir "/tmp/somedir/anotherdir/dir") == Posix.relDir "anotherdir/dir" > Path.makeRelative (absDir "c:\\tmp\\somedir") (absFile "C:\\Tmp\\SomeDir\\AnotherDir\\File.txt") == Windows.relFile "AnotherDir\\File.txt" > Path.makeRelative (absDir "c:\\tmp\\somedir") (absDir "c:\\tmp\\somedir\\anotherdir\\dir") == Windows.relDir "anotherdir\\dir" > Path.makeRelative (absDir "c:tmp\\somedir") (absDir "c:tmp\\somedir\\anotherdir\\dir") == Windows.relDir "anotherdir\\dir"pathtypeUJoins an absolute directory with a relative path to construct a new absolute path.  > Path.makeAbsolute (absDir "/tmp") (relFile "file.txt") == Posix.absFile "/tmp/file.txt" > Path.makeAbsolute (absDir "/tmp") (relFile "adir/file.txt") == Posix.absFile "/tmp/adir/file.txt" > Path.makeAbsolute (absDir "/tmp") (relDir "adir/dir") == Posix.absDir "/tmp/adir/dir"pathtype]Converts a relative path into an absolute one by prepending the current working directory.pathtypeAs for |, but for use when the path may already be absolute (in which case it is left unchanged). You should avoid the use of ]-type functions, because then you avoid to absolutize a path that was already absolutized. :> Path.genericMakeAbsolute (absDir "/tmp") (relFile "file.txt") == Posix.absFile "/tmp/file.txt" > Path.genericMakeAbsolute (absDir "/tmp") (relFile "adir/file.txt") == Posix.absFile "/tmp/adir/file.txt" > Path.genericMakeAbsolute (absDir "/tmp") (absFile "/adir/file.txt") == Posix.absFile "/adir/file.txt"pathtypeAs for \, but for use when the path may already be absolute (in which case it is left unchanged).pathtypeConvert a file to a directory path. Obviously, the corresponding disk object won't change accordingly. The purpose of this function is to be an intermediate step when deriving a directory name from a file name.pathtype<Convert a directory to a file path. The function returns  if the directory path is empty. The purpose of this function is to be an intermediate step when deriving a file name from a directory name.pathtypeTest whether a g ar fd is absolute. > Path.isAbsolute (Posix.absFile "/fred") > Path.isAbsolute (Windows.absFile "\\fred") > Path.isAbsolute (Windows.absFile "c:\\fred") > Path.isAbsolute (Windows.absFile "c:fred")pathtype7Invariant - this should return True iff arg is of type g Part.Rel _ r isRelative = not . isAbsolute > Path.isRelative (Posix.relFile "fred") > Path.isRelative (Windows.relFile "fred")pathtypeTest whether the : would correspond to an absolute path if interpreted as a g.pathtypeTest whether the 9 would correspond to a relative path if interpreted as a g. )isRelativeString = not . isAbsoluteStringpathtype*Does the given filename have an extension? <> null (Path.takeExtension x) == not (Path.hasAnExtension x)pathtype1Does the given filename have the given extension? > Path.hasExtension ".hs" (Posix.relFile "MyCode.hs") > Path.hasExtension ".hs" (Posix.relFile "MyCode.bak.hs") > not $ Path.hasExtension ".hs" (Posix.relFile "MyCode.hs.bak")pathtypePart.File extension character > Posix.extSeparator == '.'pathtypeUThe character that is used to separate the entries in the $PATH environment variable.pathtype(Is the character an extension character? 5> Posix.isExtSeparator a == (a == Posix.extSeparator)pathtype"Is the character a file separator? C> Posix.isSearchPathSeparator a == (a == Posix.searchPathSeparator)pathtype#This is a more flexible variant of  / , which can work with files or directories  > Path.genericAddExtension (absDir "/") "x" == Posix.absDir "/.x" > Path.genericAddExtension (absDir "/a") "x" == Posix.absDir "/a.x" > Path.genericAddExtension Path.emptyFile "x" == Posix.relFile ".x" > Path.genericAddExtension Path.emptyFile "" == Posix.emptyFilepathtype4Check internal integrity of the path data structure.pathtype}Currently it also parses Part.AbsRel and Part.FileDir paths, although these cannot be composed with the accepted combinators.pathtype@We show and parse file path components using the rather generic  smart constructor instead of u, v and relPath str :: FileDirPath ar%. Otherwise handling of all cases of F, E and D" types becomes pretty complicated.pathtypeCForbid use of OverloadedStrings and prevent custom orphan instancesC{|}RSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~577SafelCRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ԀRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~C SafepSafeq:DEFGHIIHGFEDSafeqJKLMNOPQPQNOLMJK Safer5SafetpathtypeThis is largely for   compatibilitypathtypeThis is largely for   compatibilitypathtypeThis is largely for   compatibilityD     D     Safew D     SafexQhijl     FhijlSafe{K  !"#$%&'()*+,-./012348765<;:9A@?>=K'4&A@?>=$#"! 87653%<;:9210/.-, +)*(Safe$pathtypeURetrieve the contents of a directory without any directory prefixes. In contrast to ,, exclude special directories "." and "..".%pathtypeSRetrieve the contents of a directory path (which may be relative) as absolute paths&pathtypeReturns 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"])'pathtypeA convenient alternative to & if you only want files.(pathtypeA convenient alternative to & if you only want directories.B !"#$%&'()*+,-./0123456789 !"#$%&'()*+,-./0123456B789SafevpathtypeThis is largely for   compatibilitywpathtypeThis is largely for   compatibilityxpathtypeThis is largely for   compatibilityD:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyDONMLKEDCBJIHGA@F?>=<;:PQRSTUVWX]YZ[\^_`acbdefghijklmnoqrpstuvwxy !"#$%&'(')'*'+','-'.'/'0'1'2'3'4'5'6'7'8'9':';'<'='>?@?ABCBDBEBFBGBHBIBJBKBLBM'N?OPQRSTUTVTWTXYZY[Y\Y]Y^_`a bcdefg h i b j k l e m n o p  q r b e c d f g s t u v w x y z { | } ~  nopqrbecdfgstuvwxyz{|     nopqrbecdfgstuvwxyz{|bcdfg !"#$%& ' ( ( ) * * + , , - c . d / f 0 g 1 2 3 ~  4 5 6 7 8 9:; <=> ?@A B C D E F F G H IJ'pathtype-0.8.1.1-BBgy39BwueJ70DAADUXV94System.Path.IOSystem.Path.DirectorySystem.Path.GenericSystem.Path.PartSystem.Path.PartClassSystem.Path.PosixSystem.Path.WindowsSystem.Path.Internal.PartSystem.Path.Internal.PartClassSystem.Path.InternalSystem.Path.ModificationTimeSystem.Path.RegularExpressionSystemFilePathSystem.Path.Host System.PathSystem.DirectorygetDirectoryContentsbase System.IOprintghc-prim GHC.TypesIOGHC.IO.Handle.TypesHandlefixIOhPrinthReadyreadIOreadLninteract getContentsgetLinegetCharputStrLnputStrputChar GHC.IO.HandlehShowhSetBinaryModehIsTerminalDevicehGetEchohSetEcho hIsSeekable hGetBuffering hIsWritable hIsReadable hIsClosedhIsOpenhTellhSeekhSetPosnhGetPosn hSetBuffering hLookAheadisEOFhIsEOF hSetFileSize hFileSizehClose HandlePosnGHC.IO.Handle.FDstderrstdinGHC.IO.Handle.TexthGetBufNonBlockinghGetBufhPutBufNonBlockinghPutBuf hPutStrLnhPutStrhPutChar hGetContentshGetLinehGetChar hWaitForInputhFlushstdoutBlockBuffering LineBuffering NoBuffering BufferMode GHC.IO.Device SeekFromEnd RelativeSeek AbsoluteSeekSeekMode GHC.IO.IOMode ReadWriteMode AppendMode WriteModeReadModeIOModedirectory-1.3.3.0 System.Directory.Internal.Common PermissionsFileDirDirFileAbsRelRelAbs FileOrDirswitchFileOrDir switchFileDirAbsOrRelswitchAbsOrRel switchAbsRel FileDirPath AbsRelPathDirPathRelPathAbsPath AbsRelFileDir RelFileDir AbsFileDir AbsRelDir AbsRelFileRelDirAbsDirRelFileAbsFilePathpathMap withAbsRel withFileDirtoString getPathStringrootDir currentDir emptyFilemaybe maybePathparse parsePathpathrelFilerelDirabsFileabsDirrelabsabsRelfiledirfileDirrelPathabsPathfilePathdirPathidAbsRelidAbsidRel idFileDiridFileidDirasPath asRelFileasRelDir asAbsFileasAbsDir asRelPath asAbsPath asFilePath asDirPathmkPathAbsOrRelmkPathFileOrDir mkAbsPathmkAbsPathFromCwd<.><++> addExtensioncombine dropExtensiondropExtensions dropFileNamereplaceExtensionreplaceBaseNamereplaceDirectoryreplaceFileNamesplitExtensionsplitExtensions splitFileName splitDirName takeBaseName takeDirectorytakeSuperDirectory takeExtensiontakeExtensions takeFileName takeDirName mapFileName mapFileNameF equalFilePathjoinPath normalise splitPath makeRelativemakeRelativeMaybe makeAbsolutemakeAbsoluteFromCwddynamicMakeAbsolutedynamicMakeAbsoluteFromCwdgenericMakeAbsolutegenericMakeAbsoluteFromCwd dirFromFile fileFromDir toFileDir fromFileDirfileFromFileDirdirFromFileDirtoAbsRel fromAbsRel isAbsolute isRelativeisAbsoluteStringisRelativeStringhasAnExtension hasExtension extSeparatorsearchPathSeparatorisExtSeparatorisSearchPathSeparatorgenericAddExtensiongenericDropExtensiongenericDropExtensionsgenericSplitExtensiongenericSplitExtensionsgenericTakeExtensiongenericTakeExtensionsisValid pathSeparatorpathSeparatorsisPathSeparatoraddTrailingPathSeparatordropTrailingPathSeparatorhasTrailingPathSeparatortestAll $fSystemPosixwithFileopenFilereadFile writeFile appendFilewithBinaryFileopenBinaryFile openTempFileopenBinaryTempFilecreateDirectorycreateDirectoryIfMissingremoveDirectoryremoveDirectoryRecursiverenameDirectoryabsDirectoryContentsrelDirectoryContents filesInDir dirsInDirgetCurrentDirectorysetCurrentDirectorygetHomeDirectorygetAppUserDataDirectorygetUserDocumentsDirectorygetTemporaryDirectory removeFile renameFilecopyFilecanonicalizePathmakeRelativeToCurrentDirectoryfindExecutable doesFileExistdoesDirectoryExistgetPermissionssetPermissionsgetModificationTime$fSystemWindows GenComponentgenDrive splitAbsolute canonicalize splitDrive PathComponentGenericRelOAbsOabsPCemptyPC applyCompretagPCuntagPCfileMappcMappcMapFPrivate WrapFileDir unwrapFileDir WrapAbsRel unwrapAbsRelFuncArg runFuncArg switchDir switchFile switchRel switchAbsrelVardirVar withFileOrDirfdMap inspectAbsRelinspectFileDireitherFromAbsRel_eitherFromFileDirGHC.BaseStringmkPathAbsOrRelPriv GHC.MaybeNothingmakePathComponentsGHC.Errerror $fReadPath $fShowPath$fIsStringPath convertTimeParser-|-singlerun