Safe Haskell | None |
---|---|
Language | Haskell2010 |
Data.FilePath
- data Path
- data From
- data PathSegment
- segString :: PathSegment -> String
- mkPathSegment :: String -> Maybe PathSegment
- data FilePath a b
- (</>) :: FilePath a Directory -> FilePath Relative b -> FilePath a b
- rootPath :: FilePath Root Directory
- relativePath :: FilePath Relative Directory
- mkDirPath :: String -> Maybe (FilePath Relative Directory)
- mkDirPathSeg :: PathSegment -> FilePath Relative Directory
- mkFilePath :: String -> Maybe (FilePath Relative File)
- mkFilePathSeg :: PathSegment -> FilePath Relative File
- mkRootFilePathBase :: String -> Maybe (FilePath Root Directory)
- mkFullFilePath :: String -> Maybe (FilePath Root File)
- dirname :: FilePath a File -> FilePath a Directory
- basename :: FilePath a File -> String
- basenameSeg :: FilePath a File -> PathSegment
- showp :: FilePath a b -> String
- segQ :: QuasiQuoter
- dirpathQ :: QuasiQuoter
- filepathQ :: QuasiQuoter
Documentation
data PathSegment Source
A PathSegment is any single element of a path...i.e. the stuff between two '/' characters. Valid path segments cannot contain '/' or control characters. PathSegments are also monoids to allow mappending with prefixes/suffixes.
segString :: PathSegment -> String Source
Every PathSegment
is a valid string
mkPathSegment :: String -> Maybe PathSegment Source
Smart constructor for valid PathSegments. Valid path segments cannot contain front slashes or control characters. This function performs all the checks up front.
- Is the string non-empty?
- Does the string contain forward slashes or control characters?
mkDirPath :: String -> Maybe (FilePath Relative Directory) Source
Smart constructor for directories. Valid directories must be valid PathSegments and also cannot be empty strings.
mkDirPathSeg :: PathSegment -> FilePath Relative Directory Source
This function basically defines what the PathSegment
type is semantically.
It is string like thing which you can safely create a path from.
See mkPathSegment
, mkFilePathSeg
mkFilePath :: String -> Maybe (FilePath Relative File) Source
Smart constructor for files. Valid files must be valid PathSegments and also cannot be empty strings.
basenameSeg :: FilePath a File -> PathSegment Source