HORIZON HASKELLDocslts/ghc-9.14.x45dd5372026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · 45dd537 · 2026-10-11

Modulestreamly-core-0.3.1Haskell2010

Streamly.Internal.FileSystem.PosixPath.Seg

This module provides a type safe path append operation by distinguishing paths between rooted paths and branches. Rooted paths are represented by the Rooted PosixPath type and branches are represented by the Unrooted PosixPath type. Rooted paths are paths that are attached to specific roots in the file system. Rooted paths could be absolute or relative e.g. /usr/bin, ./local/bin, or .. Unrootedes are a paths that are not attached to a specific root e.g. usr/bin, local/bin, or ../bin are branches.

This distinction provides a safe path append operation which cannot fail. These types do not allow appending a rooted path to any other path. Only branches can be appended.

  • 2 types
  • 1 class
  • 5 values

Types

3 declarations
newtypenewtype Rooted a
#

Constructors

Instances4IsPath, IsSeg
newtypenewtype Unrooted a
#

Constructors

Instances4IsPath, IsSeg
classclass IsSeg a
#

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

Instances2IsSeg
  • IsSeg (Rooted a)Defined in streamly-core-0.3.1 · Streamly.Internal.FileSystem.PosixPath.Seg
  • IsSeg (Unrooted a)Defined in streamly-core-0.3.1 · Streamly.Internal.FileSystem.PosixPath.Seg

Statically Verified Path Literals

2 declarations

Quasiquoters.

valuert :: QuasiQuoter
#

Generates a Rooted Path type from a quoted literal.

Example1 expression
Path.toString (Path.toPath ([rt|/usr|] :: Rooted PosixPath))"/usr"
valueur :: QuasiQuoter
#

Generates a Unrooted Path type from a quoted literal.

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

Statically Verified Path Strings

2 declarations

Template Haskell expression splices.

valuertE :: String -> Q Exp
#

Generates a Haskell expression of type Rooted PosixPath.

valueurE :: String -> Q Exp
#

Generates a Haskell expression of type Unrooted PosixPath.

Operations

1 declaration