License | BSD-style |
---|---|
Maintainer | foundation |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
# Opaque implementation for FilePath
The underlying type of a FilePath is a
ByteArray
. It is indeed like
this because for some systems (Unix systems) a
FilePath
is a null
terminated array of bytes.
# FilePath and FileName for type checking validation
In order to add some constraint at compile time, it is not possible to
append (
</>
) a
FilePath
to another
FilePath
.
You can only append (
</>
) a
FileName
to a given
FilePath
.
Synopsis
- data FilePath
- data Relativity
- data FileName
- filePathToString :: FilePath -> String
- filePathToLString :: FilePath -> [ Char ]
- unsafeFilePath :: Relativity -> [ FileName ] -> FilePath
- unsafeFileName :: UArray Word8 -> FileName
- extension :: FileName -> Maybe FileName
Documentation
FilePath is a collection of FileName
TODO: Eq and Ord are implemented using Show This is not very efficient and would need to be improved Also, it is possible the ordering is not necessary what we want in this case.
A FilePath is one of the following:
- An Absolute:
- starts with one of the follwing "/"
- A relative:
- don't start with a "/"
- authorised:
- "/"
- " file path"
- "."
- ".."
- "work haskell hs-foundation"
- unauthorised
- "path//"
Instances
Eq FilePath Source # | |
Ord FilePath Source # | |
Defined in Foundation.VFS.FilePath |
|
Show FilePath Source # | |
IsString FilePath Source # | |
Defined in Foundation.VFS.FilePath fromString :: String -> FilePath Source # |
|
Path FilePath Source # | |
Defined in Foundation.VFS.FilePath |
|
type PathEnt FilePath Source # | |
Defined in Foundation.VFS.FilePath |
|
type PathPrefix FilePath Source # | |
Defined in Foundation.VFS.FilePath |
|
type PathSuffix FilePath Source # | |
Defined in Foundation.VFS.FilePath |
data Relativity Source #
Instances
Eq Relativity Source # | |
Defined in Foundation.VFS.FilePath (==) :: Relativity -> Relativity -> Bool Source # (/=) :: Relativity -> Relativity -> Bool Source # |
|
Show Relativity Source # | |
Defined in Foundation.VFS.FilePath |
A filename (or path entity) in the FilePath
- Authorised
- ""
- "."
- ".."
- "foundation"
- Unauthorised
- "/"
- "file/"
- "/file"
- "file/path"
conversion
filePathToString :: FilePath -> String Source #
filePathToLString :: FilePath -> [ Char ] Source #
conversion of a FilePath into a list of Char
this function may throw exceptions
unsafe
unsafeFilePath :: Relativity -> [ FileName ] -> FilePath Source #
build a file path from a given list of filename
this is unsafe and is mainly needed for testing purpose