-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | A path within another path.
--
-- Simple type for representing a well-typed path within another path.
-- Useful for when you need to jump between directories and change
-- filenames independently. Uses the path library.
@package within
@version 0.0.1.1
module Within
-- | The Within type represents a relative Path inside a
-- directory Path. The two halves can be manipulated
-- independently.
newtype Within a t
Within :: (Path a Dir, Path Rel t) -> Within a t
-- | Convert a Within to a Path by joining it with a path
-- separator.
fromWithin :: Within a t -> Path a t
-- | Convert a directory Path and a relative Path to a
-- Within
toWithin :: Path a Dir -> Path Rel t -> Within a t
-- | Infix version of toWithin, e.g "file.txt `within` myDir"
within :: Path Rel t -> Path a Dir -> Within a t
-- | 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"
asWithin :: MonadThrow m => Path a t -> Path a Dir -> m (Within a t)
-- | Extracts the inner path.
whatLiesWithin :: Within a t -> Path Rel t
-- | Map the inner part of the Within value to a new Path.
mapWithin :: (Path Rel s -> Path Rel t) -> Within a s -> Within a t
-- | Map the inner part of the Within value to a new Path
-- with an operation that may throw.
mapWithinT :: MonadThrow m => (Path Rel s -> m (Path Rel t)) -> Within a s -> m (Within a t)
-- | Map the outer part of a Within value via a function that
-- changes the directory.
moveWithin :: (Path a Dir -> Path b Dir) -> Within a t -> Within b t
-- | Map the outer part of a Within value via a function that
-- changes the directory with an operation that may throw.
moveWithinT :: MonadThrow m => (Path a Dir -> m (Path b Dir)) -> Within a t -> m (Within b t)
-- | Switch the outer part of a Within value to a new directory
-- immediately.
blinkWithin :: Path b Dir -> Within a t -> Within b t
-- | moveWithinT and mapWithinT simultaneously.
moveAndMapT :: MonadThrow m => (Path a Dir -> m (Path b Dir)) -> (Path Rel s -> m (Path Rel t)) -> Within a s -> m (Within b t)
-- | blinkWithin and mapWithinT simultaneously.
blinkAndMapT :: MonadThrow m => Path b Dir -> (Path Rel s -> m (Path Rel t)) -> Within a s -> m (Within b t)
instance GHC.Show.Show (Within.Within a t)
instance GHC.Classes.Eq (Within.Within a t)
instance GHC.Generics.Generic (Within.Within a t)