License | MIT |
---|---|
Maintainer | dan.firth@homotopic.tech |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Polysemy versions of functions in the path library.
Synopsis
- data Path b t
- data Rel
- data Abs
- data File
- data Dir
- data PathException
- parseRelFile :: Members '[Error PathException] r => FilePath -> Sem r (Path Rel File)
- parseAbsFile :: Members '[Error PathException] r => FilePath -> Sem r (Path Abs File)
- parseRelDir :: Members '[Error PathException] r => FilePath -> Sem r (Path Rel Dir)
- parseAbsDir :: Members '[Error PathException] r => FilePath -> Sem r (Path Abs Dir)
- stripProperPrefix :: Members '[Error PathException] r => Path b Dir -> Path b t -> Sem r (Path Rel t)
Documentation
Path of some base and type.
The type variables are:
b
— base, the base location of the path; absolute or relative.t
— type, whether file or directory.
Internally is a string. The string can be of two formats only:
- File format:
file.txt
,foo/bar.txt
,/foo/bar.txt
- Directory format:
foo/
,/foo/bar/
All directories end in a trailing separator. There are no duplicate
path separators //
, no ..
, no ./
, no ~/
, etc.
Instances
(Typeable a, Typeable b) => Lift (Path a b :: Type) | |
Eq (Path b t) | String equality. The following property holds: show x == show y ≡ x == y |
(Data b, Data t) => Data (Path b t) | |
Defined in Path.Internal gfoldl :: (forall d b0. Data d => c (d -> b0) -> d -> c b0) -> (forall g. g -> c g) -> Path b t -> c (Path b t) # gunfold :: (forall b0 r. Data b0 => c (b0 -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Path b t) # toConstr :: Path b t -> Constr # dataTypeOf :: Path b t -> DataType # dataCast1 :: Typeable t0 => (forall d. Data d => c (t0 d)) -> Maybe (c (Path b t)) # dataCast2 :: Typeable t0 => (forall d e. (Data d, Data e) => c (t0 d e)) -> Maybe (c (Path b t)) # gmapT :: (forall b0. Data b0 => b0 -> b0) -> Path b t -> Path b t # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Path b t -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Path b t -> r # gmapQ :: (forall d. Data d => d -> u) -> Path b t -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Path b t -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Path b t -> m (Path b t) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Path b t -> m (Path b t) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Path b t -> m (Path b t) # | |
Ord (Path b t) | String ordering. The following property holds: show x `compare` show y ≡ x `compare` y |
Defined in Path.Internal | |
Show (Path b t) | Same as 'show . Path.toFilePath'. The following property holds: x == y ≡ show x == show y |
Generic (Path b t) | |
Hashable (Path b t) | |
Defined in Path.Internal | |
ToJSON (Path b t) | |
Defined in Path.Internal | |
ToJSONKey (Path b t) | |
Defined in Path.Internal toJSONKey :: ToJSONKeyFunction (Path b t) # toJSONKeyList :: ToJSONKeyFunction [Path b t] # | |
FromJSON (Path Abs File) | |
FromJSON (Path Abs Dir) | |
FromJSON (Path Rel File) | |
FromJSON (Path Rel Dir) | |
FromJSONKey (Path Abs File) | |
Defined in Path.Posix | |
FromJSONKey (Path Abs Dir) | |
Defined in Path.Posix | |
FromJSONKey (Path Rel File) | |
Defined in Path.Posix | |
FromJSONKey (Path Rel Dir) | |
Defined in Path.Posix | |
NFData (Path b t) | |
Defined in Path.Internal | |
type Rep (Path b t) | |
Defined in Path.Internal |
A relative path; one without a root. Note that a ..
path component to
represent the parent directory is not allowed by this library.
Instances
FromJSON (Path Rel File) | |
FromJSON (Path Rel Dir) | |
FromJSONKey (Path Rel File) | |
Defined in Path.Posix | |
FromJSONKey (Path Rel Dir) | |
Defined in Path.Posix |
An absolute path.
Instances
FromJSON (Path Abs File) | |
FromJSON (Path Abs Dir) | |
FromJSONKey (Path Abs File) | |
Defined in Path.Posix | |
FromJSONKey (Path Abs Dir) | |
Defined in Path.Posix |
A file path.
A directory path.
data PathException #
Exceptions that can occur during path operations.
Since: path-0.6.0
Instances
Eq PathException | |
Defined in Path.Posix (==) :: PathException -> PathException -> Bool # (/=) :: PathException -> PathException -> Bool # | |
Show PathException | |
Defined in Path.Posix showsPrec :: Int -> PathException -> ShowS # show :: PathException -> String # showList :: [PathException] -> ShowS # | |
Exception PathException | |
Defined in Path.Posix |
parseRelFile :: Members '[Error PathException] r => FilePath -> Sem r (Path Rel File) Source #
Polysemy version of parseRelFile
.
Since: 0.1.0.0
parseAbsFile :: Members '[Error PathException] r => FilePath -> Sem r (Path Abs File) Source #
Polysemy version of parseAbsFile
.
Since: 0.1.0.0
parseRelDir :: Members '[Error PathException] r => FilePath -> Sem r (Path Rel Dir) Source #
Polysemy version of parseRelDir
.
Since: 0.1.0.0
parseAbsDir :: Members '[Error PathException] r => FilePath -> Sem r (Path Abs Dir) Source #
Polysemy version of parseAbsDir
.
Since: 0.1.0.0
stripProperPrefix :: Members '[Error PathException] r => Path b Dir -> Path b t -> Sem r (Path Rel t) Source #
Polysemy version of stripProperPrefix
.
Since: 0.1.0.0