-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Declare, construct and verify directory layout -- -- Language to express directory layouts @package directory-layout @version 0.3.0.0 -- | Wrappers around exception throwing functions and related routines module System.Directory.Layout.Errored -- | Information about cought exceptions in various routines data LayoutException -- | createDirectory exceptions CD :: IOErrorType -> FilePath -> LayoutException -- | createFile eceptions CF :: IOErrorType -> FilePath -> LayoutException -- | fileExists eceptions FE :: IOErrorType -> FilePath -> LayoutException -- | directoryExists eceptions DE :: IOErrorType -> FilePath -> LayoutException -- | readFile eceptions RF :: IOErrorType -> FilePath -> Text -> LayoutException -- | IO-exceptions-free createDirectory createDirectory :: MonadIO m => FilePath -> m (Either LayoutException ()) -- | IO-exceptions-free writeFile createFile :: MonadIO m => FilePath -> Maybe Text -> m (Either LayoutException ()) -- | doesFileExists that returns Either instead of -- Bool fileExists :: MonadIO m => FilePath -> m (Either LayoutException ()) -- | doesDirectoryExists that returns Either instead of -- Bool directoryExists :: MonadIO m => FilePath -> m (Either LayoutException ()) -- | IO-exceptions-free readFile readFile :: MonadIO m => FilePath -> Text -> m (Either LayoutException ()) -- | Log failures anyfail :: MonadWriter [w] m => m (Either w a) -> m () -- | Make paths in LayoutException relative to given FilePath relative :: FilePath -> LayoutException -> LayoutException instance Show LayoutException instance Eq LayoutException -- | Free monad based directory layouts module System.Directory.Layout.Internal -- | Representation of directory layouts -- -- Invariants: -- --
-- % tree -- . ---- -- and you've written simple layout: -- --
-- layout = do -- directory "baz" $ -- file_ "twey" -- directory "foo" $ do -- directory "bar" $ do -- file_ "quuz" -- file_ "tatata" -- file_ "quux" ---- -- then running it should result in this directory tree: -- --
-- % tree -- . -- ├── baz -- │ └── twey -- └── foo -- ├── bar -- │ ├── quuz -- │ └── tatata -- └── quux --make :: Layout -> FilePath -> IO [LayoutException] -- | Check directory layout agrees with specified one -- -- For example, suppose there is a tree: -- --
-- % tree -- . -- ├── baz -- │ └── twey -- └── foo -- ├── bar -- │ ├── quuz -- │ └── tatata -- └── quux ---- -- then you can write: -- --
-- layout = do -- directory "baz" $ -- file_ "twey" -- directory "foo" $ do -- directory "bar" $ do -- file_ "quuz" -- file_ "tatata" -- file_ "quux" ---- -- and running check layout "." should result in [] check :: Layout -> FilePath -> IO [LayoutException] -- | Control.Lens based extractors for DL module System.Directory.Layout.Lens -- | Get Text out of the current Layout (if possible) -- --
-- >>> layout ^? text -- Nothing -- -- >>> layout ^? file "foo" . text -- Just "not empty" -- -- >>> layout ^? directory "bar" . file "quux" . text -- Just "something" --text :: Prism Layout Layout Text Text -- | Look into the file in the current Layout (if possible) -- --
-- >>> layout ^? file "biz" -- Nothing -- -- >>> layout ^? file "swaks" -- Just (E ()) -- -- >>> layout ^? directory "bar" . file "baz" -- Just (E ()) --file :: FilePath -> IndexedTraversal' FilePath Layout Layout -- | Go into the directory in the current Layout (if possible) -- --
-- >>> layout ^? directory "foo" -- Nothing -- -- >>> layout ^? directory "bar" -- Just (F "baz" (E ()) (F "quux" (T "something" ()) (E ()))) --directory :: FilePath -> IndexedTraversal' FilePath Layout Layout -- | Language to express directory layouts module System.Directory.Layout -- | Representation of directory layouts -- -- Invariants: -- --
-- % tree -- . ---- -- and you've written simple layout: -- --
-- layout = do -- directory "baz" $ -- file_ "twey" -- directory "foo" $ do -- directory "bar" $ do -- file_ "quuz" -- file_ "tatata" -- file_ "quux" ---- -- then running it should result in this directory tree: -- --
-- % tree -- . -- ├── baz -- │ └── twey -- └── foo -- ├── bar -- │ ├── quuz -- │ └── tatata -- └── quux --make :: Layout -> FilePath -> IO [LayoutException] -- | Check directory layout agrees with specified one -- -- For example, suppose there is a tree: -- --
-- % tree -- . -- ├── baz -- │ └── twey -- └── foo -- ├── bar -- │ ├── quuz -- │ └── tatata -- └── quux ---- -- then you can write: -- --
-- layout = do -- directory "baz" $ -- file_ "twey" -- directory "foo" $ do -- directory "bar" $ do -- file_ "quuz" -- file_ "tatata" -- file_ "quux" ---- -- and running check layout "." should result in [] check :: Layout -> FilePath -> IO [LayoutException] -- | Information about cought exceptions in various routines data LayoutException -- | createDirectory exceptions CD :: IOErrorType -> FilePath -> LayoutException -- | createFile eceptions CF :: IOErrorType -> FilePath -> LayoutException -- | fileExists eceptions FE :: IOErrorType -> FilePath -> LayoutException -- | directoryExists eceptions DE :: IOErrorType -> FilePath -> LayoutException -- | readFile eceptions RF :: IOErrorType -> FilePath -> Text -> LayoutException