From b757ee814c01c83b17b495c4805fcc70d7e08c89 Mon Sep 17 00:00:00 2001 From: pacien Date: Mon, 3 Feb 2020 15:08:46 +0100 Subject: compiler: simplify checks --- compiler/src/Processors.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'compiler/src/Processors.hs') diff --git a/compiler/src/Processors.hs b/compiler/src/Processors.hs index 6ab4eb5..faa2f43 100644 --- a/compiler/src/Processors.hs +++ b/compiler/src/Processors.hs @@ -25,6 +25,7 @@ module Processors import Control.Exception (Exception, throwIO) +import Control.Monad (when) import Data.Function ((&)) import Data.Char (toLower) import Data.List (break) @@ -106,7 +107,7 @@ withCached :: Cache withCached processor inputPath outputPath = do isDir <- doesDirectoryExist outputPath - if isDir then removePathForcibly outputPath else noop + when isDir $ removePathForcibly outputPath fileExists <- doesFileExist outputPath if fileExists then @@ -117,7 +118,6 @@ withCached processor inputPath outputPath = update where - noop = return () update = processor inputPath outputPath skip = putStrLn $ "Skipping:\t" ++ outputPath -- cgit v1.2.3