rstrip, lstrip

This commit is contained in:
Simon Michael 2009-04-10 04:59:43 +00:00
parent 1085d476f1
commit ac307957e5
2 changed files with 4 additions and 2 deletions

View File

@ -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}) =

View File

@ -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