| Safe Haskell | Safe |
|---|---|
| Language | Haskell2010 |
Hscaffold.Interpreter.IO
- runHscaffold :: MonadIO m => FilePath -> WriterT ScaffoldActionV m a -> m a
- runHscaffoldIO :: FilePath -> ScaffoldMonadIO a -> IO a
- runAction :: FilePath -> ScaffoldActionType e -> IO ()
- withTemporaryHscaffold :: (MonadMask m, MonadIO m) => ScaffoldMonadT m a -> (FilePath -> m b) -> m b
- withTemporaryHscaffold' :: (MonadMask m, MonadIO m) => String -> ScaffoldMonadT m a -> (FilePath -> m b) -> m b
- withTemporaryHscaffoldIO :: ScaffoldMonadIO a -> (FilePath -> IO b) -> IO b
- withTemporaryHscaffoldIO' :: String -> ScaffoldMonadIO a -> (FilePath -> IO b) -> IO b
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\""
runHscaffoldIO :: FilePath -> ScaffoldMonadIO a -> IO a Source #
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
)
withTemporaryHscaffold' :: (MonadMask m, MonadIO m) => String -> ScaffoldMonadT m a -> (FilePath -> m b) -> m b Source #
withTemporaryHscaffoldIO :: ScaffoldMonadIO a -> (FilePath -> IO b) -> IO b Source #
withTemporaryHscaffoldIO' :: String -> ScaffoldMonadIO a -> (FilePath -> IO b) -> IO b Source #