Safe Haskell | None |
---|---|
Language | Haskell2010 |
- type M r m = ContT r (RWST () () (Map Key Entry) m)
- type Key = ([(CommoditySymbol, Quantity)], AccountName, Day, Int)
- addNew :: (MonadIO m, MonadReader (Options user Config env) m) => [FilledEntry] -> Journal -> m [Entry]
- key :: Transaction -> Int -> Key
- loop :: (MonadIO m, MonadReader (Options user Config env) m) => (() -> M r m ()) -> Int -> Int -> FilledEntry -> M r m ()
- eitherToMaybe :: Either b a -> Maybe a
- findDuplicates :: Monad m => (Key, FilledEntry) -> M r m [(Key, Entry)]
- checkOrAsk :: (MonadIO m, MonadReader (Options user Config env) m) => (() -> M r m ()) -> (Key, FilledEntry) -> TL.Text -> [((Key, Entry), Maybe Int)] -> M r m ()
- prettyPrint :: Maybe Int -> FilledEntry -> Entry -> TL.Text -> Int -> T.Text
- applyChanges :: ImportTag -> (Key, FilledEntry) -> Key -> Entry -> Entry
Documentation
type Key = ([(CommoditySymbol, Quantity)], AccountName, Day, Int) Source #
the key that is used to compare transactions. The Int is a counter, to ensure there are no actual duplicates in the map.
Instead duplicates are found by extraction of a key range using
split
. See findDuplicates
.
:: (MonadIO m, MonadReader (Options user Config env) m) | |
=> [FilledEntry] | new candidates including entries already existing in journal possible duplicates |
-> Journal | |
-> m [Entry] |
loop :: (MonadIO m, MonadReader (Options user Config env) m) => (() -> M r m ()) -> Int -> Int -> FilledEntry -> M r m () Source #
loop through all existing possible duplicates of a new transaction
eitherToMaybe :: Either b a -> Maybe a Source #
findDuplicates :: Monad m => (Key, FilledEntry) -> M r m [(Key, Entry)] Source #
:: (MonadIO m, MonadReader (Options user Config env) m) | |
=> (() -> M r m ()) | |
-> (Key, FilledEntry) | |
-> TL.Text | message |
-> [((Key, Entry), Maybe Int)] | |
-> M r m () |
check single new entry against a list of conflict candidates, and insert new entry (if list is empty), or keep old entry (if identical to new one), or ask weither to modify old entry or insert new entry.
applyChanges :: ImportTag -> (Key, FilledEntry) -> Key -> Entry -> Entry Source #