Safe Haskell | Safe |
---|---|
Language | Haskell98 |
This module provides type-safe access to filepath manipulations.
Normally you would import Path
(which will use the
default implementation for the host platform) instead of this.
However, importing this explicitly allows for manipulation of
non-native paths.
- type Path = Path Windows
- type AbsFile = Path Abs File
- type RelFile = Path Rel File
- type AbsDir = Path Abs Dir
- type RelDir = Path Rel Dir
- type AbsPath fd = Path Abs fd
- type RelPath fd = Path Rel fd
- type FilePath ar = Path ar File
- type DirPath ar = Path ar Dir
- type AbsOrRelFile = Path AbsOrRel File
- type AbsOrRelDir = Path AbsOrRel Dir
- type AbsFileOrDir = Path Abs FileOrDir
- type RelFileOrDir = Path Rel FileOrDir
- type AbsOrRelPath fd = Path AbsOrRel fd
- type FileOrDirPath ar = Path ar FileOrDir
- type AbsOrRelFileOrDir = Path AbsOrRel FileOrDir
- asPath :: (AbsRelClass ar, FileDirClass fd) => String -> Path ar fd
- asRelFile :: String -> RelFile
- asRelDir :: String -> RelDir
- asAbsFile :: String -> AbsFile
- asAbsDir :: String -> AbsDir
- asRelPath :: FileDirClass fd => String -> RelPath fd
- asAbsPath :: FileDirClass fd => String -> AbsPath fd
- asFilePath :: AbsRelClass ar => String -> FilePath ar
- asDirPath :: AbsRelClass ar => String -> DirPath ar
- path :: (AbsOrRelClass ar, FileOrDirClass fd) => String -> Path ar fd
- maybePath :: (AbsOrRelClass ar, FileOrDirClass fd) => String -> Maybe (Path ar fd)
- relFile :: String -> RelFile
- relDir :: String -> RelDir
- absFile :: String -> AbsFile
- absDir :: String -> AbsDir
- relPath :: FileOrDirClass fd => String -> RelPath fd
- absPath :: FileOrDirClass fd => String -> AbsPath fd
- filePath :: AbsOrRelClass ar => String -> FilePath ar
- dirPath :: AbsOrRelClass ar => String -> DirPath ar
- rootDir :: AbsDir
- currentDir :: RelDir
- emptyFile :: RelFile
- toString :: (AbsOrRelClass ar, FileOrDirClass fd) => Path ar fd -> String
- isAbsoluteString :: String -> Bool
- isRelativeString :: String -> Bool
- equalFilePath :: String -> String -> Bool
- pathSeparator :: Char
- pathSeparators :: [Char]
- isPathSeparator :: Char -> Bool
- extSeparator :: Char
- isExtSeparator :: Char -> Bool
- searchPathSeparator :: Char
- isSearchPathSeparator :: Char -> Bool
- addTrailingPathSeparator :: String -> String
- dropTrailingPathSeparator :: String -> String
- hasTrailingPathSeparator :: String -> Bool
- testAll :: [(String, IO ())]
Documentation
type AbsOrRelFile = Path AbsOrRel File Source
type AbsOrRelDir = Path AbsOrRel Dir Source
type AbsFileOrDir = Path Abs FileOrDir Source
type RelFileOrDir = Path Rel FileOrDir Source
type AbsOrRelPath fd = Path AbsOrRel fd Source
type FileOrDirPath ar = Path ar FileOrDir Source
type AbsOrRelFileOrDir = Path AbsOrRel FileOrDir Source
asPath :: (AbsRelClass ar, FileDirClass fd) => String -> Path ar fd Source
asFilePath :: AbsRelClass ar => String -> FilePath ar Source
Deprecated: Use filePath
instead.
path :: (AbsOrRelClass ar, FileOrDirClass fd) => String -> Path ar fd Source
maybePath :: (AbsOrRelClass ar, FileOrDirClass fd) => String -> Maybe (Path ar fd) Source
relPath :: FileOrDirClass fd => String -> RelPath fd Source
absPath :: FileOrDirClass fd => String -> AbsPath fd Source
filePath :: AbsOrRelClass ar => String -> FilePath ar Source
dirPath :: AbsOrRelClass ar => String -> DirPath ar Source
toString :: (AbsOrRelClass ar, FileOrDirClass fd) => Path ar fd -> String Source
isAbsoluteString :: String -> Bool Source
isRelativeString :: String -> Bool Source
equalFilePath :: String -> String -> Bool Source
pathSeparators :: [Char] Source
isPathSeparator :: Char -> Bool Source
File extension character
> Posix.extSeparator == '.'
isExtSeparator :: Char -> Bool Source
Is the character an extension character?
> Posix.isExtSeparator a == (a == Posix.extSeparator)
searchPathSeparator :: Char Source
The character that is used to separate the entries in the $PATH environment variable.
isSearchPathSeparator :: Char -> Bool Source
Is the character a file separator?
> Posix.isSearchPathSeparator a == (a == Posix.searchPathSeparator)
addTrailingPathSeparator :: String -> String Source
Deprecated: Use System.FilePath.addTrailingPathSeparator instead.
This is largely for FilePath
compatibility
dropTrailingPathSeparator :: String -> String Source
Deprecated: Use System.FilePath.dropTrailingPathSeparator instead.
This is largely for FilePath
compatibility
hasTrailingPathSeparator :: String -> Bool Source
Deprecated: Use System.FilePath.hasTrailingPathSeparator instead.
This is largely for FilePath
compatibility