within-0.0.1.1: A path within another path.

Safe HaskellNone
LanguageHaskell2010

Within

Synopsis

Documentation

newtype Within a t Source #

The Within type represents a relative Path inside a directory Path. The two halves can be manipulated independently.

Constructors

Within (Path a Dir, Path Rel t) 
Instances
Eq (Within a t) Source # 
Instance details

Defined in Within

Methods

(==) :: Within a t -> Within a t -> Bool #

(/=) :: Within a t -> Within a t -> Bool #

Show (Within a t) Source # 
Instance details

Defined in Within

Methods

showsPrec :: Int -> Within a t -> ShowS #

show :: Within a t -> String #

showList :: [Within a t] -> ShowS #

Generic (Within a t) Source # 
Instance details

Defined in Within

Associated Types

type Rep (Within a t) :: Type -> Type #

Methods

from :: Within a t -> Rep (Within a t) x #

to :: Rep (Within a t) x -> Within a t #

type Rep (Within a t) Source # 
Instance details

Defined in Within

type Rep (Within a t) = D1 (MetaData "Within" "Within" "within-0.0.1.1-FgzSa9ckXVj2rUZThceXL7" True) (C1 (MetaCons "Within" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Path a Dir, Path Rel t))))

fromWithin :: Within a t -> Path a t Source #

Convert a Within to a Path by joining it with a path separator.

toWithin :: Path a Dir -> Path Rel t -> Within a t Source #

Convert a directory Path and a relative Path to a Within

within :: Path Rel t -> Path a Dir -> Within a t Source #

Infix version of toWithin, e.g "file.txt `within` myDir"

asWithin :: MonadThrow m => Path a t -> Path a Dir -> m (Within a t) Source #

Attempts to convert a Path to a Within by treating it as if it were within the second argument. Used infix as "myParentDir/foo/file.txt `asWithin` myParentDir"

whatLiesWithin :: Within a t -> Path Rel t Source #

Extracts the inner path.

mapWithin :: (Path Rel s -> Path Rel t) -> Within a s -> Within a t Source #

Map the inner part of the Within value to a new Path.

mapWithinT :: MonadThrow m => (Path Rel s -> m (Path Rel t)) -> Within a s -> m (Within a t) Source #

Map the inner part of the Within value to a new Path with an operation that may throw.

moveWithin :: (Path a Dir -> Path b Dir) -> Within a t -> Within b t Source #

Map the outer part of a Within value via a function that changes the directory.

moveWithinT :: MonadThrow m => (Path a Dir -> m (Path b Dir)) -> Within a t -> m (Within b t) Source #

Map the outer part of a Within value via a function that changes the directory with an operation that may throw.

blinkWithin :: Path b Dir -> Within a t -> Within b t Source #

Switch the outer part of a Within value to a new directory immediately.

moveAndMapT :: MonadThrow m => (Path a Dir -> m (Path b Dir)) -> (Path Rel s -> m (Path Rel t)) -> Within a s -> m (Within b t) Source #

moveWithinT and mapWithinT simultaneously.

blinkAndMapT :: MonadThrow m => Path b Dir -> (Path Rel s -> m (Path Rel t)) -> Within a s -> m (Within b t) Source #

blinkWithin and mapWithinT simultaneously.