haddock fixes

This commit is contained in:
Simon Michael 2008-10-01 11:44:47 +00:00
parent bf136fae5c
commit b90c015d9a
2 changed files with 9 additions and 9 deletions

View File

@ -63,9 +63,9 @@ cacheLedger pats l =
Ledger l' ant amap lprecision Ledger l' ant amap lprecision
-- | keep only entries whose description matches one of the -- | keep only entries whose description matches one of the
-- | description patterns, if any, and which have at least one -- description patterns, if any, and which have at least one
-- | transaction matching one of the account patterns, if any. -- transaction matching one of the account patterns, if any.
-- | No description or account patterns implies match all. -- No description or account patterns implies match all.
filterLedgerEntries :: (Regex,Regex) -> LedgerFile -> LedgerFile filterLedgerEntries :: (Regex,Regex) -> LedgerFile -> LedgerFile
filterLedgerEntries (acctpat,descpat) (LedgerFile ms ps es f) = filterLedgerEntries (acctpat,descpat) (LedgerFile ms ps es f) =
LedgerFile ms ps filteredentries f LedgerFile ms ps filteredentries f
@ -82,8 +82,8 @@ filterLedgerEntries (acctpat,descpat) (LedgerFile ms ps es f) =
otherwise -> True otherwise -> True
-- | in each ledger entry, filter out transactions which do not match -- | in each ledger entry, filter out transactions which do not match
-- | the account patterns, if any. (Entries are no longer balanced -- the account patterns, if any. (Entries are no longer balanced
-- | after this.) -- after this.)
filterLedgerTransactions :: (Regex,Regex) -> LedgerFile -> LedgerFile filterLedgerTransactions :: (Regex,Regex) -> LedgerFile -> LedgerFile
filterLedgerTransactions (acctpat,descpat) (LedgerFile ms ps es f) = filterLedgerTransactions (acctpat,descpat) (LedgerFile ms ps es f) =
LedgerFile ms ps (map filterentrytxns es) f LedgerFile ms ps (map filterentrytxns es) f

View File

@ -73,16 +73,16 @@ tildeExpand xs = return xs
-- -- courtesy of allberry_b -- -- courtesy of allberry_b
-- | ledger pattern arguments are: 0 or more account patterns -- | ledger pattern arguments are: 0 or more account patterns
-- | optionally followed by -- and 0 or more description patterns. -- optionally followed by -- and 0 or more description patterns.
-- | No arguments implies match all. We convert the arguments to -- No arguments implies match all. We convert the arguments to
-- | a pair of regexps. -- a pair of regexps.
parsePatternArgs :: [String] -> (Regex,Regex) parsePatternArgs :: [String] -> (Regex,Regex)
parsePatternArgs args = (regexFor as, regexFor ds') parsePatternArgs args = (regexFor as, regexFor ds')
where (as, ds) = break (=="--") args where (as, ds) = break (=="--") args
ds' = dropWhile (=="--") ds ds' = dropWhile (=="--") ds
-- | convert a list of strings to a regular expression matching any of them, -- | convert a list of strings to a regular expression matching any of them,
-- | or a wildcard if there are none. -- or a wildcard if there are none.
regexFor :: [String] -> Regex regexFor :: [String] -> Regex
regexFor [] = wildcard regexFor [] = wildcard
regexFor ss = mkRegex $ "(" ++ (unwords $ intersperse "|" ss) ++ ")" regexFor ss = mkRegex $ "(" ++ (unwords $ intersperse "|" ss) ++ ")"