diff --git a/Ledger/LedgerTransaction.hs b/Ledger/LedgerTransaction.hs index a33d273ba..8d2261f23 100644 --- a/Ledger/LedgerTransaction.hs +++ b/Ledger/LedgerTransaction.hs @@ -77,7 +77,6 @@ showLedgerTransaction' elide t = showaccountname s = printf "%-34s" s showcomment s = if (length s) > 0 then " ; "++s else "" showstatus p = if pstatus p then "* " else "" - rstrip = reverse . dropWhile (== ' ') . reverse isLedgerTransactionBalanced :: LedgerTransaction -> Bool isLedgerTransactionBalanced (LedgerTransaction {ltpostings=ps}) = diff --git a/Ledger/Utils.hs b/Ledger/Utils.hs index ab10450c7..cd14e0347 100644 --- a/Ledger/Utils.hs +++ b/Ledger/Utils.hs @@ -48,7 +48,10 @@ import Text.ParserCombinators.Parsec lowercase = map toLower uppercase = map toUpper -strip = dropws . reverse . dropws . reverse where dropws = dropWhile (`elem` " \t") +strip = lstrip . rstrip +lstrip = dropws +rstrip = reverse . dropws . reverse +dropws = dropWhile (`elem` " \t") elideLeft width s = case length s > width of