Loading...

Streamly.FileSystem.Path.Seg

Types

class IsSeg a Source #

Constraint to check if a type has Rooted or Branch annotations.

Instances
Instances details
IsSeg (Branch a) Source # 
Instance details

Defined in Streamly.Internal.FileSystem.PosixPath.Seg

IsSeg (Rooted a) Source # 
Instance details

Defined in Streamly.Internal.FileSystem.PosixPath.Seg

Statically Verified Path Literals

Quasiquoters.

rt :: QuasiQuoter Source #

Generates a Rooted Path type from a quoted literal.

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

br :: QuasiQuoter Source #

Generates a Branch Path type from a quoted literal.

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

Statically Verified Path Strings

Template Haskell expression splices.

rtE :: String -> Q Exp Source #

Generates a Haskell expression of type Rooted PosixPath.

brE :: String -> Q Exp Source #

Generates a Haskell expression of type Branch PosixPath.

Operations

append :: (IsSeg (a PosixPath), IsPath PosixPath (a PosixPath)) => a PosixPath -> Branch PosixPath -> a PosixPath Source #

Append a Branch type path to a Rooted path or Branch path.

>>> Path.toString (Seg.append [rt|/usr|] [br|bin|] :: Rooted PosixPath)
"/usr/bin"
>>> Path.toString (Seg.append [br|usr|] [br|bin|] :: Branch PosixPath)
"usr/bin"