aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/Processors.hs
diff options
context:
space:
mode:
authorpacien2019-12-27 10:32:35 +0100
committerpacien2019-12-27 10:32:35 +0100
commit6bc29b5db2c8de62e2d9f21c25fa8dcd1ec5a75b (patch)
treefcc5bfee9ae1c14f9d2e3c7a6d38e82825d14d10 /compiler/src/Processors.hs
parent015d793b25a3f0d1ff275ed42ec211dd6a532ca0 (diff)
downloadldgallery-6bc29b5db2c8de62e2d9f21c25fa8dcd1ec5a75b.tar.gz
compiler: extracting funcs
Diffstat (limited to 'compiler/src/Processors.hs')
-rw-r--r--compiler/src/Processors.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/src/Processors.hs b/compiler/src/Processors.hs
index a296215..aaa178f 100644
--- a/compiler/src/Processors.hs
+++ b/compiler/src/Processors.hs
@@ -73,7 +73,7 @@ type FileProcessor =
73 73
74copyFileProcessor :: FileProcessor 74copyFileProcessor :: FileProcessor
75copyFileProcessor inputPath outputPath = 75copyFileProcessor inputPath outputPath =
76 (putStrLn $ "Copying: " ++ outputPath) 76 (putStrLn $ "Copying:\t" ++ outputPath)
77 >> ensureParentDir (flip System.Directory.copyFile) outputPath inputPath 77 >> ensureParentDir (flip System.Directory.copyFile) outputPath inputPath
78 78
79eitherIOToIO :: Either String (IO a) -> IO a 79eitherIOToIO :: Either String (IO a) -> IO a
@@ -99,7 +99,7 @@ type StaticImageWriter = FilePath -> DynamicImage -> IO ()
99 99
100resizeStaticGeneric :: StaticImageReader -> StaticImageWriter -> Resolution -> FileProcessor 100resizeStaticGeneric :: StaticImageReader -> StaticImageWriter -> Resolution -> FileProcessor
101resizeStaticGeneric reader writer maxRes inputPath outputPath = 101resizeStaticGeneric reader writer maxRes inputPath outputPath =
102 (putStrLn $ "Generating: " ++ outputPath) 102 (putStrLn $ "Generating:\t" ++ outputPath)
103 >> reader inputPath 103 >> reader inputPath
104 >>= eitherResToIO 104 >>= eitherResToIO
105 >>= return . (fitDynamicImage maxRes) 105 >>= return . (fitDynamicImage maxRes)
@@ -142,7 +142,7 @@ withCached processor inputPath outputPath =
142 where 142 where
143 noop = return () 143 noop = return ()
144 update = processor inputPath outputPath 144 update = processor inputPath outputPath
145 skip = putStrLn $ "Skipping: " ++ outputPath 145 skip = putStrLn $ "Skipping:\t" ++ outputPath
146 146
147 isOutdated :: FilePath -> FilePath -> IO Bool 147 isOutdated :: FilePath -> FilePath -> IO Bool
148 isOutdated ref target = 148 isOutdated ref target =