From e770a350d67aafcfcf0c8ed64f11bc459a1e50e0 Mon Sep 17 00:00:00 2001 From: "Niels G. W. Serup" Date: Thu, 26 Sep 2024 00:06:30 +0200 Subject: [PATCH] Avoid extra untupling in this case for now --- byg/src/DependencyGenerator.hs | 4 ++++ byg/src/SiteGenerator.hs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/byg/src/DependencyGenerator.hs b/byg/src/DependencyGenerator.hs index b7dd983..6aff418 100644 --- a/byg/src/DependencyGenerator.hs +++ b/byg/src/DependencyGenerator.hs @@ -26,6 +26,7 @@ module DependencyGenerator , convertImage , saveFile , copyFile + , copyFile' , makeDir , runPandoc ) where @@ -204,6 +205,9 @@ copyFile (a, b) = do b' <- toToken b runFunctionIO' CopyFile $ TupleToken (a', b') +copyFile' :: Token (FilePath, FilePath) -> DepGenM () +copyFile' = runFunctionIO' CopyFile + makeDir :: TokenableTo FilePath a => a -> DepGenM () makeDir a = runFunctionIO' MakeDir =<< toToken a diff --git a/byg/src/SiteGenerator.hs b/byg/src/SiteGenerator.hs index 20b2de3..719f949 100644 --- a/byg/src/SiteGenerator.hs +++ b/byg/src/SiteGenerator.hs @@ -17,7 +17,7 @@ handleRecipeDir outputDir template indexName dir = do imageFilenames <- filterDepGenM areImageFilenames dirContents imagePaths <- mapDepGenM (curry joinPaths dir) imageFilenames imagePathsOut <- mapDepGenM (curry joinPaths outputDir) imageFilenames - mapDepGenM_ ((copyFile =<<) . untupleDepGenM) (ZipToken (imagePaths, imagePathsOut)) + mapDepGenM_ copyFile' (ZipToken (imagePaths, imagePathsOut)) thumbnailImagePaths <- mapDepGenM (thumbnailImagePath outputDir) imageFilenames mapDepGenM_ (\files -> convertImage (files, inject $ ResizeToWidth 800))