Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Utilities to work with FS paths
Synopsis
- pathIsAbsolute :: Text -> Bool
- pathConcat :: Text -> Text -> Text
- pathPrepend :: Text -> Text -> Text
Documentation
pathIsAbsolute :: Text -> Bool Source #
Checks whether specified path is absolute
Only checks the path string itself, doesn't use FS API.
Arguments:
path :: Text
: FS path to check
Return value: True
if path is absolute, False
otherwise
pathConcat :: Text -> Text -> Text Source #
Concatenates two paths
Throws an error, if specified postfix is absolute
Arguments:
prefix :: Text
: Path prefix, may be absolutepostfix :: Text
: Path postfix, must not be absolute
Return value: Concatenated path
pathPrepend :: Text -> Text -> Text Source #
Prepends an absolute prefix to the relative path
Does nothing, if path is already absolute
Arguments:
prefix :: Text
: Path prefix, must be absolutepostfix :: Text
: Path postfix, may be absolute
Return value: Path with a specified prefix prepended, if path is relative, specified path unchanged otherwise