úÎ2§,Sy      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxSafe!"059;84Check if a given character is a valid path separatorisPathSeparator pathSeparatorTrue"all isPathSeparator pathSeparatorsTrue9Check if a given character is a valid extension separator'isExtensionSeparator extensionSeparatorTrue,all isExtensionSeparator extensionSeparatorsTrue!Construct a relative path from a y, failing if the given y* does not represent a valid relative path.relpath "file" Just filerelpath "/file"Nothing relpath "."Just . relpath "/"Nothing relpath ""Nothing"Construct an absolute path from a y, failing if the given y* does not represent a valid absolute path.abspath "/file" Just /fileabspath "file"Nothing abspath "/"Just / abspath "."Nothing abspath ""NothingConstruct a path piece safelypathpiece "file" Just filepathpiece "with.dot" Just with.dotpathpiece "with/slash"Nothing"Construct a last path piece safelylastpiece "file" Just filelastpiece "with.dot"NothingConstruct an extension safelyext "extension"Just extension ext ".ext"Nothingext ""NothingIGround a filepath on an absolute path. This will try to parse the given FilePath‚ as an absolute path and take it if that works. Otherwise it will try to parse it an a relative path and append it to the given AbsPath#ground "/home/user" "relative/path"Just /home/user/relative/path$ground "/home/user" "/absolute/path"Just /absolute/pathground "/home/user" "."Just /home/userground "/home/user" "/"Just /ground "/" "."Just /ground "/anything" ""Nothing 'Construct a relative path, throwing an z if  would fail.!(Construct an absolute path, throwing an z if  would fail."$Construct an extension, throwing an z if  would fail.#$Construct an extension, throwing an z if  would fail.$$Construct an extension, throwing an z if  would fail.% Render a relative filepath to a y&!Render an absolute filepath to a y'%Take the last extension of a filepath0takeExtension ("/directory/path.ext" :: AbsPath)Just ext(takeExtension ("file.tar.gz" :: RelPath)Just gz!takeExtension ("file" :: RelPath)Nothing Replaces System.FilePath.takeExtension(9Take all extensions of a given path in the form of a list1takeExtensions ("/directory/path.ext" :: AbsPath)[ext])takeExtensions ("file.tar.gz" :: RelPath)[tar,gz] Replaces System.FilePath.takeExtensions)-Replace the last extension of a path, exactly1This will fail if the given path has no extensionCreplaceExtensionExact "dir/file.ext1.ext2" "ext3" :: Maybe RelPathJust dir/file.ext1.ext3CreplaceExtensionExact "dir/file.ext1" "ext2" :: Maybe RelPathJust dir/file.ext2CreplaceExtensionExact "dir/file" "ext" :: Maybe RelPathNothingCreplaceExtensionExact "/dir/file.ext1.ext2" "ext3" :: Maybe AbsPathJust /dir/file.ext1.ext3CreplaceExtensionExact "/dir/file.ext1" "ext2" :: Maybe AbsPathJust /dir/file.ext2CreplaceExtensionExact "/dir/file" "ext" :: Maybe AbsPathNothing0replaceExtensionExact "." "ext" :: Maybe RelPathNothing0replaceExtensionExact "/" "ext" :: Maybe AbsPathNothing*$Replace the last extension of a pathFThis will first remove one extension and then add the given extension. BreplaceExtension path extension = dropExtension path <.> extension8replaceExtension "dir/file.ext1.ext2" "ext3" :: RelPathdir/file.ext1.ext38replaceExtension "dir/file.ext1" "ext2" :: RelPath dir/file.ext28replaceExtension "dir/file" "ext" :: RelPath dir/file.ext8replaceExtension "/dir/file.ext1.ext2" "ext3" :: AbsPath/dir/file.ext1.ext38replaceExtension "/dir/file.ext1" "ext2" :: AbsPath/dir/file.ext28replaceExtension "/dir/file" "ext" :: AbsPath /dir/file.ext%replaceExtension "." "ext" :: RelPath.%replaceExtension "/" "ext" :: AbsPath/ Replaces  System.FilePath.replaceExtension+4Replace the last extension of a path (equivalent to *)-"dir/file.ext1.ext2" -<.> "ext3" :: RelPathdir/file.ext1.ext3-"dir/file.ext1" -<.> "ext2" :: RelPath dir/file.ext2-"dir/file" -<.> "ext" :: RelPath dir/file.ext-"/dir/file.ext1.ext2" -<.> "ext3" :: AbsPath/dir/file.ext1.ext3-"/dir/file.ext1" -<.> "ext2" :: AbsPath/dir/file.ext2-"/dir/file" -<.> "ext" :: AbsPath /dir/file.ext"." -<.> "ext" :: RelPath."/" -<.> "ext" :: AbsPath/ Replaces System.FilePath.(- .),=Replace all the extensions of a path with the given extension9replaceExtensions "dir/file.ext1.ext2" "ext3" :: RelPath dir/file.ext39replaceExtensions "dir/file.ext1" "ext3" :: RelPath dir/file.ext39replaceExtensions "dir/file" "ext3" :: RelPath dir/file.ext39replaceExtensions "/dir/file.ext1.ext2" "ext3" :: AbsPath/dir/file.ext39replaceExtensions "/dir/file.ext1" "ext3" :: AbsPath/dir/file.ext39replaceExtensions "/dir/file" "ext3" :: AbsPath/dir/file.ext3&replaceExtensions "." "ext" :: RelPath.&replaceExtensions "/" "ext" :: AbsPath/-FReplace all the extensions of a path with the given list of extensionsDreplaceExtensionss "dir/file.ext1.ext2" ["ext3", "ext4"] :: RelPathdir/file.ext3.ext4DreplaceExtensionss "dir/file.ext1" ["ext3", "ext4"] :: RelPathdir/file.ext3.ext4DreplaceExtensionss "dir/file" ["ext3", "ext4"] :: RelPathdir/file.ext3.ext4DreplaceExtensionss "/dir/file.ext1.ext2" ["ext3", "ext4"] :: AbsPath/dir/file.ext3.ext4DreplaceExtensionss "/dir/file.ext1" ["ext3", "ext4"] :: AbsPath/dir/file.ext3.ext4DreplaceExtensionss "/dir/file" ["ext3", "ext4"] :: AbsPath/dir/file.ext3.ext42replaceExtensionss "." ["ext1", "ext2"] :: RelPath.2replaceExtensionss "/" ["ext1", "ext2"] :: AbsPath/.*Drop the last extension of a path, exactly2This will fail if the given path has no extensions8dropExtensionExact "dir/file.ext1.ext2" :: Maybe RelPathJust dir/file.ext12dropExtensionExact "dir/file.ext" :: Maybe RelPath Just dir/file.dropExtensionExact "dir/file" :: Maybe RelPathNothing9dropExtensionExact "/dir/file.ext1.ext2" :: Maybe AbsPathJust /dir/file.ext13dropExtensionExact "/dir/file.ext" :: Maybe AbsPathJust /dir/file/dropExtensionExact "/dir/file" :: Maybe AbsPathNothing'dropExtensionExact "." :: Maybe RelPathNothing'dropExtensionExact "/" :: Maybe AbsPathNothing/!Drop the last extension of a path-dropExtension "dir/file.ext1.ext2" :: RelPath dir/file.ext1'dropExtension "dir/file.ext" :: RelPathdir/file#dropExtension "dir/file" :: RelPathdir/file.dropExtension "/dir/file.ext1.ext2" :: AbsPath/dir/file.ext1(dropExtension "/dir/file.ext" :: AbsPath /dir/file$dropExtension "/dir/file" :: AbsPath /dir/filedropExtension "." :: RelPath.dropExtension "/" :: AbsPath/ Replaces System.FilePath.dropExtension0Drop all extensions of a path.dropExtensions "dir/file.ext1.ext2" :: RelPathdir/file(dropExtensions "dir/file.ext" :: RelPathdir/file$dropExtensions "dir/file" :: RelPathdir/file/dropExtensions "/dir/file.ext1.ext2" :: AbsPath /dir/file)dropExtensions "/dir/file.ext" :: AbsPath /dir/file%dropExtensions "/dir/file" :: AbsPath /dir/filedropExtensions "." :: RelPath.dropExtensions "/" :: AbsPath/ Replaces System.FilePath.dropExtensions1Add an extension to a path/addExtension "/directory/path" "ext" :: AbsPath/directory/path.ext/addExtension "directory/path" "ext" :: RelPathdirectory/path.extyThis will not override the extension if there already is an extension. It will only add the given extension on top of it5addExtension "/directory/path.ext1" "ext2" :: AbsPath/directory/path.ext1.ext25addExtension "directory/path.ext1" "ext2" :: RelPathdirectory/path.ext1.ext24This will not add an extension if the path is empty.!addExtension "." "ext" :: RelPath.!addExtension "/" "ext" :: AbsPath/ Replaces System.FilePath.addExtension2*Add an extension to a path (equivalent to 1)&"/directory/path" <.> "ext" :: AbsPath/directory/path.ext&"directory/path" <.> "ext" :: RelPathdirectory/path.ext,"/directory/path.ext1" <.> "ext2" :: AbsPath/directory/path.ext1.ext2,"directory/path.ext1" <.> "ext2" :: RelPathdirectory/path.ext1.ext2"." <.> "ext" :: RelPath."/" <.> "ext" :: AbsPath/ Replaces System.FilePath.( .)3"Add a list of extensions to a path;addExtensions "/directory/path" ["ext1", "ext2"] :: AbsPath/directory/path.ext1.ext2;addExtensions "directory/path" ["ext1", "ext2"] :: RelPathdirectory/path.ext1.ext2@addExtensions "/directory/path.ext1" ["ext2", "ext3"] :: AbsPath/directory/path.ext1.ext2.ext3@addExtensions "directory/path.ext1" ["ext2", "ext3"] :: RelPathdirectory/path.ext1.ext2.ext3-addExtensions "." ["ext1", "ext2"] :: RelPath.-addExtensions "/" ["ext1", "ext2"] :: AbsPath/QThis operation is an identity function if the given list of extensions is empty.4cDrop the given extension from a FilePath. Fails if the FilePath does not have the given extension.3stripExtension "foo.x.hs.o" "o" :: Maybe RelPath Just foo.x.hs3stripExtension "foo.x.hs.o" "hs" :: Maybe RelPathNothing3stripExtension "a.b.c.d" "d" :: Maybe RelPath Just a.b.c3stripExtension "foo.bar" "baz" :: Maybe RelPathNothing3stripExtension "foobar" "bar" :: Maybe RelPathNothing Replaces System.FilePath.stripExtension5lDrop the given extensions from a FilePath. Fails if the FilePath does not have all of the given extensions.>stripExtensions "foo.x.hs.o" ["hs", "o"] :: Maybe RelPath Just foo.x>stripExtensions "foo.x.hs.o" ["o", "hs"] :: Maybe RelPathNothing>stripExtensions "a.b.c.d" ["c", "d"] :: Maybe RelPathJust a.b>stripExtensions "foo.bar" ["baz", "quux"] :: Maybe RelPathNothing>stripExtensions "foobar" ["bar"] :: Maybe RelPathNothing6$Split off the extensions from a path0splitExtension ("dir/file.ext1.ext2" :: RelPath)Just (dir/file.ext1,ext2)*splitExtension ("dir/file.ext" :: RelPath)Just (dir/file,ext)&splitExtension ("dir/file" :: RelPath)Nothing1splitExtension ("/dir/file.ext1.ext2" :: AbsPath)Just (/dir/file.ext1,ext2)+splitExtension ("/dir/file.ext" :: AbsPath)Just (/dir/file,ext)'splitExtension ("/dir/file" :: AbsPath)NothingsplitExtension ("." :: RelPath)NothingsplitExtension ("/" :: AbsPath)Nothing Replaces System.FilePath.splitExtension7$Split off the extensions from a path1splitExtensions ("dir/file.ext1.ext2" :: RelPath)(dir/file,[ext1,ext2])+splitExtensions ("dir/file.ext" :: RelPath)(dir/file,[ext])'splitExtensions ("dir/file" :: RelPath) (dir/file,[])2splitExtensions ("/dir/file.ext1.ext2" :: AbsPath)(/dir/file,[ext1,ext2]),splitExtensions ("/dir/file.ext" :: AbsPath)(/dir/file,[ext])(splitExtensions ("/dir/file" :: AbsPath)(/dir/file,[]) splitExtensions ("." :: RelPath)(.,[]) splitExtensions ("/" :: AbsPath)(/,[])83Check whether the given filepath has any extensions/hasExtension ("/directory/path.ext" :: AbsPath)True/hasExtension ("/directory/path" :: AbsPath)False Replaces System.FilePath.hasExtension9OSplit a path into all but the last piece and the last piece and the extensions0splitFileName ("/directory/file.ext" :: AbsPath)(/directory,file.ext))splitFileName ("file/bob.txt" :: RelPath)(file,bob.txt)!splitFileName ("file" :: RelPath)(.,file)-splitFileName ("dir.ext/file.ext" :: RelPath)(dir.ext,file.ext):0Take the last piece and the extensions, exactly.This will evaluate to { if the given path is empty4takeFileNameExact ("/directory/file.ext" :: AbsPath) Just file.ext-takeFileNameExact ("file/bob.txt" :: RelPath) Just bob.txt%takeFileNameExact ("file" :: RelPath) Just file1takeFileNameExact ("dir.ext/file.ext" :: RelPath) Just file.ext"takeFileNameExact ("." :: RelPath)Nothing"takeFileNameExact ("/" :: AbsPath)Nothing Replaces System.FilePath.takeFileName;'Take the last piece and the extensions.KThis will evaluate to the empty (relative) path if the given path is empty./takeFileName ("/directory/file.ext" :: AbsPath)file.ext(takeFileName ("file/bob.txt" :: RelPath)bob.txt takeFileName ("file" :: RelPath)file,takeFileName ("dir.ext/file.ext" :: RelPath)file.exttakeFileName ("." :: RelPath).takeFileName ("/" :: AbsPath). Replaces System.FilePath.takeFileName<;Replace the last piece of a path with the given last piece.GreplaceFileNameExact "/directory/other.txt" "file.ext" :: Maybe AbsPathJust /directory/file.ext4replaceFileNameExact "." "file.ext" :: Maybe RelPath Just file.ext4replaceFileNameExact "/" "file.ext" :: Maybe AbsPathJust /file.ext<If the given path piece is degenerate, this is what happens:BreplaceFileNameExact "/directory/other.txt" "..." :: Maybe AbsPathNothing=;Replace the last piece of a path with the given last piece.<replaceFileName "/directory/other.txt" "file.ext" :: AbsPath/directory/file.ext)replaceFileName "." "file.ext" :: RelPathfile.ext)replaceFileName "/" "file.ext" :: AbsPath /file.ext<If the given path piece is degenerate, this is what happens:7replaceFileName "/directory/other.txt" "..." :: AbsPath /directory>&Drop the last piece of a path, exactly3dropFileNameExact ("directory/file.ext" :: RelPath)Just directory4dropFileNameExact ("/directory/file.ext" :: AbsPath)Just /directory2This evaluates to Nothing when given an empty path"dropFileNameExact ("/" :: AbsPath)Nothing"dropFileNameExact ("." :: RelPath)Nothing?Drop the last piece of a path.dropFileName ("directory/file.ext" :: RelPath) directory/dropFileName ("/directory/file.ext" :: AbsPath) /directory8This evaluates to an empty path when given an empty pathdropFileName ("/" :: AbsPath)/dropFileName ("." :: RelPath). Replaces System.FilePath.dropFileName and System.FilePath.takeDirectory@#Take the last piece (no extensions))takeBaseNameExact ("file.ext" :: RelPath) Just file1takeBaseNameExact ("dir/and/file.ext" :: RelPath) Just file7This will evaluate to Nothing when given an empty path:"takeBaseNameExact ("." :: RelPath)Nothing"takeBaseNameExact ("/" :: AbsPath)NothingA#Take the last piece (no extensions)$takeBaseName ("file.ext" :: RelPath)file,takeBaseName ("dir/and/file.ext" :: RelPath)fileHThis will evaluate to an empty last path piece when given an empty path: Replaces System.FilePath.takeBaseNameB9Replace the last piece exactly: fails on empty last piece8replaceBaseNameExact "file.ext" "piece" :: Maybe RelPathJust piece.ext1replaceBaseNameExact "." "thing" :: Maybe RelPath Just thing1replaceBaseNameExact "/" "thing" :: Maybe AbsPath Just /thing:replaceBaseNameExact "/directory/file" "" :: Maybe AbsPathNothingCReplace the last piece-replaceBaseName "file.ext" "piece" :: RelPath piece.ext&replaceBaseName "." "thing" :: RelPaththing&replaceBaseName "/" "thing" :: AbsPath/thing/replaceBaseName "/directory/file" "" :: AbsPath /directory Replaces System.FilePath.replaceBaseNameD-Replace everthing but the last piece, exactlyQreplaceDirectoryExact ("/dir/and/file" :: AbsPath) ("other/directory" :: RelPath)Just other/directory/fileThis will evaluate to {( if the first argument is an empty path.AreplaceDirectoryExact ("." :: RelPath) ("a/directory" :: RelPath)NothingAreplaceDirectoryExact ("/" :: AbsPath) ("a/directory" :: RelPath)NothingThis will evaluate to {) if the second argument is an empty path.>replaceDirectoryExact ("dir/file" :: RelPath) ("." :: RelPath)Nothing>replaceDirectoryExact ("dir/file" :: RelPath) ("/" :: AbsPath)NothingE$Replace everthing but the last pieceLreplaceDirectory ("/dir/and/file" :: AbsPath) ("other/directory" :: RelPath)other/directory/file<replaceDirectory ("." :: RelPath) ("a/directory" :: RelPath) a/directory<replaceDirectory ("/" :: AbsPath) ("a/directory" :: RelPath) a/directory9replaceDirectory ("dir/file" :: RelPath) ("." :: RelPath)file9replaceDirectory ("dir/file" :: RelPath) ("/" :: AbsPath)/file Replaces  System.FilePath.replaceDirectoryFCombine two paths, exactlycIf the first path has extensions, they will be appended to the last pathpiece before concatenationBcombineExact "/directory/path" "another/path.ext" :: Maybe AbsPath%Just /directory/path/another/path.extBcombineExact "directory/path" "another/path.ext" :: Maybe RelPath$Just directory/path/another/path.extBcombineExact "/file.ext1.ext2" "other/file.ext3" :: Maybe AbsPath$Just /file.ext1.ext2/other/file.ext3BcombineExact "file.ext1.ext2" "other/file.ext3" :: Maybe RelPath#Just file.ext1.ext2/other/file.ext3This evaluates to {$ if any of the given paths are empty,combineExact "." "file.ext" :: Maybe RelPathNothing,combineExact "/" "file.ext" :: Maybe AbsPathNothingGCombine two pathscIf the first path has extensions, they will be appended to the last pathpiece before concatenation7combine "/directory/path" "another/path.ext" :: AbsPath /directory/path/another/path.ext7combine "directory/path" "another/path.ext" :: RelPathdirectory/path/another/path.ext7combine "/file.ext1.ext2" "other/file.ext3" :: AbsPath/file.ext1.ext2/other/file.ext37combine "file.ext1.ext2" "other/file.ext3" :: RelPathfile.ext1.ext2/other/file.ext37This treats empty paths as identities to the operation.!combine "file.ext" "." :: RelPathfile.ext!combine "." "file.ext" :: RelPathfile.ext!combine "/" "file.ext" :: AbsPath /file.extcombine "." "." :: RelPath.combine "/" "." :: AbsPath/ Replaces System.FilePath.combineHCombine two pathsequivalent to G3"/directory/path" </> "another/path.ext" :: AbsPath /directory/path/another/path.ext3"directory/path" </> "another/path.ext" :: RelPathdirectory/path/another/path.ext3"/file.ext1.ext2" </> "other/file.ext3" :: AbsPath/file.ext1.ext2/other/file.ext33"file.ext1.ext2" </> "other/file.ext3" :: RelPathfile.ext1.ext2/other/file.ext3"." </> "file.ext" :: RelPathfile.ext"/" </> "file.ext" :: AbsPath /file.ext Replaces System.FilePath.( /)ISplit a path up into pieces8splitPath ("/a/full/absolute/directory/path" :: AbsPath) [a,full,absolute,directory,path]J!Join path pieces back into a pathHjoinPath ["a", "full", "absolute", "directory", "path"] :: Maybe AbsPath$Just /a/full/absolute/directory/pathjoinPath [] :: Maybe RelPathJust .joinPath [] :: Maybe AbsPathJust /$joinPath [".", "."] :: Maybe RelPathNothing[ ONLY for OverloadedStringsU This instance instance is unsafe and should only be used at own risk, for literals] ONLY for OverloadedStringsU This instance instance is unsafe and should only be used at own risk, for literals` ONLY for OverloadedStringsU This instance instance is unsafe and should only be used at own risk, for literalsd ONLY for OverloadedStringsU This instance instance is unsafe and should only be used at own risk, for literalse ONLY for OverloadedStringsU This instance instance is unsafe and should only be used at own risk, for literalsh  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefgZ  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYh  gfedcba`_^]\[Z !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXY_   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefgSafe<  !"#$%&'()*+,-./012345678:;<=>?@ABCDEFGHIJ<  !"#$%&'(123./0)*+,-45678:;>?<=@ABCDEFGHIJ|      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxvyzv{|}'safepath-0.1.0.0-4DMxAAzjInk6pEzgV90XGTData.Path.Internal Data.Path Extension LastPathPiece PathPieceRelativeAbsolutePath pathPieces pathLastPiecepathExtensionsRelPathAbsPath pathSeparatorpathSeparatorsisPathSeparatorextensionSeparatorextensionSeparatorsisExtensionSeparatorcontainsSatisfiedcontainsSeparatorcontainsExtensionrelpathabspath pathpiece lastpieceextgroundunsafeRelPathErrorunsafeAbsPathErrorunsafePathPieceErrorunsafeLastPieceErrorunsafeExtError toRelFilePath toAbsFilePath takeExtensiontakeExtensionsreplaceExtensionExactreplaceExtension-<.>replaceExtensionsreplaceExtensionssdropExtensionExact dropExtensiondropExtensions addExtension<.> addExtensionsstripExtensionstripExtensionssplitExtensionsplitExtensions hasExtension splitFileNametakeFileNameExact takeFileNamereplaceFileNameExactreplaceFileNamedropFileNameExact dropFileNametakeBaseNameExact takeBaseNamereplaceBaseNameExactreplaceBaseNamereplaceDirectoryExactreplaceDirectory combineExactcombine splitPathjoinPathinitMaylastMayunsnocunconsisEmptyLastPathPieceemptyLastPathPiece emptyPath isEmptyPath renderPiecerenderLastPiecerenderExtensionrenderExtensionscombineLastAndExtensions splitPieceunsafePathTypeCoerse$fValidityExtension$fIsStringExtension$fShowExtension$fIsStringLastPathPiece$fValidityLastPathPiece$fShowLastPathPiece$fIsStringPathPiece$fValidityPathPiece$fShowPathPiece$fValidityPath$fIsStringPath$fIsStringPath0 $fShowPath $fShowPath0$fGenericAbsolute$fDataAbsolute$fGenericRelative$fDataRelative $fEqPathPiece$fGenericPathPiece$fDataPathPiece$fEqLastPathPiece$fGenericLastPathPiece$fDataLastPathPiece $fEqExtension$fGenericExtension$fDataExtension $fShowPath1$fEqPath $fGenericPath $fDataPathbaseGHC.IOFilePathGHC.ErrerrorGHC.BaseNothing