Skip to content

Latest commit

 

History

History
16 lines (13 loc) · 553 Bytes

gains-hledger.md

File metadata and controls

16 lines (13 loc) · 553 Bytes

Capital gains in hledger

WIP

  • postings can have multiple commodities and multiple prices; each of these parts is a deposit or withdrawal to the account

  • -- | Given a list of amounts all in the same commodity, interprets them
    -- as a sequence of lot deposits (the positive amounts) and withdrawals
    -- (the negative amounts), and applies them in order using the FIFO
    -- strategy for withdrawals, then returns the resulting lot balance (as
    -- another, shorter, list of amounts).
    sumLots :: [Amount] -> [Amount]