Safe Haskell | None |
---|
Functions that return a boolean based upon some criterion that matches something, often a PostFam. Useful when filtering Postings.
- match :: HasText a => (Text -> Bool) -> a -> Bool
- matchMaybe :: HasText a => (Text -> Bool) -> Maybe a -> Bool
- matchAny :: HasTextList a => (Text -> Bool) -> a -> Bool
- matchAnyMaybe :: HasTextList a => (Text -> Bool) -> Maybe a -> Bool
- matchLevel :: HasTextList a => Int -> (Text -> Bool) -> a -> Bool
- matchMemo :: (Text -> Bool) -> Maybe Memo -> Bool
- matchMaybeLevel :: HasTextList a => Int -> (Text -> Bool) -> Maybe a -> Bool
- payee :: (Text -> Bool) -> PostFam -> Bool
- number :: (Text -> Bool) -> PostFam -> Bool
- flag :: (Text -> Bool) -> PostFam -> Bool
- postingMemo :: (Text -> Bool) -> PostFam -> Bool
- transactionMemo :: (Text -> Bool) -> PostFam -> Bool
- date :: (DateTime -> Bool) -> PostFam -> Bool
- localDay :: (Day -> Bool) -> PostFam -> Bool
- qty :: (Qty -> Bool) -> PostFam -> Bool
- drCr :: DrCr -> PostFam -> Bool
- debit :: PostFam -> Bool
- credit :: PostFam -> Bool
- matchDelimited :: HasTextList a => Text -> (Text -> Bool) -> a -> Bool
- commodity :: (Text -> Bool) -> PostFam -> Bool
- account :: Text -> (Text -> Bool) -> PostFam -> Bool
- accountLevel :: Int -> (Text -> Bool) -> PostFam -> Bool
- accountAny :: (Text -> Bool) -> PostFam -> Bool
- tag :: (Text -> Bool) -> PostFam -> Bool
- (&&&) :: (a -> Bool) -> (a -> Bool) -> a -> Bool
- (|||) :: (a -> Bool) -> (a -> Bool) -> a -> Bool
- clonedTransactions :: Transaction -> Transaction -> Bool
- clonedTopLines :: TopLine -> TopLine -> Bool
- clonedPostings :: Posting -> Posting -> Bool
Matching helpers
matchAny :: HasTextList a => (Text -> Bool) -> a -> BoolSource
Does the given matcher match any of the elements of the Texts in a HasTextList?
matchAnyMaybe :: HasTextList a => (Text -> Bool) -> Maybe a -> BoolSource
matchLevel :: HasTextList a => Int -> (Text -> Bool) -> a -> BoolSource
Does the given matcher match the text that is at the given element of a HasTextList? If the HasTextList does not have a sufficent number of elements to perform this test, returns False.
matchMemo :: (Text -> Bool) -> Maybe Memo -> BoolSource
Does the matcher match the text of the memo? Joins each line of the memo with a space.
matchMaybeLevel :: HasTextList a => Int -> (Text -> Bool) -> Maybe a -> BoolSource
Pattern matching fields
Date
Qty
DrCr
Matching delimited fields
matchDelimited :: HasTextList a => Text -> (Text -> Bool) -> a -> BoolSource
Commodity
Account
Tags
Combining predicates
Clones
clonedTransactions :: Transaction -> Transaction -> BoolSource
Returns True if these two transactions are clones; that is, if they are identical in all respects except some aspects of their metadata. The metadata that is disregarded when testing for clones pertains to the location of the transaction. (Resembles cloned sheep, which are identical but cannot be in exactly the same place.)
clonedTopLines :: TopLine -> TopLine -> BoolSource
Returns True if two TopLines are clones. Considers only the non-metadata aspects of the TopLine; the metadata all pertains only to the location of the TopLine. The DateTimes are compared based on both the local time and the time zone; that is, two times that refer to the same instant will not compare as identical if they have different time zones.
clonedPostings :: Posting -> Posting -> BoolSource
Returns True if two Postings are clones. Considers only the non-location-related aspects of the posting metadata.