fs-utils-0.1: FileSystem utils
Safe HaskellNone
LanguageGHC2021

FileSystem.Path

Description

Provides utilities for working with Path.

Since: 0.1

Synopsis

Pattern Synonym

pattern MkPath :: OsPath -> Path b t Source #

Pattern synonym for eliminating Path to OsPath.

Since: 0.1

QuasiQuoters

absdirPathSep :: QuasiQuoter Source #

Like absdir, except it runs paths through a "replace function" first. On unix, replaces \ with /. On windows, does the opposite.

Since: 0.1

absfilePathSep :: QuasiQuoter Source #

Like absfile, except it runs paths through a "replace function" first. On unix, replaces \ with /. On windows, does the opposite.

Since: 0.1

reldirPathSep :: QuasiQuoter Source #

Like reldir, except it runs paths through a "replace function" first. On unix, replaces \ with /. On windows, does the opposite.

Since: 0.1

relfilePathSep :: QuasiQuoter Source #

Like relfile, except it runs paths through a "replace function" first. On unix, replaces \ with /. On windows, does the opposite.

Since: 0.1

Operations

(<</>>) :: Path b Dir -> Path Rel t -> Path b t infixr 5 Source #

Alias for </>, intended to allow unqualified usage alongside OsPath's </>.

Since: 0.1

addExtension :: (HasCallStack, MonadThrow m) => OsPath -> Path b File -> m (Path b File) Source #

Like addExtension, but in terms of OsPath rather than system specific type.

Since: 0.1

splitExtension :: (HasCallStack, MonadThrow m) => Path b File -> m (Path b File, OsPath) Source #

Like splitExtension, but in terms of OsPath rather than system specific type.

Since: 0.1

fileExtension :: (HasCallStack, MonadThrow m) => Path b File -> m OsPath Source #

Like fileExtension, but in terms of OsPath rather than system specific type.

Since: 0.1

replaceExtension :: (HasCallStack, MonadThrow m) => OsPath -> Path b File -> m (Path b File) Source #

Like replaceExtension, but in terms of OsPath rather than system specific type.

Since: 0.1

Parsing

parseAbsDir :: (HasCallStack, MonadThrow m) => OsPath -> m (Path Abs Dir) Source #

Like parseAbsDir, but in terms of OsPath rather than system specific type.

Since: 0.1

parseAbsFile :: (HasCallStack, MonadThrow m) => OsPath -> m (Path Abs File) Source #

Like parseAbsFile, but in terms of OsPath rather than system specific type.

Since: 0.1

parseRelDir :: (HasCallStack, MonadThrow m) => OsPath -> m (Path Rel Dir) Source #

Like parseRelDir, but in terms of OsPath rather than system specific type.

Since: 0.1

parseRelFile :: (HasCallStack, MonadThrow m) => OsPath -> m (Path Rel File) Source #

Like parseRelFile, but in terms of OsPath rather than system specific type.

Since: 0.1

Elimination

toOsPath :: Path b t -> OsPath Source #

Path to OsPath.

Since: 0.1

Re-exports

data Path b t #

Instances

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

Defined in OsPath.Internal.Posix

Methods

lift :: Quote m => Path b t -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => Path b t -> Code m (Path b t) #

NFData (Path b t) 
Instance details

Defined in OsPath.Internal.Posix

Methods

rnf :: Path b t -> () #

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

Defined in OsPath.Internal.Posix

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) #

Generic (Path b t) 
Instance details

Defined in OsPath.Internal.Posix

Associated Types

type Rep (Path b t) 
Instance details

Defined in OsPath.Internal.Posix

type Rep (Path b t) = D1 ('MetaData "Path" "OsPath.Internal.Posix" "path-0.9.6-8lSkXVZq0YHIsussDki9Tp" 'True) (C1 ('MetaCons "Path" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PosixPath)))

Methods

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

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

Show (Path b t) 
Instance details

Defined in OsPath.Internal.Posix

Methods

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

show :: Path b t -> String #

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

Eq (Path b t) 
Instance details

Defined in OsPath.Internal.Posix

Methods

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

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

Ord (Path b t) 
Instance details

Defined in OsPath.Internal.Posix

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 #

Hashable (Path b t) 
Instance details

Defined in OsPath.Internal.Posix

Methods

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

hash :: Path b t -> Int Source #

type Rep (Path b t) 
Instance details

Defined in OsPath.Internal.Posix

type Rep (Path b t) = D1 ('MetaData "Path" "OsPath.Internal.Posix" "path-0.9.6-8lSkXVZq0YHIsussDki9Tp" 'True) (C1 ('MetaCons "Path" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PosixPath)))

data Abs #

Instances

Instances details
Data Abs 
Instance details

Defined in OsPath.Posix

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Abs -> c Abs #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Abs #

toConstr :: Abs -> Constr #

dataTypeOf :: Abs -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Abs) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Abs) #

gmapT :: (forall b. Data b => b -> b) -> Abs -> Abs #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Abs -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Abs -> r #

gmapQ :: (forall d. Data d => d -> u) -> Abs -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Abs -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Abs -> m Abs #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Abs -> m Abs #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Abs -> m Abs #

data Rel #

Instances

Instances details
Data Rel 
Instance details

Defined in OsPath.Posix

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Rel -> c Rel #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Rel #

toConstr :: Rel -> Constr #

dataTypeOf :: Rel -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Rel) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Rel) #

gmapT :: (forall b. Data b => b -> b) -> Rel -> Rel #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Rel -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Rel -> r #

gmapQ :: (forall d. Data d => d -> u) -> Rel -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Rel -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Rel -> m Rel #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Rel -> m Rel #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Rel -> m Rel #

data Dir #

Instances

Instances details
Data Dir 
Instance details

Defined in OsPath.Posix

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Dir -> c Dir #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Dir #

toConstr :: Dir -> Constr #

dataTypeOf :: Dir -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Dir) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Dir) #

gmapT :: (forall b. Data b => b -> b) -> Dir -> Dir #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Dir -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Dir -> r #

gmapQ :: (forall d. Data d => d -> u) -> Dir -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Dir -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Dir -> m Dir #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Dir -> m Dir #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Dir -> m Dir #

data File #

Instances

Instances details
Data File 
Instance details

Defined in OsPath.Posix

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> File -> c File #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c File #

toConstr :: File -> Constr #

dataTypeOf :: File -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c File) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c File) #

gmapT :: (forall b. Data b => b -> b) -> File -> File #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> File -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> File -> r #

gmapQ :: (forall d. Data d => d -> u) -> File -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> File -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> File -> m File #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> File -> m File #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> File -> m File #