Safe Haskell | None |
---|---|
Language | Haskell2010 |
- getRootDir :: Zift (Path Abs Dir)
- getTmpDir :: Zift (Path Abs Dir)
- getSettings :: Zift Settings
- getSetting :: (Settings -> a) -> Zift a
- ziftP :: [Zift ()] -> Zift ()
- mapZ :: (a -> Zift b) -> [a] -> Zift [b]
- mapZ_ :: (a -> Zift b) -> [a] -> Zift ()
- forZ :: [a] -> (a -> Zift b) -> Zift [b]
- forZ_ :: [a] -> (a -> Zift b) -> Zift ()
- printZift :: String -> Zift ()
- printZiftMessage :: String -> Zift ()
- printPreprocessingDone :: String -> Zift ()
- printPreprocessingError :: String -> Zift ()
- printWithColors :: [SGR] -> String -> Zift ()
- addZiftOutput :: ZiftOutput -> Zift ()
- liftIO :: MonadIO m => forall a. IO a -> m a
- module Zifter.Zift.Types
Documentation
getRootDir :: Zift (Path Abs Dir) Source #
Get the root directory of the zift.hs
script that is being executed.
getTmpDir :: Zift (Path Abs Dir) Source #
Get the temporary directory of the zift.hs
script that is being executed.
To persist any state between runs, use this directory.
getSetting :: (Settings -> a) -> Zift a Source #
Get a single setting
ziftP :: [Zift ()] -> Zift () Source #
Declare a given list of Zift
actions to be execute in parallel.
mapZ :: (a -> Zift b) -> [a] -> Zift [b] Source #
Like mapA
, but specialised to Zift
and '[]', and ensures that the
output of actions is printed in the right order, even if they are
executed in an arbitrary order.
mapZ_ :: (a -> Zift b) -> [a] -> Zift () Source #
Like mapA_
, but specialised to Zift
and '[]', and ensures that the
output of actions is printed in the right order, even if they are
executed in an arbitrary order.
forZ :: [a] -> (a -> Zift b) -> Zift [b] Source #
Like for
, but specialised to Zift
and '[]', and ensures that the
output of actions is printed in the right order, even if they are
executed in an arbitrary order.
forZ_ :: [a] -> (a -> Zift b) -> Zift () Source #
Like for_
, but specialised to Zift
and '[]', and ensures that the output of
actions is printed in the right order.
printZiftMessage :: String -> Zift () Source #
Print a message (with a newline appended to the end), in the standard zift script color. This is the function that the zift script uses to output information about the stages of the zift script run.
printPreprocessingDone :: String -> Zift () Source #
Print a message (with a newline appended to the end) that signifies that a part of the processing is now done.
Example:
doThingZift :: Zift () doThingZift = do doThing printProcessingDone "doThing completed successfully."
printPreprocessingError :: String -> Zift () Source #
Print a message (with a newline appended to the end) that signifies that a part of the processing failed. This message will not cause the zift script run to fail.
Example:
doDangerousThing :: Zift () doDangerousThing = do errOrResult <- doThing case errOrResult of Left err -> printPreprocessingError $ unwords ["doThing failed with error:", err] fail "doThing failed." Right result -> do printPreprocessingDone unwords ["doThing succeeded with result:", result]
printWithColors :: [SGR] -> String -> Zift () Source #
Print a message (with a newline appended to the end) with custom colors.
See the ansi-terminal package for more details.
addZiftOutput :: ZiftOutput -> Zift () Source #
module Zifter.Zift.Types