diff --git a/hledger-lib/Hledger/Data/Journal.hs b/hledger-lib/Hledger/Data/Journal.hs index 9d19f4333..e340f0786 100644 --- a/hledger-lib/Hledger/Data/Journal.hs +++ b/hledger-lib/Hledger/Data/Journal.hs @@ -1006,7 +1006,8 @@ commodityStylesFromAmounts amts = commamts = groupSort [(acommodity as, as) | as <- amts] commstyles = [(c, canonicalStyleFrom $ map astyle as) | (c,as) <- commamts] --- TODO: should probably detect and report inconsistencies here +-- TODO: should probably detect and report inconsistencies here. +-- Though, we don't have the info for a good error message, so maybe elsewhere. -- | Given a list of amount styles (assumed to be from parsed amounts -- in a single commodity), in parse order, choose a canonical style. -- Traditionally it's "the style of the first, with the maximum precision of all". diff --git a/hledger-lib/Hledger/Read/Common.hs b/hledger-lib/Hledger/Read/Common.hs index b55d74822..a757f01e7 100644 --- a/hledger-lib/Hledger/Read/Common.hs +++ b/hledger-lib/Hledger/Read/Common.hs @@ -305,11 +305,11 @@ parseAndFinaliseJournal' parser iopts f txt = do -- -- - infer transaction-implied market prices from transaction prices -- -journalFinalise :: InputOpts -> FilePath -> Text -> Journal -> ExceptT String IO Journal +journalFinalise :: InputOpts -> FilePath -> Text -> ParsedJournal -> ExceptT String IO Journal journalFinalise iopts f txt pj = do t <- liftIO getClockTime d <- liftIO getCurrentDay - -- Infer and apply canonical styles for each commodity (or fail). + -- Infer and apply canonical styles for each commodity (or throw an error). -- This affects transaction balancing/assertions/assignments, so needs to be done early. -- (TODO: since #903's refactoring for hledger 1.12, -- journalApplyCommodityStyles here is seeing the