From 1e6f38eb4114c9552e57ecd71903e7b57af9389e Mon Sep 17 00:00:00 2001 From: "marko.kocic" Date: Tue, 22 Sep 2009 12:43:30 +0000 Subject: [PATCH] Hlint: Error: Use unless --- Commands/Add.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Commands/Add.hs b/Commands/Add.hs index cbaefa087..6348315cf 100644 --- a/Commands/Add.hs +++ b/Commands/Add.hs @@ -27,7 +27,7 @@ add _ args l hPutStrLn stderr "Enter one or more transactions, which will be added to your ledger file.\n\ \To complete a transaction, enter . as account name. To quit, enter control-d." - getAndAddTransactions l args `catch` (\e -> if isEOFError e then return () else ioError e) + getAndAddTransactions l args `catch` (\e -> unless (isEOFError e) $ ioError e) -- | Read a number of ledger transactions from the command line, -- prompting, validating, displaying and appending them to the ledger @@ -68,7 +68,7 @@ getTransaction l args = do hPutStrLn stderr $ "\n" ++ nonzerobalanceerror ++ ". Re-enter:" getpostingsandvalidate either (const retry) return $ balanceLedgerTransaction t - when (not $ null historymatches) + unless (null historymatches) (do hPutStrLn stderr "Similar transactions found, using the first for defaults:\n" hPutStr stderr $ concatMap (\(n,t) -> printf "[%3d%%] %s" (round $ n*100 :: Int) (show t)) $ take 3 historymatches)