hscaffold-0.4.5.0: Very simple file/directory structure scaffolding writer monad EDSL

Safe HaskellSafe
LanguageHaskell2010

Hscaffold.Interpreter.IO

Synopsis

Documentation

runHscaffold :: MonadIO m => FilePath -> WriterT ScaffoldActionV m a -> m a Source #

Run the scaffolding writer on the IO monad with no extensions

runHscaffold "." $ do
    file "./.gitignore" (Text.unlines [ ".stack-work"
                                      , "stuff"
                                      , "here"
                                      ])
    directory "./src" $ do
        file "./Main.hs" "main = putStrLn \"Hello World\""
        file "./Other.hs" "other = putStrLn \"Hello You\""

runAction :: FilePath -> ScaffoldActionType e -> IO () Source #

Run a single scaffolding action on the IO monad with no extensions

withTemporaryHscaffold :: (MonadMask m, MonadIO m) => ScaffoldMonadT m a -> (FilePath -> m b) -> m b Source #

Creates a temporary directory with the scaffold and runs an action that takes it as its argument.

Uses withSystemTempDirectory under the hood.

withTemporaryHscaffold
    (do
        file "something" "something"
        directory "something" $ file "something-else" "something"
    )
    (tmp -> do
        undefined
    )