-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | A type safe file path data structure
--
@package data-filepath
@version 2.2.0.0
module Data.FilePath
data Path
File :: Path
Directory :: Path
data From
Root :: From
Relative :: From
-- | 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 semigroups to allow concatenating
-- with prefixes/suffixes.
data PathSegment
data FilePath (a :: From) (b :: Path)
data FilePathParseError
-- | For cases where you dont know during compile time what kind of path
-- you will get, for instance when you are parsing a path from the
-- command line
data WeakFilePath (a :: Path)
filePathParseError :: (String -> NonEmpty String -> a) -> FilePathParseError -> a
weakFilePath :: (FilePath Root a -> b) -> (FilePath Relative a -> b) -> WeakFilePath a -> b
rootFromWeak :: WeakFilePath a -> Maybe (FilePath Root a)
relativeFromWeak :: WeakFilePath a -> Maybe (FilePath Relative a)
-- | Every PathSegment is a valid string
segString :: PathSegment -> String
-- | 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?
--
mkPathSegment :: String -> Maybe PathSegment
(>) :: FilePath a Directory -> FilePath Relative b -> FilePath a b
rootPath :: FilePath Root Directory
relativePath :: FilePath Relative Directory
-- | Takes in a string that is intended to represent a relative path or a
-- root path down the filesystem tree splits on /
parseDirectory :: String -> Either FilePathParseError (WeakFilePath Directory)
-- | Takes in a string that is intended to represent a relative path or a
-- root path down the filesystem tree splits on /
parseFilePath :: String -> Either FilePathParseError (WeakFilePath File)
-- | Smart constructor for directories. Valid directories must be valid
-- PathSegments and also cannot be empty strings.
-- | Deprecated: Please use `fmap mkDirPathSeg . mkPathSegment`
-- instead
mkDirPath :: String -> Maybe (FilePath Relative Directory)
-- | 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
mkDirPathSeg :: PathSegment -> FilePath Relative Directory
-- | Smart constructor for files. Valid files must be valid PathSegments
-- and also cannot be empty strings.
-- | Deprecated: Please use `fmap mkFilePathSeg . mkPathSegment`
-- instead
mkFilePath :: String -> Maybe (FilePath Relative File)
mkFilePathSeg :: PathSegment -> FilePath Relative 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
instance Typeable PathSegment
instance Typeable FilePath
instance Typeable 'File
instance Typeable 'Root
instance Typeable 'Relative
instance Typeable 'Directory
instance Eq PathSegment
instance Show PathSegment
instance Data PathSegment
instance Show FilePathParseError
instance Eq FilePathParseError
instance Show (WeakFilePath a)
instance Eq (WeakFilePath a)
instance Data (FilePath 'Root 'File)
instance Data (FilePath 'Relative 'File)
instance Data (FilePath 'Root 'Directory)
instance Data (FilePath 'Relative 'Directory)
instance Show (FilePath a b)
instance Eq (FilePath a b)
instance Semigroup PathSegment