From b42298c1e2931c5754c607420d5f70ad8711193b Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Tue, 15 Jul 2014 06:55:14 -0700 Subject: [PATCH] web: fix warnings --- hledger-web/Handler/JournalEditR.hs | 1 - hledger-web/Handler/Post.hs | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/hledger-web/Handler/JournalEditR.hs b/hledger-web/Handler/JournalEditR.hs index 4d890c6dd..63332dfcb 100644 --- a/hledger-web/Handler/JournalEditR.hs +++ b/hledger-web/Handler/JournalEditR.hs @@ -6,7 +6,6 @@ import Import import Handler.Common import Handler.Post -import Handler.Utils -- | The journal editform, no sidebar. diff --git a/hledger-web/Handler/Post.hs b/hledger-web/Handler/Post.hs index b8dec6955..3bc388828 100644 --- a/hledger-web/Handler/Post.hs +++ b/hledger-web/Handler/Post.hs @@ -65,17 +65,17 @@ handleAdd = do , isRight en , let Right n = en ] - num = length acctparams - paramErrs | not $ length amtparams `elem` [num, num-1] = ["different number of account and amount parameters"] + num' = length acctparams + paramErrs | not $ length amtparams `elem` [num', num'-1] = ["different number of account and amount parameters"] | otherwise = catMaybes - [if map fst acctparams == [1..num] then Nothing else Just "misnumbered account parameters" - ,if map fst amtparams == [1..num] || map fst amtparams == [1..(num-1)] then Nothing else Just "misnumbered amount parameters" + [if map fst acctparams == [1..num'] then Nothing else Just "misnumbered account parameters" + ,if map fst amtparams == [1..num'] || map fst amtparams == [1..(num'-1)] then Nothing else Just "misnumbered amount parameters" ] eaccts = map (parsewith (accountnamep <* eof) . strip . T.unpack . snd) acctparams eamts = map (parseWithCtx nullctx (amountp <* eof) . strip . T.unpack . snd) amtparams (accts, acctErrs) = (rights eaccts, map show $ lefts eaccts) (amts', amtErrs) = (rights eamts, map show $ lefts eamts) - amts | length amts' == num = amts' + amts | length amts' == num' = amts' | otherwise = amts' ++ [missingamt] -- if no errors so far, generate a transaction and balance it or get the error.