polysemy-path-0.1.0.0: Polysemy versions of Path functions.
LicenseMIT
Maintainerdan.firth@homotopic.tech
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Polysemy.Path

Description

Polysemy versions of functions in the path library.

Synopsis

Documentation

data Path b t #

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:

  1. File format: file.txt, foo/bar.txt, /foo/bar.txt
  2. Directory format: foo/, /foo/bar/

All directories end in a trailing separator. There are no duplicate path separators //, no .., no ./, no ~/, etc.

Instances

Instances details
(Typeable a, Typeable b) => Lift (Path a b :: Type) 
Instance details

Defined in Path.Internal

Methods

lift :: Path a b -> Q Exp #

liftTyped :: Path a b -> Q (TExp (Path a b)) #

Eq (Path b t)

String equality.

The following property holds:

show x == show y ≡ x == y
Instance details

Defined in Path.Internal

Methods

(==) :: Path b t -> Path b t -> Bool #

(/=) :: Path b t -> Path b t -> Bool #

(Data b, Data t) => Data (Path b t) 
Instance details

Defined in Path.Internal

Methods

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
Instance details

Defined in Path.Internal

Methods

compare :: Path b t -> Path b t -> Ordering #

(<) :: Path b t -> Path b t -> Bool #

(<=) :: Path b t -> Path b t -> Bool #

(>) :: Path b t -> Path b t -> Bool #

(>=) :: Path b t -> Path b t -> Bool #

max :: Path b t -> Path b t -> Path b t #

min :: Path b t -> Path b t -> Path b t #

Show (Path b t)

Same as 'show . Path.toFilePath'.

The following property holds:

x == y ≡ show x == show y
Instance details

Defined in Path.Internal

Methods

showsPrec :: Int -> Path b t -> ShowS #

show :: Path b t -> String #

showList :: [Path b t] -> ShowS #

Generic (Path b t) 
Instance details

Defined in Path.Internal

Associated Types

type Rep (Path b t) :: Type -> Type #

Methods

from :: Path b t -> Rep (Path b t) x #

to :: Rep (Path b t) x -> Path b t #

Hashable (Path b t) 
Instance details

Defined in Path.Internal

Methods

hashWithSalt :: Int -> Path b t -> Int #

hash :: Path b t -> Int #

ToJSON (Path b t) 
Instance details

Defined in Path.Internal

Methods

toJSON :: Path b t -> Value #

toEncoding :: Path b t -> Encoding #

toJSONList :: [Path b t] -> Value #

toEncodingList :: [Path b t] -> Encoding #

ToJSONKey (Path b t) 
Instance details

Defined in Path.Internal

FromJSON (Path Abs File) 
Instance details

Defined in Path.Posix

FromJSON (Path Abs Dir) 
Instance details

Defined in Path.Posix

FromJSON (Path Rel File) 
Instance details

Defined in Path.Posix

FromJSON (Path Rel Dir) 
Instance details

Defined in Path.Posix

FromJSONKey (Path Abs File) 
Instance details

Defined in Path.Posix

FromJSONKey (Path Abs Dir) 
Instance details

Defined in Path.Posix

FromJSONKey (Path Rel File) 
Instance details

Defined in Path.Posix

FromJSONKey (Path Rel Dir) 
Instance details

Defined in Path.Posix

NFData (Path b t) 
Instance details

Defined in Path.Internal

Methods

rnf :: Path b t -> () #

type Rep (Path b t) 
Instance details

Defined in Path.Internal

type Rep (Path b t) = D1 ('MetaData "Path" "Path.Internal" "path-0.8.0-2LBHz8sZbAC84Khi7s1CHN" 'True) (C1 ('MetaCons "Path" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath)))

data Rel #

A relative path; one without a root. Note that a .. path component to represent the parent directory is not allowed by this library.

Instances

Instances details
FromJSON (Path Rel File) 
Instance details

Defined in Path.Posix

FromJSON (Path Rel Dir) 
Instance details

Defined in Path.Posix

FromJSONKey (Path Rel File) 
Instance details

Defined in Path.Posix

FromJSONKey (Path Rel Dir) 
Instance details

Defined in Path.Posix

data Abs #

An absolute path.

Instances

Instances details
FromJSON (Path Abs File) 
Instance details

Defined in Path.Posix

FromJSON (Path Abs Dir) 
Instance details

Defined in Path.Posix

FromJSONKey (Path Abs File) 
Instance details

Defined in Path.Posix

FromJSONKey (Path Abs Dir) 
Instance details

Defined in Path.Posix

data File #

A file path.

Instances

Instances details
FromJSON (SomeBase File) 
Instance details

Defined in Path.Posix

FromJSON (Path Abs File) 
Instance details

Defined in Path.Posix

FromJSON (Path Rel File) 
Instance details

Defined in Path.Posix

FromJSONKey (Path Abs File) 
Instance details

Defined in Path.Posix

FromJSONKey (Path Rel File) 
Instance details

Defined in Path.Posix

data Dir #

A directory path.

Instances

Instances details
FromJSON (SomeBase Dir) 
Instance details

Defined in Path.Posix

FromJSON (Path Abs Dir) 
Instance details

Defined in Path.Posix

FromJSON (Path Rel Dir) 
Instance details

Defined in Path.Posix

FromJSONKey (Path Abs Dir) 
Instance details

Defined in Path.Posix

FromJSONKey (Path Rel Dir) 
Instance details

Defined in Path.Posix

data PathException #

Exceptions that can occur during path operations.

Since: path-0.6.0

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