Streamly.Internal.FileSystem.WindowsPath.Node
This module provides a type safe path append operation by distinguishing
paths between files and directories. Files are represented by the File
WindowsPath
type and directories are represented by the Dir WindowsPath
type.
This distinction provides safety against appending a path to a file. Append
operation allows appending to only Dir
types.
Types
Constructors
File a |
Instances
IsPath WindowsPath (File WindowsPath) Source # | |
Defined in Streamly.Internal.FileSystem.WindowsPath.Node Methods unsafeFromPath :: WindowsPath -> File WindowsPath Source # fromPath :: MonadThrow m => WindowsPath -> m (File WindowsPath) Source # toPath :: File WindowsPath -> WindowsPath Source # | |
IsPath WindowsPath (Branch (File WindowsPath)) Source # | |
Defined in Streamly.Internal.FileSystem.WindowsPath.SegNode Methods unsafeFromPath :: WindowsPath -> Branch (File WindowsPath) Source # fromPath :: MonadThrow m => WindowsPath -> m (Branch (File WindowsPath)) Source # toPath :: Branch (File WindowsPath) -> WindowsPath Source # | |
IsPath WindowsPath (Rooted (File WindowsPath)) Source # | |
Defined in Streamly.Internal.FileSystem.WindowsPath.SegNode Methods unsafeFromPath :: WindowsPath -> Rooted (File WindowsPath) Source # fromPath :: MonadThrow m => WindowsPath -> m (Rooted (File WindowsPath)) Source # toPath :: Rooted (File WindowsPath) -> WindowsPath Source # | |
IsNode (File a) Source # | |
Constructors
Dir a |
Instances
IsPath WindowsPath (Dir WindowsPath) Source # | |
Defined in Streamly.Internal.FileSystem.WindowsPath.Node Methods unsafeFromPath :: WindowsPath -> Dir WindowsPath Source # fromPath :: MonadThrow m => WindowsPath -> m (Dir WindowsPath) Source # toPath :: Dir WindowsPath -> WindowsPath Source # | |
IsPath WindowsPath (Branch (Dir WindowsPath)) Source # | |
Defined in Streamly.Internal.FileSystem.WindowsPath.SegNode Methods unsafeFromPath :: WindowsPath -> Branch (Dir WindowsPath) Source # fromPath :: MonadThrow m => WindowsPath -> m (Branch (Dir WindowsPath)) Source # toPath :: Branch (Dir WindowsPath) -> WindowsPath Source # | |
IsPath WindowsPath (Rooted (Dir WindowsPath)) Source # | |
Defined in Streamly.Internal.FileSystem.WindowsPath.SegNode Methods unsafeFromPath :: WindowsPath -> Rooted (Dir WindowsPath) Source # fromPath :: MonadThrow m => WindowsPath -> m (Rooted (Dir WindowsPath)) Source # toPath :: Rooted (Dir WindowsPath) -> WindowsPath Source # | |
IsNode (Dir a) Source # | |
Statically Verified Path Literals
Quasiquoters.
dir :: QuasiQuoter Source #
Generates a Dir WindowsPath
type from a quoted literal.
>>>
Path.toString ([dir|usr|] :: Dir PosixPath)
"usr"
file :: QuasiQuoter Source #
Generates a File WindowsPath
type from a quoted literal.
>>>
Path.toString ([file|usr|] :: File PosixPath)
"usr"
Statically Verified Path Strings
Template Haskell expression splices.
Operations
append :: (IsPath WindowsPath (a WindowsPath), IsNode (a WindowsPath)) => Dir WindowsPath -> a WindowsPath -> a WindowsPath Source #