hledger-lib-1.50.3: A library providing the core functionality of hledger
Safe HaskellSafe-Inferred
LanguageGHC2021

Hledger.Data

Description

The Hledger.Data library allows parsing and querying of C++ ledger-style journal files. It generally provides a compatible subset of C++ ledger's functionality. This package re-exports all the Hledger.Data.* modules (except UTF8, which requires an explicit import.)

Synopsis

Documentation

opBalanceData :: (MixedAmount -> MixedAmount -> MixedAmount) -> BalanceData -> BalanceData -> BalanceData Source #

Merge two BalanceData, using the given operation to combine their amounts.

data DayPartition Source #

A partition of time into one or more contiguous periods, plus a historical period that precedes them. Note DayPartition does not store per-period data - only the periods' start/end dates.

constructors

boundariesToDayPartition :: NonEmpty Day -> DayPartition Source #

Construct a DayPartition from a non-empty list of period boundary dates (start dates plus a final exclusive end date).

>>> boundariesToDayPartition (fromGregorian 2025 01 01 :| [fromGregorian 2025 02 01])
DayPartition {dayPartitionToPeriodData = PeriodData{ pdpre = 2024-12-31, pdperiods = fromList [(2025-01-01,2025-01-31)]}}

boundariesToMaybeDayPartition :: [Day] -> Maybe DayPartition Source #

Construct a DayPartition from a list of period boundary dates (start dates plus a final exclusive end date), if it's a non-empty list.

conversions

dayPartitionToNonEmpty :: DayPartition -> NonEmpty (Day, Day) Source #

Convert DayPartition to a non-empty list of period start and end dates (both inclusive). Each end date will be one day before the next period's start date.

dayPartitionToList :: DayPartition -> [(Day, Day)] Source #

Convert DayPartition to a list (which will always be non-empty) of period start and end dates (both inclusive). Each end date will be one day before the next period's start date.

dayPartitionToDateSpans :: DayPartition -> [DateSpan] Source #

Convert DayPartition to a list of DateSpans. Each span will end one day before the next span begins (the span's exclusive end date will be equal to the next span's start date).

operations

unionDayPartitions :: DayPartition -> DayPartition -> Maybe DayPartition Source #

Return the union of two DayPartitions if that is a valid DayPartition, or Nothing otherwise.

dayPartitionStartEnd :: DayPartition -> (Day, Day) Source #

Get this DayPartition's overall start date and end date (both inclusive).

dayPartitionFind :: Day -> DayPartition -> (Maybe Day, Day) Source #

Find the start and end dates of the period within a DayPartition which contains a given day. 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), only the historical period's end date is returned.

splitSpan :: Bool -> Interval -> DateSpan -> Maybe DayPartition Source #

Split a DateSpan into a DayPartition consisting of consecutive exact spans of the specified Interval, or Nothing if the span is invalid. If no interval is specified, the original span is returned. If the original span is the null date span, ie unbounded, Nothing is returned. If the original span is empty, eg if the end date is <= the start date, Nothing is returned.

Date adjustment

Some intervals respect the "adjust" flag (years, quarters, months, weeks, every Nth weekday of month seem to be the ones that need it). This will move the start date earlier, if needed, to the previous natural interval boundary (first of year, first of quarter, first of month, monday, previous Nth weekday of month). Related: #1982 #2218

The end date is always moved later if needed to the next natural interval boundary, so that the last period is the same length as the others.

Examples

>>> let t i y1 m1 d1 y2 m2 d2 = fmap dayPartitionToNonEmpty . splitSpan True i $ DateSpan (Just $ Flex $ fromGregorian y1 m1 d1) (Just $ Flex $ fromGregorian y2 m2 d2)
>>> t NoInterval 2008 01 01 2009 01 01
Just ((2008-01-01,2008-12-31) :| [])
>>> t (Quarters 1) 2008 01 01 2009 01 01
Just ((2008-01-01,2008-03-31) :| [(2008-04-01,2008-06-30),(2008-07-01,2008-09-30),(2008-10-01,2008-12-31)])
>>> splitSpan True (Quarters 1) nulldatespan
Nothing
>>> t (Days 1) 2008 01 01 2008 01 01  -- an empty datespan
Nothing
>>> t (Quarters 1) 2008 01 01 2008 01 01
Nothing
>>> t (Months 1) 2008 01 01 2008 04 01
Just ((2008-01-01,2008-01-31) :| [(2008-02-01,2008-02-29),(2008-03-01,2008-03-31)])
>>> t (Months 2) 2008 01 01 2008 04 01
Just ((2008-01-01,2008-02-29) :| [(2008-03-01,2008-04-30)])
>>> t (Weeks 1) 2008 01 01 2008 01 15
Just ((2007-12-31,2008-01-06) :| [(2008-01-07,2008-01-13),(2008-01-14,2008-01-20)])
>>> t (Weeks 2) 2008 01 01 2008 01 15
Just ((2007-12-31,2008-01-13) :| [(2008-01-14,2008-01-27)])
>>> t (MonthDay 2) 2008 01 01 2008 04 01
Just ((2008-01-02,2008-02-01) :| [(2008-02-02,2008-03-01),(2008-03-02,2008-04-01)])
>>> t (NthWeekdayOfMonth 2 4) 2011 01 01 2011 02 15
Just ((2010-12-09,2011-01-12) :| [(2011-01-13,2011-02-09),(2011-02-10,2011-03-09)])
>>> t (DaysOfWeek [2]) 2011 01 01 2011 01 15
Just ((2010-12-28,2011-01-03) :| [(2011-01-04,2011-01-10),(2011-01-11,2011-01-17)])
>>> t (MonthAndDay 11 29) 2012 10 01 2013 10 15
Just ((2012-11-29,2013-11-28) :| [])

intervalBoundaryBefore :: Interval -> Day -> Day Source #

Get the natural start for the given interval that falls on or before the given day, when applicable. Works for Weeks, Months, Quarters, Years, eg.

tests

periodDataFromList :: a -> [(Day, a)] -> PeriodData a Source #

Construct a PeriodData from a historical data value and a list of (period start, period data) pairs.

periodDataToList :: PeriodData a -> (a, [(Day, a)]) Source #

Convert PeriodData to a historical data value and a list of (period start, period data) pairs.

lookupPeriodData :: Day -> PeriodData a -> Maybe (Day, a) Source #

Get the data for the period containing the given SmartInterval, 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.

lookupPeriodDataOrHistorical :: Day -> PeriodData a -> (Maybe Day, a) Source #

Get the data for the period containing the given SmartInterval, 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.

insertPeriodData :: Semigroup a => Maybe Day -> a -> PeriodData a -> PeriodData a Source #

Set historical or period data in the appropriate location in a PeriodData.

opPeriodData :: (a -> b -> c) -> PeriodData a -> PeriodData b -> PeriodData c Source #

Merge two PeriodData, using the given operation to combine their data values.

This will drop keys if they are not present in both PeriodData.

mergePeriodData :: (a -> c) -> (b -> c) -> (a -> b -> c) -> PeriodData a -> PeriodData b -> PeriodData c Source #

Merge two PeriodData, using the given operations for combining data that's only in the first, only in the second, or in both, respectively.

padPeriodData :: a -> PeriodData b -> PeriodData a -> PeriodData a Source #

Pad out the date map of a PeriodData so that every key from another PeriodData is present.

type Year = Integer Source #

Year of Common Era (when positive).

type Tag Source #

Arguments

 = (TagName, TagValue)

A tag name and (possibly empty) value.

data Status Source #

The status of a transaction or posting, recorded with a status mark (nothing, !, or *). What these mean is ultimately user defined.

Constructors

Unmarked 
Pending 
Cleared 

Instances

Instances details
FromJSON Status Source # 
Instance details

Defined in Hledger.Data.Json

ToJSON Status Source # 
Instance details

Defined in Hledger.Data.Json

Bounded Status Source # 
Instance details

Defined in Hledger.Data.Types

Enum Status Source # 
Instance details

Defined in Hledger.Data.Types

Generic Status Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep Status :: Type -> Type Source #

Show Status Source # 
Instance details

Defined in Hledger.Data.Types

NFData Status Source # 
Instance details

Defined in Hledger.Data.Types

Methods

rnf :: Status -> () Source #

Eq Status Source # 
Instance details

Defined in Hledger.Data.Types

Ord Status Source # 
Instance details

Defined in Hledger.Data.Types

type Rep Status Source # 
Instance details

Defined in Hledger.Data.Types

type Rep Status = D1 ('MetaData "Status" "Hledger.Data.Types" "hledger-lib-1.50.3-ABaCjsMZ3mfJvGwbSVH5pJ" 'False) (C1 ('MetaCons "Unmarked" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Pending" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Cleared" 'PrefixI 'False) (U1 :: Type -> Type)))

type Month = Int Source #

data Account a Source #

An account within a hierarchy, with references to its parent and subaccounts if any, and with per-report-period data of type a. Only the name is required; the other fields may or may not be present.

Constructors

Account 

Fields

Instances

Instances details
Functor Account Source # 
Instance details

Defined in Hledger.Data.Types

Methods

fmap :: (a -> b) -> Account a -> Account b Source #

(<$) :: a -> Account b -> Account a Source #

FromJSON a => FromJSON (Account a) Source # 
Instance details

Defined in Hledger.Data.Json

ToJSON a => ToJSON (Account a) Source # 
Instance details

Defined in Hledger.Data.Json

Generic (Account a) Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep (Account a) :: Type -> Type Source #

Methods

from :: Account a -> Rep (Account a) x Source #

to :: Rep (Account a) x -> Account a Source #

Show a => Show (Account a) Source # 
Instance details

Defined in Hledger.Data.Account

Eq (Account a) Source # 
Instance details

Defined in Hledger.Data.Account

Methods

(==) :: Account a -> Account a -> Bool Source #

(/=) :: Account a -> Account a -> Bool Source #

HasAmounts a => HasAmounts (Account a) Source # 
Instance details

Defined in Hledger.Data.Amount

type Rep (Account a) Source # 
Instance details

Defined in Hledger.Data.Types

data Amount Source #

Constructors

Amount 

Fields

Instances

Instances details
FromJSON Amount Source # 
Instance details

Defined in Hledger.Data.Json

ToJSON Amount Source # 
Instance details

Defined in Hledger.Data.Json

Generic Amount Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep Amount :: Type -> Type Source #

Num Amount Source # 
Instance details

Defined in Hledger.Data.Amount

Show Amount Source # 
Instance details

Defined in Hledger.Data.Types

NFData Amount Source # 
Instance details

Defined in Hledger.Data.Types

Methods

rnf :: Amount -> () Source #

Eq Amount Source # 
Instance details

Defined in Hledger.Data.Types

Ord Amount Source # 
Instance details

Defined in Hledger.Data.Types

HasAmounts Amount Source # 
Instance details

Defined in Hledger.Data.Amount

type Rep Amount Source # 
Instance details

Defined in Hledger.Data.Types

type Rep Amount = D1 ('MetaData "Amount" "Hledger.Data.Types" "hledger-lib-1.50.3-ABaCjsMZ3mfJvGwbSVH5pJ" 'False) (C1 ('MetaCons "Amount" 'PrefixI 'True) ((S1 ('MetaSel ('Just "acommodity") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 CommoditySymbol) :*: S1 ('MetaSel ('Just "aquantity") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Quantity)) :*: (S1 ('MetaSel ('Just "astyle") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 AmountStyle) :*: S1 ('MetaSel ('Just "acost") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe AmountCost)))))

data BalanceData Source #

Data that's useful in "balance" reports: subaccount-exclusive and -inclusive amounts, typically representing either a balance change or an end balance; and a count of postings.

Constructors

BalanceData 

Fields

Instances

Instances details
FromJSON BalanceData Source # 
Instance details

Defined in Hledger.Data.Json

ToJSON BalanceData Source # 
Instance details

Defined in Hledger.Data.Json

Monoid BalanceData Source # 
Instance details

Defined in Hledger.Data.BalanceData

Semigroup BalanceData Source # 
Instance details

Defined in Hledger.Data.BalanceData

Generic BalanceData Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep BalanceData :: Type -> Type Source #

Show BalanceData Source # 
Instance details

Defined in Hledger.Data.BalanceData

Eq BalanceData Source # 
Instance details

Defined in Hledger.Data.Types

HasAmounts BalanceData Source # 
Instance details

Defined in Hledger.Data.Amount

type Rep BalanceData Source # 
Instance details

Defined in Hledger.Data.Types

type Rep BalanceData = D1 ('MetaData "BalanceData" "Hledger.Data.Types" "hledger-lib-1.50.3-ABaCjsMZ3mfJvGwbSVH5pJ" 'False) (C1 ('MetaCons "BalanceData" 'PrefixI 'True) (S1 ('MetaSel ('Just "bdexcludingsubs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 MixedAmount) :*: (S1 ('MetaSel ('Just "bdincludingsubs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 MixedAmount) :*: S1 ('MetaSel ('Just "bdnumpostings") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))))

data Journal Source #

A journal, containing general ledger transactions; also directives and various other things. This is hledger's main data model.

During parsing, it is used as the type alias ParsedJournal. The jparse* fields are mainly used during parsing and included here for convenience. The list fields described as "in parse order" are usually reversed for efficiency during parsing. After parsing, "journalFinalise" converts ParsedJournal to a finalised Journal, which has all lists correctly ordered, and much data inference and validation applied.

Constructors

Journal 

Fields

Instances

Instances details
ToJSON Journal Source # 
Instance details

Defined in Hledger.Data.Json

Semigroup Journal Source # 
Instance details

Defined in Hledger.Data.Journal

Generic Journal Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep Journal :: Type -> Type Source #

Show Journal Source # 
Instance details

Defined in Hledger.Data.Journal

Default Journal 
Instance details

Defined in Hledger.Data.Journal

Methods

def :: Journal

NFData Journal Source # 
Instance details

Defined in Hledger.Data.Types

Methods

rnf :: Journal -> () Source #

Eq Journal Source # 
Instance details

Defined in Hledger.Data.Types

type Rep Journal Source # 
Instance details

Defined in Hledger.Data.Types

type Rep Journal = D1 ('MetaData "Journal" "Hledger.Data.Types" "hledger-lib-1.50.3-ABaCjsMZ3mfJvGwbSVH5pJ" 'False) (C1 ('MetaCons "Journal" 'PrefixI 'True) ((((S1 ('MetaSel ('Just "jparsedefaultyear") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Year)) :*: (S1 ('MetaSel ('Just "jparsedefaultcommodity") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (CommoditySymbol, AmountStyle))) :*: S1 ('MetaSel ('Just "jparsedecimalmark") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe DecimalMark)))) :*: (S1 ('MetaSel ('Just "jparseparentaccounts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [AccountName]) :*: (S1 ('MetaSel ('Just "jparsealiases") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [AccountAlias]) :*: S1 ('MetaSel ('Just "jparsetimeclockentries") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [TimeclockEntry])))) :*: ((S1 ('MetaSel ('Just "jincludefilestack") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [FilePath]) :*: (S1 ('MetaSel ('Just "jdeclaredpayees") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [(Payee, PayeeDeclarationInfo)]) :*: S1 ('MetaSel ('Just "jdeclaredtags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [(TagName, TagDeclarationInfo)]))) :*: (S1 ('MetaSel ('Just "jdeclaredaccounts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [(AccountName, AccountDeclarationInfo)]) :*: (S1 ('MetaSel ('Just "jdeclaredaccounttags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Map AccountName [Tag])) :*: S1 ('MetaSel ('Just "jdeclaredaccounttypes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Map AccountType [AccountName])))))) :*: (((S1 ('MetaSel ('Just "jaccounttypes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Map AccountName AccountType)) :*: (S1 ('MetaSel ('Just "jdeclaredcommodities") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Map CommoditySymbol Commodity)) :*: S1 ('MetaSel ('Just "jinferredcommoditystyles") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Map CommoditySymbol AmountStyle)))) :*: (S1 ('MetaSel ('Just "jglobalcommoditystyles") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Map CommoditySymbol AmountStyle)) :*: (S1 ('MetaSel ('Just "jpricedirectives") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [PriceDirective]) :*: S1 ('MetaSel ('Just "jinferredmarketprices") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [MarketPrice])))) :*: ((S1 ('MetaSel ('Just "jtxnmodifiers") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [TransactionModifier]) :*: (S1 ('MetaSel ('Just "jperiodictxns") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [PeriodicTransaction]) :*: S1 ('MetaSel ('Just "jtxns") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Transaction]))) :*: (S1 ('MetaSel ('Just "jfinalcommentlines") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Just "jfiles") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [(FilePath, Text)]) :*: S1 ('MetaSel ('Just "jlastreadtime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 POSIXTime)))))))

data Ledger Source #

A Ledger has the journal it derives from, and the accounts derived from that. Accounts are accessible both list-wise and tree-wise, since each one knows its parent and subs; the first account is the root of the tree and always exists.

Constructors

Ledger 

Instances

Instances details
ToJSON Ledger Source # 
Instance details

Defined in Hledger.Data.Json

Generic Ledger Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep Ledger :: Type -> Type Source #

Show Ledger Source # 
Instance details

Defined in Hledger.Data.Ledger

type Rep Ledger Source # 
Instance details

Defined in Hledger.Data.Types

type Rep Ledger = D1 ('MetaData "Ledger" "Hledger.Data.Types" "hledger-lib-1.50.3-ABaCjsMZ3mfJvGwbSVH5pJ" 'False) (C1 ('MetaCons "Ledger" 'PrefixI 'True) (S1 ('MetaSel ('Just "ljournal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Journal) :*: S1 ('MetaSel ('Just "laccounts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Account BalanceData])))

data Period Source #

Instances

Instances details
ToJSON Period Source # 
Instance details

Defined in Hledger.Data.Json

Generic Period Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep Period :: Type -> Type Source #

Show Period Source # 
Instance details

Defined in Hledger.Data.Types

Default Period Source # 
Instance details

Defined in Hledger.Data.Types

Methods

def :: Period

Eq Period Source # 
Instance details

Defined in Hledger.Data.Types

Ord Period Source # 
Instance details

Defined in Hledger.Data.Types

HasAmounts PostingsReportItem Source # 
Instance details

Defined in Hledger.Reports.PostingsReport

type Rep Period Source # 
Instance details

Defined in Hledger.Data.Types

type Rep Period = D1 ('MetaData "Period" "Hledger.Data.Types" "hledger-lib-1.50.3-ABaCjsMZ3mfJvGwbSVH5pJ" 'False) (((C1 ('MetaCons "DayPeriod" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Day)) :+: C1 ('MetaCons "WeekPeriod" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Day))) :+: (C1 ('MetaCons "MonthPeriod" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Year) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Month)) :+: C1 ('MetaCons "QuarterPeriod" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Year) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Quarter)))) :+: ((C1 ('MetaCons "YearPeriod" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Year)) :+: C1 ('MetaCons "PeriodBetween" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Day) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Day))) :+: (C1 ('MetaCons "PeriodFrom" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Day)) :+: (C1 ('MetaCons "PeriodTo" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Day)) :+: C1 ('MetaCons "PeriodAll" 'PrefixI 'False) (U1 :: Type -> Type)))))

data PeriodData a Source #

A general container for storing data values associated with zero or more contiguous report (sub)periods, and with the (open ended) pre-report period. The report periods are typically all the same length, but need not be.

Report periods are represented only by their start dates, used as the keys of a Map.

Constructors

PeriodData 

Fields

  • pdpre :: a

    data for the period before the report

  • pdperiods :: Map Day a

    data for each period within the report

Instances

Instances details
Foldable PeriodData Source # 
Instance details

Defined in Hledger.Data.PeriodData

Methods

fold :: Monoid m => PeriodData m -> m Source #

foldMap :: Monoid m => (a -> m) -> PeriodData a -> m Source #

foldMap' :: Monoid m => (a -> m) -> PeriodData a -> m Source #

foldr :: (a -> b -> b) -> b -> PeriodData a -> b Source #

foldr' :: (a -> b -> b) -> b -> PeriodData a -> b Source #

foldl :: (b -> a -> b) -> b -> PeriodData a -> b Source #

foldl' :: (b -> a -> b) -> b -> PeriodData a -> b Source #

foldr1 :: (a -> a -> a) -> PeriodData a -> a Source #

foldl1 :: (a -> a -> a) -> PeriodData a -> a Source #

toList :: PeriodData a -> [a] Source #

null :: PeriodData a -> Bool Source #

length :: PeriodData a -> Int Source #

elem :: Eq a => a -> PeriodData a -> Bool Source #

maximum :: Ord a => PeriodData a -> a Source #

minimum :: Ord a => PeriodData a -> a Source #

sum :: Num a => PeriodData a -> a Source #

product :: Num a => PeriodData a -> a Source #

Foldable1 PeriodData Source # 
Instance details

Defined in Hledger.Data.PeriodData

Methods

fold1 :: Semigroup m => PeriodData m -> m Source #

foldMap1 :: Semigroup m => (a -> m) -> PeriodData a -> m Source #

foldMap1' :: Semigroup m => (a -> m) -> PeriodData a -> m Source #

toNonEmpty :: PeriodData a -> NonEmpty a Source #

maximum :: Ord a => PeriodData a -> a Source #

minimum :: Ord a => PeriodData a -> a Source #

head :: PeriodData a -> a Source #

last :: PeriodData a -> a Source #

foldrMap1 :: (a -> b) -> (a -> b -> b) -> PeriodData a -> b Source #

foldlMap1' :: (a -> b) -> (b -> a -> b) -> PeriodData a -> b Source #

foldlMap1 :: (a -> b) -> (b -> a -> b) -> PeriodData a -> b Source #

foldrMap1' :: (a -> b) -> (a -> b -> b) -> PeriodData a -> b Source #

Traversable PeriodData Source # 
Instance details

Defined in Hledger.Data.PeriodData

Methods

traverse :: Applicative f => (a -> f b) -> PeriodData a -> f (PeriodData b) Source #

sequenceA :: Applicative f => PeriodData (f a) -> f (PeriodData a) Source #

mapM :: Monad m => (a -> m b) -> PeriodData a -> m (PeriodData b) Source #

sequence :: Monad m => PeriodData (m a) -> m (PeriodData a) Source #

Functor PeriodData Source # 
Instance details

Defined in Hledger.Data.Types

Methods

fmap :: (a -> b) -> PeriodData a -> PeriodData b Source #

(<$) :: a -> PeriodData b -> PeriodData a Source #

FromJSON a => FromJSON (PeriodData a) Source # 
Instance details

Defined in Hledger.Data.Json

ToJSON a => ToJSON (PeriodData a) Source # 
Instance details

Defined in Hledger.Data.Json

Monoid a => Monoid (PeriodData a) Source # 
Instance details

Defined in Hledger.Data.PeriodData

Semigroup a => Semigroup (PeriodData a) Source #

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.

Instance details

Defined in Hledger.Data.PeriodData

Generic (PeriodData a) Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep (PeriodData a) :: Type -> Type Source #

Methods

from :: PeriodData a -> Rep (PeriodData a) x Source #

to :: Rep (PeriodData a) x -> PeriodData a Source #

Show a => Show (PeriodData a) Source # 
Instance details

Defined in Hledger.Data.PeriodData

Eq a => Eq (PeriodData a) Source # 
Instance details

Defined in Hledger.Data.Types

Ord a => Ord (PeriodData a) Source # 
Instance details

Defined in Hledger.Data.Types

HasAmounts a => HasAmounts (PeriodData a) Source # 
Instance details

Defined in Hledger.Data.Amount

type Rep (PeriodData a) Source # 
Instance details

Defined in Hledger.Data.Types

type Rep (PeriodData a) = D1 ('MetaData "PeriodData" "Hledger.Data.Types" "hledger-lib-1.50.3-ABaCjsMZ3mfJvGwbSVH5pJ" 'False) (C1 ('MetaCons "PeriodData" 'PrefixI 'True) (S1 ('MetaSel ('Just "pdpre") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 a) :*: S1 ('MetaSel ('Just "pdperiods") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Map Day a))))

data PeriodicTransaction Source #

A periodic transaction rule, describing a transaction that recurs.

Constructors

PeriodicTransaction 

Fields

Instances

Instances details
ToJSON PeriodicTransaction Source # 
Instance details

Defined in Hledger.Data.Json

Generic PeriodicTransaction Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep PeriodicTransaction :: Type -> Type Source #

Show PeriodicTransaction Source # 
Instance details

Defined in Hledger.Data.PeriodicTransaction

NFData PeriodicTransaction Source # 
Instance details

Defined in Hledger.Data.Types

Eq PeriodicTransaction Source # 
Instance details

Defined in Hledger.Data.Types

type Rep PeriodicTransaction Source # 
Instance details

Defined in Hledger.Data.Types

data Posting Source #

Constructors

Posting 

Fields

  • pdate :: Maybe Day

    this posting's date, if different from the transaction's

  • pdate2 :: Maybe Day

    this posting's secondary date, if different from the transaction's

  • pstatus :: Status
     
  • paccount :: AccountName
     
  • pamount :: MixedAmount
     
  • pcomment :: Text

    this posting's comment lines, as a single non-indented multi-line string

  • ptype :: PostingType
     
  • ptags :: [Tag]

    tag names and values, extracted from the posting comment and (after finalisation) the posting account's directive if any

  • pbalanceassertion :: Maybe BalanceAssertion

    an expected balance in the account after this posting, in a single commodity, excluding subaccounts.

  • ptransaction :: Maybe Transaction

    this posting's parent transaction (co-recursive types). Tying this knot gets tedious, Maybe makes it easier/optional.

  • poriginal :: Maybe Posting

    When this posting has been transformed in some way (eg its amount or cost was inferred, or the account name was changed by a pivot or budget report), this references the original untransformed posting (which will have Nothing in this field).

Instances

Instances details
FromJSON Posting Source # 
Instance details

Defined in Hledger.Data.Json

ToJSON Posting Source # 
Instance details

Defined in Hledger.Data.Json

Generic Posting Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep Posting :: Type -> Type Source #

Show Posting Source #

Posting's show instance elides the parent transaction so as not to recurse forever.

Instance details

Defined in Hledger.Data.Types

NFData Posting Source # 
Instance details

Defined in Hledger.Data.Types

Methods

rnf :: Posting -> () Source #

Eq Posting Source # 
Instance details

Defined in Hledger.Data.Types

HasAmounts Posting Source # 
Instance details

Defined in Hledger.Data.Posting

HasAmounts PostingsReportItem Source # 
Instance details

Defined in Hledger.Reports.PostingsReport

type Rep Posting Source # 
Instance details

Defined in Hledger.Data.Types

data Transaction Source #

Constructors

Transaction 

Fields

Instances

Instances details
FromJSON Transaction Source # 
Instance details

Defined in Hledger.Data.Json

ToJSON Transaction Source # 
Instance details

Defined in Hledger.Data.Json

Generic Transaction Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep Transaction :: Type -> Type Source #

Show Transaction Source # 
Instance details

Defined in Hledger.Data.Types

NFData Transaction Source # 
Instance details

Defined in Hledger.Data.Types

Methods

rnf :: Transaction -> () Source #

Eq Transaction Source # 
Instance details

Defined in Hledger.Data.Types

HasAmounts Transaction Source # 
Instance details

Defined in Hledger.Data.Transaction

HasAmounts AccountTransactionsReportItem Source # 
Instance details

Defined in Hledger.Reports.AccountTransactionsReport

type Rep Transaction Source # 
Instance details

Defined in Hledger.Data.Types

data TransactionModifier Source #

A transaction modifier rule. This has a query which matches postings in the journal, and a list of transformations to apply to those postings or their transactions. Currently there is one kind of transformation: the TMPostingRule, which adds a posting ("auto posting") to the transaction, optionally setting its amount to the matched posting's amount multiplied by a constant.

Instances

Instances details
ToJSON TransactionModifier Source # 
Instance details

Defined in Hledger.Data.Json

Generic TransactionModifier Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep TransactionModifier :: Type -> Type Source #

Show TransactionModifier Source # 
Instance details

Defined in Hledger.Data.Types

NFData TransactionModifier Source # 
Instance details

Defined in Hledger.Data.Types

Eq TransactionModifier Source # 
Instance details

Defined in Hledger.Data.Types

type Rep TransactionModifier Source # 
Instance details

Defined in Hledger.Data.Types

type Rep TransactionModifier = D1 ('MetaData "TransactionModifier" "Hledger.Data.Types" "hledger-lib-1.50.3-ABaCjsMZ3mfJvGwbSVH5pJ" 'False) (C1 ('MetaCons "TransactionModifier" 'PrefixI 'True) (S1 ('MetaSel ('Just "tmquerytxt") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "tmpostingrules") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [TMPostingRule])))

data AmountPrecision Source #

The "display precision" for a hledger amount, by which we mean the number of decimal digits to display to the right of the decimal mark.

Constructors

Precision !Word8

show this many decimal digits (0..255)

NaturalPrecision

show all significant decimal digits stored internally

Instances

Instances details
FromJSON AmountPrecision Source # 
Instance details

Defined in Hledger.Data.Json

ToJSON AmountPrecision Source # 
Instance details

Defined in Hledger.Data.Json

Generic AmountPrecision Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep AmountPrecision :: Type -> Type Source #

Read AmountPrecision Source # 
Instance details

Defined in Hledger.Data.Types

Show AmountPrecision Source # 
Instance details

Defined in Hledger.Data.Types

NFData AmountPrecision Source # 
Instance details

Defined in Hledger.Data.Types

Methods

rnf :: AmountPrecision -> () Source #

Eq AmountPrecision Source # 
Instance details

Defined in Hledger.Data.Types

Ord AmountPrecision Source # 
Instance details

Defined in Hledger.Data.Types

type Rep AmountPrecision Source # 
Instance details

Defined in Hledger.Data.Types

type Rep AmountPrecision = D1 ('MetaData "AmountPrecision" "Hledger.Data.Types" "hledger-lib-1.50.3-ABaCjsMZ3mfJvGwbSVH5pJ" 'False) (C1 ('MetaCons "Precision" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word8)) :+: C1 ('MetaCons "NaturalPrecision" 'PrefixI 'False) (U1 :: Type -> Type))

data MixedAmount Source #

Instances

Instances details
FromJSON MixedAmount Source # 
Instance details

Defined in Hledger.Data.Json

ToJSON MixedAmount Source # 
Instance details

Defined in Hledger.Data.Json

Monoid MixedAmount Source # 
Instance details

Defined in Hledger.Data.Amount

Semigroup MixedAmount Source # 
Instance details

Defined in Hledger.Data.Amount

Generic MixedAmount Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep MixedAmount :: Type -> Type Source #

Num MixedAmount Source # 
Instance details

Defined in Hledger.Data.Amount

Show MixedAmount Source # 
Instance details

Defined in Hledger.Data.Types

NFData MixedAmount Source # 
Instance details

Defined in Hledger.Data.Types

Methods

rnf :: MixedAmount -> () Source #

Eq MixedAmount Source # 
Instance details

Defined in Hledger.Data.Types

Ord MixedAmount Source # 
Instance details

Defined in Hledger.Data.Types

HasAmounts MixedAmount Source # 
Instance details

Defined in Hledger.Data.Amount

HasAmounts AccountTransactionsReportItem Source # 
Instance details

Defined in Hledger.Reports.AccountTransactionsReport

HasAmounts BalanceReportItem Source # 
Instance details

Defined in Hledger.Reports.BalanceReport

HasAmounts PostingsReportItem Source # 
Instance details

Defined in Hledger.Reports.PostingsReport

type Rep MixedAmount Source # 
Instance details

Defined in Hledger.Data.Types

type Rep MixedAmount = D1 ('MetaData "MixedAmount" "Hledger.Data.Types" "hledger-lib-1.50.3-ABaCjsMZ3mfJvGwbSVH5pJ" 'True) (C1 ('MetaCons "Mixed" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map MixedAmountKey Amount))))

data SmartDate Source #

A possibly incomplete year-month-day date provided by the user, to be interpreted as either a date or a date span depending on context. Missing parts "on the left" will be filled from the provided reference date, e.g. if the year and month are missing, the reference date's year and month are used. Missing parts "on the right" are assumed, when interpreting as a date, to be 1, (e.g. if the year and month are present but the day is missing, it means first day of that month); or when interpreting as a date span, to be a wildcard (so it would mean all days of that month). See the smartdate parser for more examples.

Or, one of the standard periods and an offset relative to the reference date: (last|this|next) (day|week|month|quarter|year), where "this" means the period containing the reference date.

Instances

Instances details
Show SmartDate Source # 
Instance details

Defined in Hledger.Data.Types

data SmartInterval Source #

Constructors

Day 
Week 
Month 
Quarter 
Year 

Instances

Instances details
Show SmartInterval Source # 
Instance details

Defined in Hledger.Data.Types

data WhichDate Source #

Constructors

PrimaryDate 
SecondaryDate 

Instances

Instances details
Show WhichDate Source # 
Instance details

Defined in Hledger.Data.Types

Eq WhichDate Source # 
Instance details

Defined in Hledger.Data.Types

data EFDay Source #

A date which is either exact or flexible. Flexible dates are allowed to be adjusted in certain situations.

Constructors

Exact Day 
Flex Day 

Instances

Instances details
ToJSON EFDay Source # 
Instance details

Defined in Hledger.Data.Json

Generic EFDay Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep EFDay :: Type -> Type Source #

Methods

from :: EFDay -> Rep EFDay x Source #

to :: Rep EFDay x -> EFDay Source #

Show EFDay Source # 
Instance details

Defined in Hledger.Data.Types

NFData EFDay Source # 
Instance details

Defined in Hledger.Data.Types

Methods

rnf :: EFDay -> () Source #

Eq EFDay Source # 
Instance details

Defined in Hledger.Data.Types

Methods

(==) :: EFDay -> EFDay -> Bool Source #

(/=) :: EFDay -> EFDay -> Bool Source #

Ord EFDay Source # 
Instance details

Defined in Hledger.Data.Types

type Rep EFDay Source # 
Instance details

Defined in Hledger.Data.Types

type Rep EFDay = D1 ('MetaData "EFDay" "Hledger.Data.Types" "hledger-lib-1.50.3-ABaCjsMZ3mfJvGwbSVH5pJ" 'False) (C1 ('MetaCons "Exact" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Day)) :+: C1 ('MetaCons "Flex" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Day)))

data DateSpan Source #

A possibly open-ended span of time, from an optional inclusive start date to an optional exclusive end date. Each date can be either exact or flexible. An "exact date span" is a Datepan with exact start and end dates.

Constructors

DateSpan (Maybe EFDay) (Maybe EFDay) 

Instances

Instances details
ToJSON DateSpan Source # 
Instance details

Defined in Hledger.Data.Json

Generic DateSpan Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep DateSpan :: Type -> Type Source #

Show DateSpan Source # 
Instance details

Defined in Hledger.Data.Dates

Default DateSpan Source # 
Instance details

Defined in Hledger.Data.Types

Methods

def :: DateSpan

NFData DateSpan Source # 
Instance details

Defined in Hledger.Data.Types

Methods

rnf :: DateSpan -> () Source #

Eq DateSpan Source # 
Instance details

Defined in Hledger.Data.Types

Ord DateSpan Source # 
Instance details

Defined in Hledger.Data.Types

type Rep DateSpan Source # 
Instance details

Defined in Hledger.Data.Types

type Rep DateSpan = D1 ('MetaData "DateSpan" "Hledger.Data.Types" "hledger-lib-1.50.3-ABaCjsMZ3mfJvGwbSVH5pJ" 'False) (C1 ('MetaCons "DateSpan" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe EFDay)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe EFDay))))

data Interval Source #

Instances

Instances details
ToJSON Interval Source # 
Instance details

Defined in Hledger.Data.Json

Generic Interval Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep Interval :: Type -> Type Source #

Show Interval Source # 
Instance details

Defined in Hledger.Data.Types

Default Interval Source # 
Instance details

Defined in Hledger.Data.Types

Methods

def :: Interval

NFData Interval Source # 
Instance details

Defined in Hledger.Data.Types

Methods

rnf :: Interval -> () Source #

Eq Interval Source # 
Instance details

Defined in Hledger.Data.Types

Ord Interval Source # 
Instance details

Defined in Hledger.Data.Types

type Rep Interval Source # 
Instance details

Defined in Hledger.Data.Types

type Rep Interval = D1 ('MetaData "Interval" "Hledger.Data.Types" "hledger-lib-1.50.3-ABaCjsMZ3mfJvGwbSVH5pJ" 'False) (((C1 ('MetaCons "NoInterval" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Days" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))) :+: (C1 ('MetaCons "Weeks" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)) :+: (C1 ('MetaCons "Months" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)) :+: C1 ('MetaCons "Quarters" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))))) :+: ((C1 ('MetaCons "Years" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)) :+: C1 ('MetaCons "NthWeekdayOfMonth" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))) :+: (C1 ('MetaCons "MonthDay" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)) :+: (C1 ('MetaCons "MonthAndDay" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)) :+: C1 ('MetaCons "DaysOfWeek" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Int]))))))

data AccountType Source #

Constructors

Asset 
Liability 
Equity 
Revenue 
Expense 
Cash

a subtype of Asset - liquid assets to show in cashflow report

Conversion

a subtype of Equity - account with which to balance commodity conversions

Instances

Instances details
ToJSON AccountType Source # 
Instance details

Defined in Hledger.Data.Json

ToJSONKey AccountType Source # 
Instance details

Defined in Hledger.Data.Json

Generic AccountType Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep AccountType :: Type -> Type Source #

Show AccountType Source # 
Instance details

Defined in Hledger.Data.Types

NFData AccountType Source # 
Instance details

Defined in Hledger.Data.Types

Methods

rnf :: AccountType -> () Source #

Eq AccountType Source # 
Instance details

Defined in Hledger.Data.Types

Ord AccountType Source # 
Instance details

Defined in Hledger.Data.Types

type Rep AccountType Source # 
Instance details

Defined in Hledger.Data.Types

type Rep AccountType = D1 ('MetaData "AccountType" "Hledger.Data.Types" "hledger-lib-1.50.3-ABaCjsMZ3mfJvGwbSVH5pJ" 'False) ((C1 ('MetaCons "Asset" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Liability" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Equity" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Revenue" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Expense" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Cash" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Conversion" 'PrefixI 'False) (U1 :: Type -> Type))))

data AccountAlias Source #

Instances

Instances details
ToJSON AccountAlias Source # 
Instance details

Defined in Hledger.Data.Json

Generic AccountAlias Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep AccountAlias :: Type -> Type Source #

Read AccountAlias Source # 
Instance details

Defined in Hledger.Data.Types

Show AccountAlias Source # 
Instance details

Defined in Hledger.Data.Types

NFData AccountAlias Source # 
Instance details

Defined in Hledger.Data.Types

Methods

rnf :: AccountAlias -> () Source #

Eq AccountAlias Source # 
Instance details

Defined in Hledger.Data.Types

Ord AccountAlias Source # 
Instance details

Defined in Hledger.Data.Types

type Rep AccountAlias Source # 
Instance details

Defined in Hledger.Data.Types

data Side Source #

Constructors

L 
R 

Instances

Instances details
FromJSON Side Source # 
Instance details

Defined in Hledger.Data.Json

ToJSON Side Source # 
Instance details

Defined in Hledger.Data.Json

Generic Side Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep Side :: Type -> Type Source #

Methods

from :: Side -> Rep Side x Source #

to :: Rep Side x -> Side Source #

Read Side Source # 
Instance details

Defined in Hledger.Data.Types

Show Side Source # 
Instance details

Defined in Hledger.Data.Types

NFData Side Source # 
Instance details

Defined in Hledger.Data.Types

Methods

rnf :: Side -> () Source #

Eq Side Source # 
Instance details

Defined in Hledger.Data.Types

Methods

(==) :: Side -> Side -> Bool Source #

(/=) :: Side -> Side -> Bool Source #

Ord Side Source # 
Instance details

Defined in Hledger.Data.Types

type Rep Side Source # 
Instance details

Defined in Hledger.Data.Types

type Rep Side = D1 ('MetaData "Side" "Hledger.Data.Types" "hledger-lib-1.50.3-ABaCjsMZ3mfJvGwbSVH5pJ" 'False) (C1 ('MetaCons "L" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "R" 'PrefixI 'False) (U1 :: Type -> Type))

type DecimalMark = Char Source #

One of the decimal marks we support: either period or comma.

type Quantity = Decimal Source #

The basic numeric type used in amounts.

data AmountCost Source #

An amount's per-unit or total cost/selling price in another commodity, as recorded in the journal entry eg with or @. Cost, formerly AKA "transaction price". The amount is always positive.

Constructors

UnitCost !Amount 
TotalCost !Amount 

Instances

Instances details
FromJSON AmountCost Source # 
Instance details

Defined in Hledger.Data.Json

ToJSON AmountCost Source # 
Instance details

Defined in Hledger.Data.Json

Generic AmountCost Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep AmountCost :: Type -> Type Source #

Show AmountCost Source # 
Instance details

Defined in Hledger.Data.Types

NFData AmountCost Source # 
Instance details

Defined in Hledger.Data.Types

Methods

rnf :: AmountCost -> () Source #

Eq AmountCost Source # 
Instance details

Defined in Hledger.Data.Types

Ord AmountCost Source # 
Instance details

Defined in Hledger.Data.Types

type Rep AmountCost Source # 
Instance details

Defined in Hledger.Data.Types

type Rep AmountCost = D1 ('MetaData "AmountCost" "Hledger.Data.Types" "hledger-lib-1.50.3-ABaCjsMZ3mfJvGwbSVH5pJ" 'False) (C1 ('MetaCons "UnitCost" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Amount)) :+: C1 ('MetaCons "TotalCost" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Amount)))

data AmountStyle Source #

Display styles for amounts - things which can be detected during parsing, such as commodity side and spacing, digit group marks, decimal mark, number of decimal digits etc. Every Amount has an AmountStyle. After amounts are parsed from the input, for each Commodity a standard style is inferred and then used when displaying amounts in that commodity. Related to AmountFormat but higher level.

See also: - hledger manual > Commodity styles - hledger manual > Amounts - hledger manual > Commodity display style

Constructors

AmountStyle 

Fields

Instances

Instances details
FromJSON AmountStyle Source # 
Instance details

Defined in Hledger.Data.Json

ToJSON AmountStyle Source # 
Instance details

Defined in Hledger.Data.Json

Generic AmountStyle Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep AmountStyle :: Type -> Type Source #

Read AmountStyle Source # 
Instance details

Defined in Hledger.Data.Types

Show AmountStyle Source # 
Instance details

Defined in Hledger.Data.Types

NFData AmountStyle Source # 
Instance details

Defined in Hledger.Data.Types

Methods

rnf :: AmountStyle -> () Source #

Eq AmountStyle Source # 
Instance details

Defined in Hledger.Data.Types

Ord AmountStyle Source # 
Instance details

Defined in Hledger.Data.Types

type Rep AmountStyle Source # 
Instance details

Defined in Hledger.Data.Types

type Rep AmountStyle = D1 ('MetaData "AmountStyle" "Hledger.Data.Types" "hledger-lib-1.50.3-ABaCjsMZ3mfJvGwbSVH5pJ" 'False) (C1 ('MetaCons "AmountStyle" 'PrefixI 'True) ((S1 ('MetaSel ('Just "ascommodityside") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Side) :*: (S1 ('MetaSel ('Just "ascommodityspaced") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Just "asdigitgroups") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe DigitGroupStyle)))) :*: (S1 ('MetaSel ('Just "asdecimalmark") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Char)) :*: (S1 ('MetaSel ('Just "asprecision") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 AmountPrecision) :*: S1 ('MetaSel ('Just "asrounding") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Rounding)))))

data DigitGroupStyle Source #

A style for displaying digit groups in the integer part of a floating point number. It consists of the character used to separate groups (comma or period, whichever is not used as decimal point), and the size of each group, starting with the one nearest the decimal point. The last group size is assumed to repeat. Eg, comma between thousands is DigitGroups ',' [3].

Constructors

DigitGroups !Char ![Word8] 

Instances

Instances details
FromJSON DigitGroupStyle Source # 
Instance details

Defined in Hledger.Data.Json

ToJSON DigitGroupStyle Source # 
Instance details

Defined in Hledger.Data.Json

Generic DigitGroupStyle Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep DigitGroupStyle :: Type -> Type Source #

Read DigitGroupStyle Source # 
Instance details

Defined in Hledger.Data.Types

Show DigitGroupStyle Source # 
Instance details

Defined in Hledger.Data.Types

NFData DigitGroupStyle Source # 
Instance details

Defined in Hledger.Data.Types

Methods

rnf :: DigitGroupStyle -> () Source #

Eq DigitGroupStyle Source # 
Instance details

Defined in Hledger.Data.Types

Ord DigitGroupStyle Source # 
Instance details

Defined in Hledger.Data.Types

type Rep DigitGroupStyle Source # 
Instance details

Defined in Hledger.Data.Types

type Rep DigitGroupStyle = D1 ('MetaData "DigitGroupStyle" "Hledger.Data.Types" "hledger-lib-1.50.3-ABaCjsMZ3mfJvGwbSVH5pJ" 'False) (C1 ('MetaCons "DigitGroups" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Char) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [Word8])))

data Rounding Source #

"Rounding strategy" - how to apply an AmountStyle's display precision to a posting amount (and its cost, if any). Mainly used to customise print's output, with --round=none|soft|hard|all.

Constructors

NoRounding

keep display precisions unchanged in amt and cost

SoftRounding

do soft rounding of amt and cost amounts (show more or fewer decimal zeros to approximate the target precision, but don't hide significant digits)

HardRounding

do hard rounding of amt (use the exact target precision, possibly hiding significant digits), and soft rounding of cost

AllRounding

do hard rounding of amt and cost

Instances

Instances details
FromJSON Rounding Source # 
Instance details

Defined in Hledger.Data.Json

ToJSON Rounding Source # 
Instance details

Defined in Hledger.Data.Json

Generic Rounding Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep Rounding :: Type -> Type Source #

Read Rounding Source # 
Instance details

Defined in Hledger.Data.Types

Show Rounding Source # 
Instance details

Defined in Hledger.Data.Types

NFData Rounding Source # 
Instance details

Defined in Hledger.Data.Types

Methods

rnf :: Rounding -> () Source #

Eq Rounding Source # 
Instance details

Defined in Hledger.Data.Types

Ord Rounding Source # 
Instance details

Defined in Hledger.Data.Types

type Rep Rounding Source # 
Instance details

Defined in Hledger.Data.Types

type Rep Rounding = D1 ('MetaData "Rounding" "Hledger.Data.Types" "hledger-lib-1.50.3-ABaCjsMZ3mfJvGwbSVH5pJ" 'False) ((C1 ('MetaCons "NoRounding" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "SoftRounding" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "HardRounding" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "AllRounding" 'PrefixI 'False) (U1 :: Type -> Type)))

data Commodity Source #

Instances

Instances details
ToJSON Commodity Source # 
Instance details

Defined in Hledger.Data.Json

Generic Commodity Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep Commodity :: Type -> Type Source #

Show Commodity Source # 
Instance details

Defined in Hledger.Data.Types

NFData Commodity Source # 
Instance details

Defined in Hledger.Data.Types

Methods

rnf :: Commodity -> () Source #

Eq Commodity Source # 
Instance details

Defined in Hledger.Data.Types

type Rep Commodity Source # 
Instance details

Defined in Hledger.Data.Types

type Rep Commodity = D1 ('MetaData "Commodity" "Hledger.Data.Types" "hledger-lib-1.50.3-ABaCjsMZ3mfJvGwbSVH5pJ" 'False) (C1 ('MetaCons "Commodity" 'PrefixI 'True) (S1 ('MetaSel ('Just "csymbol") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 CommoditySymbol) :*: S1 ('MetaSel ('Just "cformat") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe AmountStyle))))

class HasAmounts a where Source #

Types with this class have one or more amounts, which can have display styles applied to them.

Instances

Instances details
HasAmounts Amount Source # 
Instance details

Defined in Hledger.Data.Amount

HasAmounts BalanceAssertion Source # 
Instance details

Defined in Hledger.Data.Posting

HasAmounts BalanceData Source # 
Instance details

Defined in Hledger.Data.Amount

HasAmounts MixedAmount Source # 
Instance details

Defined in Hledger.Data.Amount

HasAmounts Posting Source # 
Instance details

Defined in Hledger.Data.Posting

HasAmounts Transaction Source # 
Instance details

Defined in Hledger.Data.Transaction

HasAmounts AccountTransactionsReportItem Source # 
Instance details

Defined in Hledger.Reports.AccountTransactionsReport

HasAmounts BalanceReportItem Source # 
Instance details

Defined in Hledger.Reports.BalanceReport

HasAmounts PostingsReportItem Source # 
Instance details

Defined in Hledger.Reports.PostingsReport

HasAmounts a => HasAmounts (Account a) Source # 
Instance details

Defined in Hledger.Data.Amount

HasAmounts a => HasAmounts (PeriodData a) Source # 
Instance details

Defined in Hledger.Data.Amount

HasAmounts a => HasAmounts (Maybe a) Source # 
Instance details

Defined in Hledger.Data.Types

HasAmounts a => HasAmounts [a] Source # 
Instance details

Defined in Hledger.Data.Types

HasAmounts b => HasAmounts (CompoundPeriodicReport a b) Source # 
Instance details

Defined in Hledger.Reports.ReportTypes

HasAmounts b => HasAmounts (PeriodicReport a b) Source # 
Instance details

Defined in Hledger.Reports.ReportTypes

HasAmounts b => HasAmounts (PeriodicReportRow a b) Source # 
Instance details

Defined in Hledger.Reports.ReportTypes

(HasAmounts a, HasAmounts b) => HasAmounts (a, b) Source # 
Instance details

Defined in Hledger.Data.Types

Methods

styleAmounts :: Map CommoditySymbol AmountStyle -> (a, b) -> (a, b) Source #

HasAmounts b => HasAmounts (Text, PeriodicReport a b, Bool) Source # 
Instance details

Defined in Hledger.Reports.ReportTypes

data PostingType Source #

Instances

Instances details
FromJSON PostingType Source # 
Instance details

Defined in Hledger.Data.Json

ToJSON PostingType Source # 
Instance details

Defined in Hledger.Data.Json

Generic PostingType Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep PostingType :: Type -> Type Source #

Show PostingType Source # 
Instance details

Defined in Hledger.Data.Types

NFData PostingType Source # 
Instance details

Defined in Hledger.Data.Types

Methods

rnf :: PostingType -> () Source #

Eq PostingType Source # 
Instance details

Defined in Hledger.Data.Types

type Rep PostingType Source # 
Instance details

Defined in Hledger.Data.Types

type Rep PostingType = D1 ('MetaData "PostingType" "Hledger.Data.Types" "hledger-lib-1.50.3-ABaCjsMZ3mfJvGwbSVH5pJ" 'False) (C1 ('MetaCons "RegularPosting" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "VirtualPosting" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "BalancedVirtualPosting" 'PrefixI 'False) (U1 :: Type -> Type)))

type HiddenTag Source #

Arguments

 = Tag

A tag whose name begins with _.

data BalanceAssertion Source #

A balance assertion is a declaration about an account's expected balance at a certain point (posting date and parse order). They provide additional error checking and readability to a journal file.

A balance assignments is an instruction to hledger to adjust an account's balance to a certain amount at a certain point.

The BalanceAssertion type is used for representing both of these.

hledger supports multiple kinds of balance assertions/assignments, which differ in whether they refer to a single commodity or all commodities, and the (subaccount-)inclusive or exclusive account balance.

Constructors

BalanceAssertion 

Fields

Instances

Instances details
FromJSON BalanceAssertion Source # 
Instance details

Defined in Hledger.Data.Json

ToJSON BalanceAssertion Source # 
Instance details

Defined in Hledger.Data.Json

Generic BalanceAssertion Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep BalanceAssertion :: Type -> Type Source #

Show BalanceAssertion Source # 
Instance details

Defined in Hledger.Data.Types

NFData BalanceAssertion Source # 
Instance details

Defined in Hledger.Data.Types

Methods

rnf :: BalanceAssertion -> () Source #

Eq BalanceAssertion Source # 
Instance details

Defined in Hledger.Data.Types

HasAmounts BalanceAssertion Source # 
Instance details

Defined in Hledger.Data.Posting

type Rep BalanceAssertion Source # 
Instance details

Defined in Hledger.Data.Types

type Rep BalanceAssertion = D1 ('MetaData "BalanceAssertion" "Hledger.Data.Types" "hledger-lib-1.50.3-ABaCjsMZ3mfJvGwbSVH5pJ" 'False) (C1 ('MetaCons "BalanceAssertion" 'PrefixI 'True) ((S1 ('MetaSel ('Just "baamount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Amount) :*: S1 ('MetaSel ('Just "batotal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Bool)) :*: (S1 ('MetaSel ('Just "bainclusive") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Just "baposition") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SourcePos))))

data TMPostingRule Source #

A transaction modifier transformation, which adds an extra posting to the matched posting's transaction. Can be like a regular posting, or can have the tmprIsMultiplier flag set, indicating that it's a multiplier for the matched posting's amount.

Instances

Instances details
ToJSON TMPostingRule Source # 
Instance details

Defined in Hledger.Data.Json

Generic TMPostingRule Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep TMPostingRule :: Type -> Type Source #

Show TMPostingRule Source # 
Instance details

Defined in Hledger.Data.Types

NFData TMPostingRule Source # 
Instance details

Defined in Hledger.Data.Types

Methods

rnf :: TMPostingRule -> () Source #

Eq TMPostingRule Source # 
Instance details

Defined in Hledger.Data.Types

type Rep TMPostingRule Source # 
Instance details

Defined in Hledger.Data.Types

type Rep TMPostingRule = D1 ('MetaData "TMPostingRule" "Hledger.Data.Types" "hledger-lib-1.50.3-ABaCjsMZ3mfJvGwbSVH5pJ" 'False) (C1 ('MetaCons "TMPostingRule" 'PrefixI 'True) (S1 ('MetaSel ('Just "tmprPosting") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Posting) :*: S1 ('MetaSel ('Just "tmprIsMultiplier") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Bool)))

data TimeclockCode Source #

Instances

Instances details
ToJSON TimeclockCode Source # 
Instance details

Defined in Hledger.Data.Json

Generic TimeclockCode Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep TimeclockCode :: Type -> Type Source #

Read TimeclockCode Source # 
Instance details

Defined in Hledger.Data.Timeclock

Show TimeclockCode Source # 
Instance details

Defined in Hledger.Data.Timeclock

NFData TimeclockCode Source # 
Instance details

Defined in Hledger.Data.Types

Methods

rnf :: TimeclockCode -> () Source #

Eq TimeclockCode Source # 
Instance details

Defined in Hledger.Data.Types

Ord TimeclockCode Source # 
Instance details

Defined in Hledger.Data.Types

type Rep TimeclockCode Source # 
Instance details

Defined in Hledger.Data.Types

type Rep TimeclockCode = D1 ('MetaData "TimeclockCode" "Hledger.Data.Types" "hledger-lib-1.50.3-ABaCjsMZ3mfJvGwbSVH5pJ" 'False) ((C1 ('MetaCons "SetBalance" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "SetRequiredHours" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "In" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Out" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "FinalOut" 'PrefixI 'False) (U1 :: Type -> Type))))

data TimeclockEntry Source #

Instances

Instances details
ToJSON TimeclockEntry Source # 
Instance details

Defined in Hledger.Data.Json

Generic TimeclockEntry Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep TimeclockEntry :: Type -> Type Source #

Show TimeclockEntry Source # 
Instance details

Defined in Hledger.Data.Timeclock

NFData TimeclockEntry Source # 
Instance details

Defined in Hledger.Data.Types

Methods

rnf :: TimeclockEntry -> () Source #

Eq TimeclockEntry Source # 
Instance details

Defined in Hledger.Data.Types

Ord TimeclockEntry Source # 
Instance details

Defined in Hledger.Data.Types

type Rep TimeclockEntry Source # 
Instance details

Defined in Hledger.Data.Types

data PriceDirective Source #

A market price declaration made by the journal format's P directive. It declares two things: a historical exchange rate between two commodities, and an amount display style for the second commodity.

Instances

Instances details
ToJSON PriceDirective Source # 
Instance details

Defined in Hledger.Data.Json

Generic PriceDirective Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep PriceDirective :: Type -> Type Source #

Show PriceDirective Source # 
Instance details

Defined in Hledger.Data.Types

NFData PriceDirective Source # 
Instance details

Defined in Hledger.Data.Types

Methods

rnf :: PriceDirective -> () Source #

Eq PriceDirective Source # 
Instance details

Defined in Hledger.Data.Types

Ord PriceDirective Source # 
Instance details

Defined in Hledger.Data.Types

type Rep PriceDirective Source # 
Instance details

Defined in Hledger.Data.Types

type Rep PriceDirective = D1 ('MetaData "PriceDirective" "Hledger.Data.Types" "hledger-lib-1.50.3-ABaCjsMZ3mfJvGwbSVH5pJ" 'False) (C1 ('MetaCons "PriceDirective" 'PrefixI 'True) ((S1 ('MetaSel ('Just "pdsourcepos") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SourcePos) :*: S1 ('MetaSel ('Just "pddate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Day)) :*: (S1 ('MetaSel ('Just "pdcommodity") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 CommoditySymbol) :*: S1 ('MetaSel ('Just "pdamount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Amount))))

data MarketPrice Source #

A historical market price (exchange rate) from one commodity to another. A more concise form of a PriceDirective, without the amount display info.

Constructors

MarketPrice 

Fields

Instances

Instances details
FromJSON MarketPrice Source # 
Instance details

Defined in Hledger.Data.Json

ToJSON MarketPrice Source # 
Instance details

Defined in Hledger.Data.Json

Generic MarketPrice Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep MarketPrice :: Type -> Type Source #

Show MarketPrice Source # 
Instance details

Defined in Hledger.Data.Types

NFData MarketPrice Source # 
Instance details

Defined in Hledger.Data.Types

Methods

rnf :: MarketPrice -> () Source #

Eq MarketPrice Source # 
Instance details

Defined in Hledger.Data.Types

Ord MarketPrice Source # 
Instance details

Defined in Hledger.Data.Types

type Rep MarketPrice Source # 
Instance details

Defined in Hledger.Data.Types

data PayeeDeclarationInfo Source #

Extra information found in a payee directive.

Constructors

PayeeDeclarationInfo 

Fields

  • pdicomment :: Text

    any comment lines following the payee directive

  • pditags :: [Tag]

    tags extracted from the comment, if any

Instances

Instances details
ToJSON PayeeDeclarationInfo Source # 
Instance details

Defined in Hledger.Data.Json

Generic PayeeDeclarationInfo Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep PayeeDeclarationInfo :: Type -> Type Source #

Show PayeeDeclarationInfo Source # 
Instance details

Defined in Hledger.Data.Types

NFData PayeeDeclarationInfo Source # 
Instance details

Defined in Hledger.Data.Types

Eq PayeeDeclarationInfo Source # 
Instance details

Defined in Hledger.Data.Types

type Rep PayeeDeclarationInfo Source # 
Instance details

Defined in Hledger.Data.Types

type Rep PayeeDeclarationInfo = D1 ('MetaData "PayeeDeclarationInfo" "Hledger.Data.Types" "hledger-lib-1.50.3-ABaCjsMZ3mfJvGwbSVH5pJ" 'False) (C1 ('MetaCons "PayeeDeclarationInfo" 'PrefixI 'True) (S1 ('MetaSel ('Just "pdicomment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "pditags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Tag])))

newtype TagDeclarationInfo Source #

Extra information found in a tag directive.

Constructors

TagDeclarationInfo 

Fields

  • tdicomment :: Text

    any comment lines following the tag directive. No tags allowed here.

Instances

Instances details
ToJSON TagDeclarationInfo Source # 
Instance details

Defined in Hledger.Data.Json

Generic TagDeclarationInfo Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep TagDeclarationInfo :: Type -> Type Source #

Show TagDeclarationInfo Source # 
Instance details

Defined in Hledger.Data.Types

NFData TagDeclarationInfo Source # 
Instance details

Defined in Hledger.Data.Types

Methods

rnf :: TagDeclarationInfo -> () Source #

Eq TagDeclarationInfo Source # 
Instance details

Defined in Hledger.Data.Types

type Rep TagDeclarationInfo Source # 
Instance details

Defined in Hledger.Data.Types

type Rep TagDeclarationInfo = D1 ('MetaData "TagDeclarationInfo" "Hledger.Data.Types" "hledger-lib-1.50.3-ABaCjsMZ3mfJvGwbSVH5pJ" 'True) (C1 ('MetaCons "TagDeclarationInfo" 'PrefixI 'True) (S1 ('MetaSel ('Just "tdicomment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

data AccountDeclarationInfo Source #

Extra information about an account that can be derived from its account directive (and the other account directives).

Constructors

AccountDeclarationInfo 

Fields

Instances

Instances details
FromJSON AccountDeclarationInfo Source # 
Instance details

Defined in Hledger.Data.Json

ToJSON AccountDeclarationInfo Source # 
Instance details

Defined in Hledger.Data.Json

Generic AccountDeclarationInfo Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep AccountDeclarationInfo :: Type -> Type Source #

Show AccountDeclarationInfo Source # 
Instance details

Defined in Hledger.Data.Types

NFData AccountDeclarationInfo Source # 
Instance details

Defined in Hledger.Data.Types

Eq AccountDeclarationInfo Source # 
Instance details

Defined in Hledger.Data.Types

type Rep AccountDeclarationInfo Source # 
Instance details

Defined in Hledger.Data.Types

type Rep AccountDeclarationInfo = D1 ('MetaData "AccountDeclarationInfo" "Hledger.Data.Types" "hledger-lib-1.50.3-ABaCjsMZ3mfJvGwbSVH5pJ" 'False) (C1 ('MetaCons "AccountDeclarationInfo" 'PrefixI 'True) ((S1 ('MetaSel ('Just "adicomment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "aditags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Tag])) :*: (S1 ('MetaSel ('Just "adideclarationorder") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "adisourcepos") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SourcePos))))

type ParsedJournal = Journal Source #

A journal in the process of being parsed, not yet finalised. The data is partial, and list fields are in reverse order.

data SepFormat Source #

One of the standard *-separated value file types known by hledger,

Constructors

Csv 
Tsv 
Ssv 

data StorageFormat Source #

The id of a data format understood by hledger, eg journal or csv. The --output-format option selects one of these for output.

data NormalSign Source #

Whether an account's balance is normally a positive number (in accounting terms, a debit balance) or a negative number (credit balance). Assets and expenses are normally positive (debit), while liabilities, equity and income are normally negative (credit). https://en.wikipedia.org/wiki/Normal_balance

Instances

Instances details
Show NormalSign Source # 
Instance details

Defined in Hledger.Data.Types

Eq NormalSign Source # 
Instance details

Defined in Hledger.Data.Types

isAccountSubtypeOf :: AccountType -> AccountType -> Bool Source #

Check whether the first argument is a subtype of the second: either equal or one of the defined subtypes.

maCompare :: MixedAmount -> MixedAmount -> Ordering Source #

Compare two MixedAmounts, substituting 0 for the quantity of any missing commodities in either.

toHiddenTag :: Tag -> HiddenTag Source #

Add the _ prefix to a normal visible tag's name, making it a hidden tag.

toHiddenTagName :: TagName -> TagName Source #

Add the _ prefix to a normal visible tag's name, making it a hidden tag.

toVisibleTag :: HiddenTag -> Tag Source #

Drop the _ prefix from a hidden tag's name, making it a normal visible tag.

toVisibleTagName :: TagName -> TagName Source #

Drop the _ prefix from a hidden tag's name, making it a normal visible tag.

isHiddenTagName :: TagName -> Bool Source #

Does this tag name begin with the hidden tag prefix (_) ?