HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

Modulestreamly-core-0.3.1Haskell2010

Streamly.Internal.FileSystem.WindowsPath.SegNode

When Rooted/Unrooted and File/Dir both are present, Rooted/Unrooted 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.

Contents
  1. Statically Verified Path Literals
  2. Statically Verified Path Strings
  3. Operations
Synopsis

Statically Verified Path Literals

Quasiquoters.

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

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

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

Example1 expression
Path.toString (Path.toPath ([urdir|usr|] :: Unrooted (Dir PosixPath)))"usr"

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

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

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

Example1 expression
Path.toString (Path.toPath ([urfile|x.txt|] :: Unrooted (File PosixPath)))"x.txt"

Statically Verified Path Strings

Template Haskell expression splices.

Operations

Append a branch type path to a directory.

Example4 expressions
Path.toString (Path.toPath (SegNode.join [rtdir|/usr|] [urdir|bin|] :: Rooted (Dir PosixPath)))"/usr/bin"Path.toString (Path.toPath (SegNode.join [rtdir|/usr|] [urfile|bin|] :: Rooted (File PosixPath)))"/usr/bin"Path.toString (Path.toPath (SegNode.join [urdir|usr|] [urdir|bin|] :: Unrooted (Dir PosixPath)))"usr/bin"Path.toString (Path.toPath (SegNode.join [urdir|usr|] [urfile|bin|] :: Unrooted (File PosixPath)))"usr/bin"

Orphan instances

4 instances