diff options
author | pacien | 2019-12-27 10:32:35 +0100 |
---|---|---|
committer | pacien | 2019-12-27 10:32:35 +0100 |
commit | 6bc29b5db2c8de62e2d9f21c25fa8dcd1ec5a75b (patch) | |
tree | fcc5bfee9ae1c14f9d2e3c7a6d38e82825d14d10 /compiler/src/Processors.hs | |
parent | 015d793b25a3f0d1ff275ed42ec211dd6a532ca0 (diff) | |
download | ldgallery-6bc29b5db2c8de62e2d9f21c25fa8dcd1ec5a75b.tar.gz |
compiler: extracting funcs
Diffstat (limited to 'compiler/src/Processors.hs')
-rw-r--r-- | compiler/src/Processors.hs | 6 |
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 | ||
74 | copyFileProcessor :: FileProcessor | 74 | copyFileProcessor :: FileProcessor |
75 | copyFileProcessor inputPath outputPath = | 75 | copyFileProcessor 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 | ||
79 | eitherIOToIO :: Either String (IO a) -> IO a | 79 | eitherIOToIO :: Either String (IO a) -> IO a |
@@ -99,7 +99,7 @@ type StaticImageWriter = FilePath -> DynamicImage -> IO () | |||
99 | 99 | ||
100 | resizeStaticGeneric :: StaticImageReader -> StaticImageWriter -> Resolution -> FileProcessor | 100 | resizeStaticGeneric :: StaticImageReader -> StaticImageWriter -> Resolution -> FileProcessor |
101 | resizeStaticGeneric reader writer maxRes inputPath outputPath = | 101 | resizeStaticGeneric 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 = |