vt-utils-1.3.0.0: Vector and Text utilities

Safe HaskellSafe
LanguageHaskell2010

VtUtils.Path

Description

Utilities to work with FS paths

Synopsis

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

Specified postfix must be non-absolute

Arguments:

  • prefix :: Text: Path prefix, may be absolute
  • postfix :: 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 absolute
  • postfix :: Text: Path postfix, may be absolute

Return value: Path with a specified prefix prepended, if path is relative, specified path unchanged otherwise