-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A value within another path. -- -- Simple newtype for representing a value within a well-typed directory. -- Useful for when you need to jump between directories and change -- filenames independently. Uses the path library. @package within @version 0.2.0.0 -- | License : MIT Stability : experimental -- -- The Within type, an EnvT comonad specialised to `Path b Dir`. module Within -- | The Within Type, newtype wrapper around EnvT specialised to a -- `Path b Dir` environment. newtype WithinT b w a WithinT :: EnvT (Path b Dir) w a -> WithinT b w a type Within b a = WithinT b Identity a -- | Change the parent directory of a Within value. localDir :: (Path b Dir -> Path c Dir) -> WithinT b w a -> WithinT c w a -- | Change the parent directory of a Within value, monadic verison. localDirM :: Monad m => (Path b Dir -> m (Path c Dir)) -> WithinT b w a -> m (WithinT c w a) -- | Treat a Path as if it lies within another directory and returns -- a Within value. Used infix like -- --
--   >>> $(mkRelFile "foo/a.txt") `asWithin` $(mkRelDir "foo")
--   
asWithin :: MonadThrow m => Path a t -> Path a Dir -> m (Within a (Path Rel t)) -- | Put a value inside a directory. -- --
--   >>> $(mkRelFile "a.txt") `within` $(mkRelDir "foo")
--   
within :: a -> Path b Dir -> Within b a -- | Turns a Within containing a PathLike into a single -- Path. fromWithin :: PathLike Rel t a => Within b a -> Path b t -- | Switch the outer part of a Within value to a new directory, -- synonym for localDir . const blinkLocalDir :: Path b Dir -> WithinT a w t -> WithinT b w t -- | Switch the outer part of a Within value to a new directory and -- map the inner at the same time. blinkAndMap :: Functor w => Path b Dir -> (s -> t) -> WithinT a w s -> WithinT b w t -- | Switch the outer part of a Within value to a new directory and -- mapM the inner at the same time. blinkAndMapM :: (Monad m, Traversable w) => Path b Dir -> (s -> m t) -> WithinT a w s -> m (WithinT b w t) -- | mapM the outer and inner part of a Within value at the same -- time. localDirAndMapM :: (Monad m, Traversable w) => (Path b Dir -> m (Path c Dir)) -> (s -> m t) -> WithinT b w s -> m (WithinT c w t) instance Data.Traversable.Traversable w => Data.Traversable.Traversable (Within.WithinT b w) instance Data.Foldable.Foldable w => Data.Foldable.Foldable (Within.WithinT b w) instance GHC.Base.Functor w => GHC.Base.Functor (Within.WithinT b w) instance GHC.Generics.Generic (Within.WithinT b w a) instance Path.Like.PathLike Path.Posix.Rel t a => Path.Like.PathLike b t (Within.Within b a) instance Path.Like.FileLike Path.Posix.Rel a => Path.Like.FileLike b (Within.Within b a) instance Path.Like.DirLike Path.Posix.Rel a => Path.Like.DirLike b (Within.Within b a) instance GHC.Classes.Eq t => GHC.Classes.Eq (Within.Within b t) instance Data.Hashable.Class.Hashable t => Data.Hashable.Class.Hashable (Within.Within b t) instance GHC.Show.Show t => GHC.Show.Show (Within.Within b t) instance GHC.Classes.Ord t => GHC.Classes.Ord (Within.Within b t) instance Control.Comonad.Comonad w => Control.Comonad.Comonad (Within.WithinT b w) instance Control.Comonad.Comonad w => Control.Comonad.Env.Class.ComonadEnv (Path.Internal.Path b Path.Posix.Dir) (Within.WithinT b w) instance Control.Comonad.Trans.Class.ComonadTrans (Within.WithinT b)