hledger-lib-1.19.1: A reusable library providing the core functionality of hledger
Safe HaskellNone
LanguageHaskell2010

Hledger.Data.Types

Description

Most data types are defined here to avoid import cycles. Here is an overview of the hledger data model:

Journal                  -- a journal is read from one or more data files. It contains..
 [Transaction]           -- journal transactions (aka entries), which have date, cleared status, code, description and..
  [Posting]              -- multiple account postings, which have account name and amount
 [MarketPrice]           -- historical market prices for commodities

Ledger                   -- a ledger is derived from a journal, by applying a filter specification and doing some further processing. It contains..
 Journal                 -- a filtered copy of the original journal, containing only the transactions and postings we are interested in
 [Account]               -- all accounts, in tree order beginning with a "root" account", with their balances and sub/parent accounts

For more detailed documentation on each type, see the corresponding modules.

Synopsis

Documentation

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 SmartSequence Source #

Constructors

Last 
This 
Next 

Instances

Instances details
Show SmartSequence 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
Eq WhichDate Source # 
Instance details

Defined in Hledger.Data.Types

Show WhichDate Source # 
Instance details

Defined in Hledger.Data.Types

data DateSpan Source #

Constructors

DateSpan (Maybe Day) (Maybe Day) 

Instances

Instances details
Eq DateSpan Source # 
Instance details

Defined in Hledger.Data.Types

Ord DateSpan Source # 
Instance details

Defined in Hledger.Data.Types

Show DateSpan Source # 
Instance details

Defined in Hledger.Data.Dates

Generic DateSpan Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep DateSpan :: Type -> Type Source #

Default DateSpan Source # 
Instance details

Defined in Hledger.Data.Types

Methods

def :: DateSpan #

ToJSON DateSpan 
Instance details

Defined in Hledger.Data.Json

Methods

toJSON :: DateSpan -> Value

toEncoding :: DateSpan -> Encoding

toJSONList :: [DateSpan] -> Value

toEncodingList :: [DateSpan] -> Encoding

type Rep DateSpan Source # 
Instance details

Defined in Hledger.Data.Types

type Rep DateSpan = D1 ('MetaData "DateSpan" "Hledger.Data.Types" "hledger-lib-1.19.1-AL3c7VBRgokAZ1hGFvMcVp" 'False) (C1 ('MetaCons "DateSpan" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Day)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Day))))

type Month = Int Source #

data Period Source #

Instances

Instances details
Eq Period Source # 
Instance details

Defined in Hledger.Data.Types

Ord Period Source # 
Instance details

Defined in Hledger.Data.Types

Show Period Source # 
Instance details

Defined in Hledger.Data.Types

Generic Period Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep Period :: Type -> Type Source #

Default Period Source # 
Instance details

Defined in Hledger.Data.Types

Methods

def :: Period #

type Rep Period Source # 
Instance details

Defined in Hledger.Data.Types

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

data Interval Source #

Instances

Instances details
Eq Interval Source # 
Instance details

Defined in Hledger.Data.Types

Ord Interval Source # 
Instance details

Defined in Hledger.Data.Types

Show Interval Source # 
Instance details

Defined in Hledger.Data.Types

Generic Interval Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep Interval :: Type -> Type Source #

Default Interval Source # 
Instance details

Defined in Hledger.Data.Types

Methods

def :: Interval #

ToJSON Interval 
Instance details

Defined in Hledger.Data.Json

Methods

toJSON :: Interval -> Value

toEncoding :: Interval -> Encoding

toJSONList :: [Interval] -> Value

toEncodingList :: [Interval] -> Encoding

type Rep Interval Source # 
Instance details

Defined in Hledger.Data.Types

type Rep Interval = D1 ('MetaData "Interval" "Hledger.Data.Types" "hledger-lib-1.19.1-AL3c7VBRgokAZ1hGFvMcVp" 'False) (((C1 ('MetaCons "NoInterval" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Days" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))) :+: (C1 ('MetaCons "Weeks" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :+: (C1 ('MetaCons "Months" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :+: C1 ('MetaCons "Quarters" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))))) :+: ((C1 ('MetaCons "Years" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :+: C1 ('MetaCons "DayOfMonth" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))) :+: (C1 ('MetaCons "WeekdayOfMonth" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :+: (C1 ('MetaCons "DayOfWeek" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :+: C1 ('MetaCons "DayOfYear" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))))))

data AccountType Source #

Constructors

Asset 
Liability 
Equity 
Revenue 
Expense 
Cash

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

Instances

Instances details
Eq AccountType Source # 
Instance details

Defined in Hledger.Data.Types

Ord AccountType Source # 
Instance details

Defined in Hledger.Data.Types

Show AccountType Source # 
Instance details

Defined in Hledger.Data.Types

Generic AccountType Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep AccountType :: Type -> Type Source #

ToJSON AccountType 
Instance details

Defined in Hledger.Data.Json

Methods

toJSON :: AccountType -> Value

toEncoding :: AccountType -> Encoding

toJSONList :: [AccountType] -> Value

toEncodingList :: [AccountType] -> Encoding

ToJSONKey AccountType 
Instance details

Defined in Hledger.Data.Json

Methods

toJSONKey :: ToJSONKeyFunction AccountType

toJSONKeyList :: ToJSONKeyFunction [AccountType]

type Rep AccountType Source # 
Instance details

Defined in Hledger.Data.Types

type Rep AccountType = D1 ('MetaData "AccountType" "Hledger.Data.Types" "hledger-lib-1.19.1-AL3c7VBRgokAZ1hGFvMcVp" '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))))

data AccountAlias Source #

Instances

Instances details
Eq AccountAlias Source # 
Instance details

Defined in Hledger.Data.Types

Ord AccountAlias Source # 
Instance details

Defined in Hledger.Data.Types

Read AccountAlias Source # 
Instance details

Defined in Hledger.Data.Types

Show AccountAlias Source # 
Instance details

Defined in Hledger.Data.Types

Generic AccountAlias Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep AccountAlias :: Type -> Type Source #

ToJSON AccountAlias 
Instance details

Defined in Hledger.Data.Json

Methods

toJSON :: AccountAlias -> Value

toEncoding :: AccountAlias -> Encoding

toJSONList :: [AccountAlias] -> Value

toEncodingList :: [AccountAlias] -> Encoding

type Rep AccountAlias Source # 
Instance details

Defined in Hledger.Data.Types

data Side Source #

Constructors

L 
R 

Instances

Instances details
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

Read Side Source # 
Instance details

Defined in Hledger.Data.Types

Show Side Source # 
Instance details

Defined in Hledger.Data.Types

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 #

FromJSON Side 
Instance details

Defined in Hledger.Data.Json

Methods

parseJSON :: Value -> Parser Side

parseJSONList :: Value -> Parser [Side]

ToJSON Side 
Instance details

Defined in Hledger.Data.Json

Methods

toJSON :: Side -> Value

toEncoding :: Side -> Encoding

toJSONList :: [Side] -> Value

toEncodingList :: [Side] -> Encoding

type Rep Side Source # 
Instance details

Defined in Hledger.Data.Types

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

type Quantity = Decimal Source #

The basic numeric type used in amounts.

data AmountPrice Source #

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

Instances

Instances details
Eq AmountPrice Source # 
Instance details

Defined in Hledger.Data.Types

Ord AmountPrice Source # 
Instance details

Defined in Hledger.Data.Types

Show AmountPrice Source # 
Instance details

Defined in Hledger.Data.Types

Generic AmountPrice Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep AmountPrice :: Type -> Type Source #

FromJSON AmountPrice 
Instance details

Defined in Hledger.Data.Json

Methods

parseJSON :: Value -> Parser AmountPrice

parseJSONList :: Value -> Parser [AmountPrice]

ToJSON AmountPrice 
Instance details

Defined in Hledger.Data.Json

Methods

toJSON :: AmountPrice -> Value

toEncoding :: AmountPrice -> Encoding

toJSONList :: [AmountPrice] -> Value

toEncodingList :: [AmountPrice] -> Encoding

type Rep AmountPrice Source # 
Instance details

Defined in Hledger.Data.Types

type Rep AmountPrice = D1 ('MetaData "AmountPrice" "Hledger.Data.Types" "hledger-lib-1.19.1-AL3c7VBRgokAZ1hGFvMcVp" 'False) (C1 ('MetaCons "UnitPrice" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Amount)) :+: C1 ('MetaCons "TotalPrice" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Amount)))

data AmountStyle Source #

Display style for an amount.

Constructors

AmountStyle 

Fields

Instances

Instances details
Eq AmountStyle Source # 
Instance details

Defined in Hledger.Data.Types

Ord AmountStyle Source # 
Instance details

Defined in Hledger.Data.Types

Read AmountStyle Source # 
Instance details

Defined in Hledger.Data.Types

Show AmountStyle Source # 
Instance details

Defined in Hledger.Data.Types

Generic AmountStyle Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep AmountStyle :: Type -> Type Source #

FromJSON AmountStyle 
Instance details

Defined in Hledger.Data.Json

Methods

parseJSON :: Value -> Parser AmountStyle

parseJSONList :: Value -> Parser [AmountStyle]

ToJSON AmountStyle 
Instance details

Defined in Hledger.Data.Json

Methods

toJSON :: AmountStyle -> Value

toEncoding :: AmountStyle -> Encoding

toJSONList :: [AmountStyle] -> Value

toEncodingList :: [AmountStyle] -> Encoding

type Rep AmountStyle Source # 
Instance details

Defined in Hledger.Data.Types

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

data AmountPrecision Source #

Instances

Instances details
Eq AmountPrecision Source # 
Instance details

Defined in Hledger.Data.Types

Ord AmountPrecision Source # 
Instance details

Defined in Hledger.Data.Types

Read AmountPrecision Source # 
Instance details

Defined in Hledger.Data.Types

Show AmountPrecision Source # 
Instance details

Defined in Hledger.Data.Types

Generic AmountPrecision Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep AmountPrecision :: Type -> Type Source #

FromJSON AmountPrecision 
Instance details

Defined in Hledger.Data.Json

Methods

parseJSON :: Value -> Parser AmountPrecision

parseJSONList :: Value -> Parser [AmountPrecision]

ToJSON AmountPrecision 
Instance details

Defined in Hledger.Data.Json

Methods

toJSON :: AmountPrecision -> Value

toEncoding :: AmountPrecision -> Encoding

toJSONList :: [AmountPrecision] -> Value

toEncodingList :: [AmountPrecision] -> Encoding

type Rep AmountPrecision Source # 
Instance details

Defined in Hledger.Data.Types

type Rep AmountPrecision = D1 ('MetaData "AmountPrecision" "Hledger.Data.Types" "hledger-lib-1.19.1-AL3c7VBRgokAZ1hGFvMcVp" '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 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
Eq DigitGroupStyle Source # 
Instance details

Defined in Hledger.Data.Types

Ord DigitGroupStyle Source # 
Instance details

Defined in Hledger.Data.Types

Read DigitGroupStyle Source # 
Instance details

Defined in Hledger.Data.Types

Show DigitGroupStyle Source # 
Instance details

Defined in Hledger.Data.Types

Generic DigitGroupStyle Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep DigitGroupStyle :: Type -> Type Source #

FromJSON DigitGroupStyle 
Instance details

Defined in Hledger.Data.Json

Methods

parseJSON :: Value -> Parser DigitGroupStyle

parseJSONList :: Value -> Parser [DigitGroupStyle]

ToJSON DigitGroupStyle 
Instance details

Defined in Hledger.Data.Json

Methods

toJSON :: DigitGroupStyle -> Value

toEncoding :: DigitGroupStyle -> Encoding

toJSONList :: [DigitGroupStyle] -> Value

toEncodingList :: [DigitGroupStyle] -> Encoding

type Rep DigitGroupStyle Source # 
Instance details

Defined in Hledger.Data.Types

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

data Commodity Source #

Instances

Instances details
Eq Commodity Source # 
Instance details

Defined in Hledger.Data.Types

Show Commodity Source # 
Instance details

Defined in Hledger.Data.Types

Generic Commodity Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep Commodity :: Type -> Type Source #

ToJSON Commodity 
Instance details

Defined in Hledger.Data.Json

Methods

toJSON :: Commodity -> Value

toEncoding :: Commodity -> Encoding

toJSONList :: [Commodity] -> Value

toEncodingList :: [Commodity] -> Encoding

type Rep Commodity Source # 
Instance details

Defined in Hledger.Data.Types

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

data Amount Source #

Constructors

Amount 

Fields

Instances

Instances details
Eq Amount Source # 
Instance details

Defined in Hledger.Data.Types

Num Amount Source # 
Instance details

Defined in Hledger.Data.Amount

Ord Amount Source # 
Instance details

Defined in Hledger.Data.Types

Show Amount Source # 
Instance details

Defined in Hledger.Data.Types

Generic Amount Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep Amount :: Type -> Type Source #

FromJSON Amount 
Instance details

Defined in Hledger.Data.Json

Methods

parseJSON :: Value -> Parser Amount

parseJSONList :: Value -> Parser [Amount]

ToJSON Amount 
Instance details

Defined in Hledger.Data.Json

Methods

toJSON :: Amount -> Value

toEncoding :: Amount -> Encoding

toJSONList :: [Amount] -> Value

toEncodingList :: [Amount] -> Encoding

type Rep Amount Source # 
Instance details

Defined in Hledger.Data.Types

newtype MixedAmount Source #

Constructors

Mixed [Amount] 

Instances

Instances details
Eq MixedAmount Source # 
Instance details

Defined in Hledger.Data.Types

Num MixedAmount Source # 
Instance details

Defined in Hledger.Data.Amount

Ord MixedAmount Source # 
Instance details

Defined in Hledger.Data.Types

Show MixedAmount Source # 
Instance details

Defined in Hledger.Data.Types

Generic MixedAmount Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep MixedAmount :: Type -> Type Source #

FromJSON MixedAmount 
Instance details

Defined in Hledger.Data.Json

Methods

parseJSON :: Value -> Parser MixedAmount

parseJSONList :: Value -> Parser [MixedAmount]

ToJSON MixedAmount 
Instance details

Defined in Hledger.Data.Json

Methods

toJSON :: MixedAmount -> Value

toEncoding :: MixedAmount -> Encoding

toJSONList :: [MixedAmount] -> Value

toEncodingList :: [MixedAmount] -> Encoding

type Rep MixedAmount Source # 
Instance details

Defined in Hledger.Data.Types

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

data PostingType Source #

Instances

Instances details
Eq PostingType Source # 
Instance details

Defined in Hledger.Data.Types

Show PostingType Source # 
Instance details

Defined in Hledger.Data.Types

Generic PostingType Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep PostingType :: Type -> Type Source #

FromJSON PostingType 
Instance details

Defined in Hledger.Data.Json

Methods

parseJSON :: Value -> Parser PostingType

parseJSONList :: Value -> Parser [PostingType]

ToJSON PostingType 
Instance details

Defined in Hledger.Data.Json

Methods

toJSON :: PostingType -> Value

toEncoding :: PostingType -> Encoding

toJSONList :: [PostingType] -> Value

toEncodingList :: [PostingType] -> Encoding

type Rep PostingType Source # 
Instance details

Defined in Hledger.Data.Types

type Rep PostingType = D1 ('MetaData "PostingType" "Hledger.Data.Types" "hledger-lib-1.19.1-AL3c7VBRgokAZ1hGFvMcVp" '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 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
Bounded Status Source # 
Instance details

Defined in Hledger.Data.Types

Enum Status Source # 
Instance details

Defined in Hledger.Data.Types

Eq Status Source # 
Instance details

Defined in Hledger.Data.Types

Ord Status Source # 
Instance details

Defined in Hledger.Data.Types

Show 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 #

FromJSON Status 
Instance details

Defined in Hledger.Data.Json

Methods

parseJSON :: Value -> Parser Status

parseJSONList :: Value -> Parser [Status]

ToJSON Status 
Instance details

Defined in Hledger.Data.Json

Methods

toJSON :: Status -> Value

toEncoding :: Status -> Encoding

toJSONList :: [Status] -> Value

toEncodingList :: [Status] -> Encoding

type Rep Status Source # 
Instance details

Defined in Hledger.Data.Types

type Rep Status = D1 ('MetaData "Status" "Hledger.Data.Types" "hledger-lib-1.19.1-AL3c7VBRgokAZ1hGFvMcVp" '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)))

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.

The BalanceAssertion type is also used to represent balance assignments, which instruct hledger what an account's balance should become at a certain point.

Different kinds of balance assertions are discussed eg on #290. Variables include:

  • which postings are to be summed (realvirtual; unmarkedpendingcleared; this accountthis account including subs)
  • which commodities within the balance are to be checked
  • whether to do a partial or a total check (disallowing other commodities)

I suspect we want:

  1. partial, subaccount-exclusive, Ledger-compatible assertions. Because they're what we've always had, and removing them would break some journals unnecessarily. Implemented with = syntax.
  2. total assertions. Because otherwise assertions are a bit leaky. Implemented with == syntax.
  3. subaccount-inclusive assertions. Because that's something folks need. Not implemented.
  4. flexible assertions allowing custom criteria (perhaps arbitrary queries). Because power users have diverse needs and want to try out different schemes (assert cleared balances, assert balance from real or virtual postings, etc.). Not implemented.
  5. multicommodity assertions, asserting the balance of multiple commodities at once. Not implemented, requires #934.

Constructors

BalanceAssertion 

Fields

Instances

Instances details
Eq BalanceAssertion Source # 
Instance details

Defined in Hledger.Data.Types

Show BalanceAssertion Source # 
Instance details

Defined in Hledger.Data.Types

Generic BalanceAssertion Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep BalanceAssertion :: Type -> Type Source #

FromJSON BalanceAssertion 
Instance details

Defined in Hledger.Data.Json

Methods

parseJSON :: Value -> Parser BalanceAssertion

parseJSONList :: Value -> Parser [BalanceAssertion]

ToJSON BalanceAssertion 
Instance details

Defined in Hledger.Data.Json

type Rep BalanceAssertion Source # 
Instance details

Defined in Hledger.Data.Types

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

data Posting Source #

Constructors

Posting 

Fields

Instances

Instances details
Eq Posting Source # 
Instance details

Defined in Hledger.Data.Types

Show Posting Source #

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

Instance details

Defined in Hledger.Data.Types

Generic Posting Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep Posting :: Type -> Type Source #

FromJSON Posting 
Instance details

Defined in Hledger.Data.Json

Methods

parseJSON :: Value -> Parser Posting

parseJSONList :: Value -> Parser [Posting]

ToJSON Posting 
Instance details

Defined in Hledger.Data.Json

Methods

toJSON :: Posting -> Value

toEncoding :: Posting -> Encoding

toJSONList :: [Posting] -> Value

toEncodingList :: [Posting] -> Encoding

type Rep Posting Source # 
Instance details

Defined in Hledger.Data.Types

data GenericSourcePos Source #

The position of parse errors (eg), like parsec's SourcePos but generic.

Constructors

GenericSourcePos FilePath Int Int

file path, 1-based line number and 1-based column number.

JournalSourcePos FilePath (Int, Int)

file path, inclusive range of 1-based line numbers (first, last).

Instances

Instances details
Eq GenericSourcePos Source # 
Instance details

Defined in Hledger.Data.Types

Ord GenericSourcePos Source # 
Instance details

Defined in Hledger.Data.Types

Read GenericSourcePos Source # 
Instance details

Defined in Hledger.Data.Types

Show GenericSourcePos Source # 
Instance details

Defined in Hledger.Data.Types

Generic GenericSourcePos Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep GenericSourcePos :: Type -> Type Source #

FromJSON GenericSourcePos 
Instance details

Defined in Hledger.Data.Json

Methods

parseJSON :: Value -> Parser GenericSourcePos

parseJSONList :: Value -> Parser [GenericSourcePos]

ToJSON GenericSourcePos 
Instance details

Defined in Hledger.Data.Json

type Rep GenericSourcePos Source # 
Instance details

Defined in Hledger.Data.Types

data Transaction Source #

Constructors

Transaction 

Fields

Instances

Instances details
Eq Transaction Source # 
Instance details

Defined in Hledger.Data.Types

Show Transaction Source # 
Instance details

Defined in Hledger.Data.Types

Generic Transaction Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep Transaction :: Type -> Type Source #

FromJSON Transaction 
Instance details

Defined in Hledger.Data.Json

Methods

parseJSON :: Value -> Parser Transaction

parseJSONList :: Value -> Parser [Transaction]

ToJSON Transaction 
Instance details

Defined in Hledger.Data.Json

Methods

toJSON :: Transaction -> Value

toEncoding :: Transaction -> Encoding

toJSONList :: [Transaction] -> Value

toEncodingList :: [Transaction] -> Encoding

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
Eq TransactionModifier Source # 
Instance details

Defined in Hledger.Data.Types

Show TransactionModifier Source # 
Instance details

Defined in Hledger.Data.Types

Generic TransactionModifier Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep TransactionModifier :: Type -> Type Source #

ToJSON TransactionModifier 
Instance details

Defined in Hledger.Data.Json

type Rep TransactionModifier Source # 
Instance details

Defined in Hledger.Data.Types

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

type TMPostingRule = Posting Source #

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

data PeriodicTransaction Source #

A periodic transaction rule, describing a transaction that recurs.

Constructors

PeriodicTransaction 

Fields

Instances

Instances details
Eq PeriodicTransaction Source # 
Instance details

Defined in Hledger.Data.Types

Show PeriodicTransaction Source # 
Instance details

Defined in Hledger.Data.PeriodicTransaction

Generic PeriodicTransaction Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep PeriodicTransaction :: Type -> Type Source #

ToJSON PeriodicTransaction 
Instance details

Defined in Hledger.Data.Json

type Rep PeriodicTransaction Source # 
Instance details

Defined in Hledger.Data.Types

data TimeclockCode Source #

Instances

Instances details
Eq TimeclockCode Source # 
Instance details

Defined in Hledger.Data.Types

Ord TimeclockCode Source # 
Instance details

Defined in Hledger.Data.Types

Read TimeclockCode Source # 
Instance details

Defined in Hledger.Data.Timeclock

Show TimeclockCode Source # 
Instance details

Defined in Hledger.Data.Timeclock

Generic TimeclockCode Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep TimeclockCode :: Type -> Type Source #

ToJSON TimeclockCode 
Instance details

Defined in Hledger.Data.Json

Methods

toJSON :: TimeclockCode -> Value

toEncoding :: TimeclockCode -> Encoding

toJSONList :: [TimeclockCode] -> Value

toEncodingList :: [TimeclockCode] -> Encoding

type Rep TimeclockCode Source # 
Instance details

Defined in Hledger.Data.Types

type Rep TimeclockCode = D1 ('MetaData "TimeclockCode" "Hledger.Data.Types" "hledger-lib-1.19.1-AL3c7VBRgokAZ1hGFvMcVp" '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
Eq TimeclockEntry Source # 
Instance details

Defined in Hledger.Data.Types

Ord TimeclockEntry Source # 
Instance details

Defined in Hledger.Data.Types

Show TimeclockEntry Source # 
Instance details

Defined in Hledger.Data.Timeclock

Generic TimeclockEntry Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep TimeclockEntry :: Type -> Type Source #

ToJSON TimeclockEntry 
Instance details

Defined in Hledger.Data.Json

Methods

toJSON :: TimeclockEntry -> Value

toEncoding :: TimeclockEntry -> Encoding

toJSONList :: [TimeclockEntry] -> Value

toEncodingList :: [TimeclockEntry] -> Encoding

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
Eq PriceDirective Source # 
Instance details

Defined in Hledger.Data.Types

Ord PriceDirective Source # 
Instance details

Defined in Hledger.Data.Types

Show PriceDirective Source # 
Instance details

Defined in Hledger.Data.Types

Generic PriceDirective Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep PriceDirective :: Type -> Type Source #

ToJSON PriceDirective 
Instance details

Defined in Hledger.Data.Json

Methods

toJSON :: PriceDirective -> Value

toEncoding :: PriceDirective -> Encoding

toJSONList :: [PriceDirective] -> Value

toEncodingList :: [PriceDirective] -> Encoding

type Rep PriceDirective Source # 
Instance details

Defined in Hledger.Data.Types

type Rep PriceDirective = D1 ('MetaData "PriceDirective" "Hledger.Data.Types" "hledger-lib-1.19.1-AL3c7VBRgokAZ1hGFvMcVp" 'False) (C1 ('MetaCons "PriceDirective" 'PrefixI 'True) (S1 ('MetaSel ('Just "pddate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Day) :*: (S1 ('MetaSel ('Just "pdcommodity") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CommoditySymbol) :*: S1 ('MetaSel ('Just "pdamount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (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
Eq MarketPrice Source # 
Instance details

Defined in Hledger.Data.Types

Ord MarketPrice Source # 
Instance details

Defined in Hledger.Data.Types

Show MarketPrice Source # 
Instance details

Defined in Hledger.Data.Amount

Generic MarketPrice Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep MarketPrice :: Type -> Type Source #

FromJSON MarketPrice 
Instance details

Defined in Hledger.Data.Json

Methods

parseJSON :: Value -> Parser MarketPrice

parseJSONList :: Value -> Parser [MarketPrice]

ToJSON MarketPrice 
Instance details

Defined in Hledger.Data.Json

Methods

toJSON :: MarketPrice -> Value

toEncoding :: MarketPrice -> Encoding

toJSONList :: [MarketPrice] -> Value

toEncodingList :: [MarketPrice] -> Encoding

type Rep MarketPrice Source # 
Instance details

Defined in Hledger.Data.Types

data Journal Source #

A Journal, containing transactions and various other things. The basic data model for hledger.

This is used during parsing (as the type alias ParsedJournal), and then finalised/validated for use as a Journal. Some extra parsing-related fields are included for convenience, at least for now. In a ParsedJournal these are updated as parsing proceeds, in a Journal they represent the final state at end of parsing (used eg by the add command).

Constructors

Journal 

Fields

Instances

Instances details
Eq Journal Source # 
Instance details

Defined in Hledger.Data.Types

Show 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 #

Semigroup Journal Source # 
Instance details

Defined in Hledger.Data.Journal

Default Journal Source # 
Instance details

Defined in Hledger.Data.Journal

Methods

def :: Journal #

ToJSON Journal 
Instance details

Defined in Hledger.Data.Json

Methods

toJSON :: Journal -> Value

toEncoding :: Journal -> Encoding

toJSONList :: [Journal] -> Value

toEncodingList :: [Journal] -> Encoding

type Rep Journal Source # 
Instance details

Defined in Hledger.Data.Types

type Rep Journal = D1 ('MetaData "Journal" "Hledger.Data.Types" "hledger-lib-1.19.1-AL3c7VBRgokAZ1hGFvMcVp" 'False) (C1 ('MetaCons "Journal" 'PrefixI 'True) ((((S1 ('MetaSel ('Just "jparsedefaultyear") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Year)) :*: S1 ('MetaSel ('Just "jparsedefaultcommodity") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (CommoditySymbol, AmountStyle)))) :*: (S1 ('MetaSel ('Just "jparseparentaccounts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [AccountName]) :*: S1 ('MetaSel ('Just "jparsealiases") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [AccountAlias]))) :*: ((S1 ('MetaSel ('Just "jparsetimeclockentries") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TimeclockEntry]) :*: S1 ('MetaSel ('Just "jincludefilestack") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [FilePath])) :*: (S1 ('MetaSel ('Just "jdeclaredaccounts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(AccountName, AccountDeclarationInfo)]) :*: (S1 ('MetaSel ('Just "jdeclaredaccounttypes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map AccountType [AccountName])) :*: S1 ('MetaSel ('Just "jcommodities") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map CommoditySymbol Commodity)))))) :*: (((S1 ('MetaSel ('Just "jinferredcommodities") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map CommoditySymbol AmountStyle)) :*: S1 ('MetaSel ('Just "jpricedirectives") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [PriceDirective])) :*: (S1 ('MetaSel ('Just "jinferredmarketprices") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [MarketPrice]) :*: S1 ('MetaSel ('Just "jtxnmodifiers") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TransactionModifier]))) :*: ((S1 ('MetaSel ('Just "jperiodictxns") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [PeriodicTransaction]) :*: S1 ('MetaSel ('Just "jtxns") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Transaction])) :*: (S1 ('MetaSel ('Just "jfinalcommentlines") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "jfiles") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(FilePath, Text)]) :*: S1 ('MetaSel ('Just "jlastreadtime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ClockTime)))))))

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.

type StorageFormat = String 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 AccountDeclarationInfo Source #

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

Constructors

AccountDeclarationInfo 

Fields

  • adicomment :: Text

    any comment lines following an account directive for this account

  • aditags :: [Tag]

    tags extracted from the account comment, if any

  • adideclarationorder :: Int

    the order in which this account was declared, relative to other account declarations, during parsing (1..)

Instances

Instances details
Eq AccountDeclarationInfo Source # 
Instance details

Defined in Hledger.Data.Types

Show AccountDeclarationInfo Source # 
Instance details

Defined in Hledger.Data.Types

Generic AccountDeclarationInfo Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep AccountDeclarationInfo :: Type -> Type Source #

FromJSON AccountDeclarationInfo 
Instance details

Defined in Hledger.Data.Json

Methods

parseJSON :: Value -> Parser AccountDeclarationInfo

parseJSONList :: Value -> Parser [AccountDeclarationInfo]

ToJSON AccountDeclarationInfo 
Instance details

Defined in Hledger.Data.Json

type Rep AccountDeclarationInfo Source # 
Instance details

Defined in Hledger.Data.Types

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

data Account Source #

An account, with its balances, parent/subaccount relationships, etc. Only the name is required; the other fields are added when needed.

Constructors

Account 

Fields

Instances

Instances details
Eq Account Source # 
Instance details

Defined in Hledger.Data.Account

Show Account Source # 
Instance details

Defined in Hledger.Data.Account

Generic Account Source # 
Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep Account :: Type -> Type Source #

FromJSON Account 
Instance details

Defined in Hledger.Data.Json

Methods

parseJSON :: Value -> Parser Account

parseJSONList :: Value -> Parser [Account]

ToJSON Account 
Instance details

Defined in Hledger.Data.Json

Methods

toJSON :: Account -> Value

toEncoding :: Account -> Encoding

toJSONList :: [Account] -> Value

toEncodingList :: [Account] -> Encoding

type Rep Account Source # 
Instance details

Defined in Hledger.Data.Types

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
Eq NormalSign Source # 
Instance details

Defined in Hledger.Data.Types

Show NormalSign Source # 
Instance details

Defined in Hledger.Data.Types

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
Show Ledger Source # 
Instance details

Defined in Hledger.Data.Ledger

Generic Ledger Source # 
Instance details

Defined in Hledger.Data.Json

Associated Types

type Rep Ledger :: Type -> Type Source #

ToJSON Ledger 
Instance details

Defined in Hledger.Data.Json

Methods

toJSON :: Ledger -> Value

toEncoding :: Ledger -> Encoding

toJSONList :: [Ledger] -> Value

toEncodingList :: [Ledger] -> Encoding

type Rep Ledger Source # 
Instance details

Defined in Hledger.Data.Json

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

Orphan instances

Generic ClockTime Source # 
Instance details

Associated Types

type Rep ClockTime :: Type -> Type Source #

ToMarkup Quantity Source # 
Instance details