De-duplicate code
This commit is contained in:
parent
544b02c3a6
commit
fd3e5f6986
|
@ -74,6 +74,11 @@ runFunction f input = genDependency (makeDependency input (Function f))
|
|||
runFunctionIO :: FunctionIO -> Token a -> DepGenM' b
|
||||
runFunctionIO f input = genDependency (makeDependency input (FunctionIO f))
|
||||
|
||||
runFunctionIO' :: FunctionIO -> Token a -> DepGenM ()
|
||||
runFunctionIO' f input = do
|
||||
_ <- runFunctionIO f input
|
||||
pure ()
|
||||
|
||||
mapDepGenM :: (Token a -> DepGenM' b) -> Token [a] -> DepGenM' [b]
|
||||
mapDepGenM f input = genDependencyM $ \target -> do
|
||||
top <- get
|
||||
|
@ -114,19 +119,13 @@ readTemplate :: Token FilePath -> DepGenM' Template
|
|||
readTemplate = runFunctionIO ReadTemplate
|
||||
|
||||
convertImage :: Token ((FilePath, FilePath), ImageConversionSettings) -> DepGenM ()
|
||||
convertImage input = do
|
||||
_ <- runFunctionIO ConvertImage input
|
||||
pure ()
|
||||
convertImage = runFunctionIO' ConvertImage
|
||||
|
||||
saveFile :: Token (String, FilePath) -> DepGenM ()
|
||||
saveFile input = do
|
||||
_ <- runFunctionIO SaveFile input
|
||||
pure ()
|
||||
saveFile = runFunctionIO' SaveFile
|
||||
|
||||
makeDir :: Token FilePath -> DepGenM ()
|
||||
makeDir input = do
|
||||
_ <- runFunctionIO MakeDir input
|
||||
pure ()
|
||||
makeDir = runFunctionIO' MakeDir
|
||||
|
||||
runPandoc :: Token FilePath -> DepGenM' String
|
||||
runPandoc = runFunctionIO RunPandoc
|
||||
|
|
Loading…
Reference in New Issue