Loading...

Streamly.Internal.FileSystem.WindowsPath.SegNode

When Rooted/Branch and File/Dir both are present, Rooted/Branch must be outermost constructors and File/Dir as inner. Thus the types File (Rooted a) or Dir (Rooted a) are not allowed but Rooted (Dir a) and Rooted (File a) are allowed.

Statically Verified Path Literals

Quasiquoters.

rtdir :: QuasiQuoter Source #

Generates a Rooted (Dir WindowsPath) type from a quoted literal.

>>> Path.toString ([rtdir|/usr|] :: Rooted (Dir PosixPath))
"/usr"

brdir :: QuasiQuoter Source #

Generates a Branch (Dir WindowsPath) type from a quoted literal.

>>> Path.toString ([brdir|usr|] :: Branch (Dir PosixPath))
"usr"

rtfile :: QuasiQuoter Source #

Generates a Rooted (File WindowsPath) type from a quoted literal.

>>> Path.toString ([rtfile|/x.txt|] :: Rooted (File PosixPath))
"/x.txt"

brfile :: QuasiQuoter Source #

Generates a Branch (File WindowsPath) type from a quoted literal.

>>> Path.toString ([brfile|x.txt|] :: Branch (File PosixPath))
"x.txt"

Statically Verified Path Strings

Template Haskell expression splices.

rtdirE :: String -> Q Exp Source #

Generates a Haskell expression of type Rooted (Dir WindowsPath).

brdirE :: String -> Q Exp Source #

Generates a Haskell expression of type Branch (Dir WindowsPath).

rtfileE :: String -> Q Exp Source #

Generates a Haskell expression of type Rooted (File WindowsPath).

brfileE :: String -> Q Exp Source #

Generates a Haskell expression of type Branch (File WindowsPath).

Operations

append :: (IsPath WindowsPath (a (Dir WindowsPath)), IsPath WindowsPath (b WindowsPath), IsPath WindowsPath (a (b WindowsPath))) => a (Dir WindowsPath) -> Branch (b WindowsPath) -> a (b WindowsPath) Source #

Append a branch type path to a directory.

>>> Path.toString (SegNode.append [rtdir|/usr|] [brdir|bin|] :: Rooted (Dir PosixPath))
"/usr/bin"
>>> Path.toString (SegNode.append [rtdir|/usr|] [brfile|bin|] :: Rooted (File PosixPath))
"/usr/bin"
>>> Path.toString (SegNode.append [brdir|usr|] [brdir|bin|] :: Branch (Dir PosixPath))
"usr/bin"
>>> Path.toString (SegNode.append [brdir|usr|] [brfile|bin|] :: Branch (File PosixPath))
"usr/bin"

Orphan instances