dojang-0.2.1: A cross-platform dotfiles manager
Safe HaskellSafe-Inferred
LanguageHaskell2010

Dojang.Types.FilePathExpression

Synopsis

Documentation

type EnvironmentVariable = Text Source #

An environment variable.

data FilePathExpression Source #

An expression that can be used to build a file path.

Constructors

BareComponent Text

A bare component of a file path. E.g., foo and bar in foobar.

Root (Maybe Char)

The root of a file path. E.g., / on POSIX systems or @C:@ on Windows. The Maybe Char is the drive letter on Windows, if present. On POSIX systems, this is always Nothing.

Concatenation FilePathExpression FilePathExpression

A concatenation of two FilePathExpressions. E.g., ${FOO}bar is a concatenation of ${FOO} and bar.

PathSeparator FilePathExpression FilePathExpression

A path separator which combines two FilePathExpressions. E.g., / on POSIX systems or @@ on Windows.

Substitution EnvironmentVariable

A simple substitution of an environment variable. E.g., $FOO or ${BAR}.

SubstitutionWithDefault EnvironmentVariable FilePathExpression

A substitution of an environment variable with a default value for when the environment variable is not set. E.g., ${FOO:-this value is used if FOO is not set or is empty}.

ConditionalSubstitution EnvironmentVariable FilePathExpression

A conditional substitution of an environment variable with an expression to be expanded if the environment variable is set. E.g., ${FOO:+this value is used if FOO is set and non-empty}.

toPathText :: FilePathExpression -> Text Source #

Converts a FilePathExpression to a textual representation.

(+/+) :: FilePathExpression -> FilePathExpression -> FilePathExpression infixl 5 Source #

Combines two FilePathExpressions with a path separator. A synonym for PathSeparator.