Construct a PeriodData from a historical data value and a list of (period start, period data) pairs.
Modulehledger-lib-1.52.4GHC2021
Hledger.Data.PeriodData
Data values for zero or more report periods, and for the pre-report period. Report periods are assumed to be contiguous, and represented only by start dates (as keys of an IntMap).
- 9 values
- Packagehledger-lib-1.52.4
- Exports9
- LanguageGHC2021
- LicenceGPL-3.0-or-later
- SourcePeriodData.hs
Convert PeriodData to a historical data value and a list of (period start, period data) pairs.
Get the data for the period containing the given Day, and that period's start date. If the day is after the end of the last period, it is assumed to be within the last period. If the day is before the start of the first period (ie, in the historical period), return Nothing.
Get the data for the period containing the given Day, and that period's start date. If the day is after the end of the last period, it is assumed to be within the last period. If the day is before the start of the first period (ie, in the historical period), return the data for the historical period and no start date.
Set historical or period data in the appropriate location in a PeriodData.
Merge two PeriodData, using the given operation to combine their data values.
This will drop keys if they are not present in both PeriodData.
Merge two PeriodData, using the given operations for combining data that's only in the first, only in the second, or in both, respectively.
Pad out the date map of a PeriodData so that every key from another PeriodData is present.
Orphan instances
6 instancesFoldable PeriodDataTraversable PeriodDataFoldable1 PeriodDataShow a => Show (PeriodData a)Semigroup a => Semigroup (PeriodData a)The Semigroup instance for PeriodData simply takes the union of keys in the date map section. This may not be the result you want if the keys are not identical.
Monoid a => Monoid (PeriodData a)