hledger-lib-1.52.1: A library providing the core functionality of hledger

Safe Haskell | None
Language | GHC2021

Hledger.Data.Types

Contents

- Orphan instances

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

- data Side
  - = L
  - | R
- type Tag = (TagName, TagValue)
- data AccountType
  - = Asset
  - | Liability
  - | Equity
  - | Revenue
  - | Expense
  - | Cash
  - | Conversion
  - | Gain
  - | UnrealisedGain
- data SepFormat
  - = Csv
  - | Tsv
  - | Ssv
- data Status
  - = Unmarked
  - | Pending
  - | Cleared
- data Period
  - = DayPeriod Day
  - | WeekPeriod Day
  - | MonthPeriod Year Month
  - | QuarterPeriod Year Quarter
  - | YearPeriod Year
  - | PeriodBetween Day Day
  - | PeriodFrom Day
  - | PeriodTo Day
  - | PeriodAll
- data SmartInterval
  - = Day
  - | Week
  - | Month
  - | Quarter
  - | Year
- type YearDay = Int
- type Month = Int
- type MonthDay = Int
- data Interval
  - = NoInterval
  - | Days Int
  - | Weeks Int
  - | Months Int
  - | Quarters Int
  - | Years Int
  - | NthWeekdayOfMonth Int Int
  - | MonthDay Int
  - | MonthAndDay Int Int
  - | DaysOfWeek [Int]
- type Quarter = Int
- data MixedAmountKey
  - = MixedAmountKeyNoCost !CommoditySymbol
  - | MixedAmountKeyTotalCost !CommoditySymbol !CommoditySymbol
  - | MixedAmountKeyUnitCost !CommoditySymbol !CommoditySymbol !Quantity
- newtype MixedAmount = Mixed (Map MixedAmountKey Amount)
- data Account a = Account {
  - aname :: AccountName
  - adeclarationinfo :: Maybe AccountDeclarationInfo
  - asubs :: [Account a]
  - aparent :: Maybe (Account a)
  - aboring :: Bool
  - adata :: PeriodData a
  }
- type AccountName = Text
- data Amount = Amount {
  - acommodity :: !CommoditySymbol
  - aquantity :: !Quantity
  - astyle :: !AmountStyle
  - acost :: !(Maybe AmountCost)
  - acostbasis :: !(Maybe CostBasis)
  }
- data BalanceData = BalanceData {
  - bdexcludingsubs :: MixedAmount
  - bdincludingsubs :: MixedAmount
  - bdnumpostings :: Int
  }
- data Journal = Journal {
  - jparsedefaultyear :: Maybe Year
  - jparsedefaultcommodity :: Maybe (CommoditySymbol, AmountStyle)
  - jparsedecimalmark :: Maybe DecimalMark
  - jparseparentaccounts :: [AccountName]
  - jparsealiases :: [AccountAlias]
  - jparsetimeclockentries :: [TimeclockEntry]
  - jincludefilestack :: [(FilePath, FilePath)]
  - jdeclaredpayees :: [(Payee, PayeeDeclarationInfo)]
  - jdeclaredtags :: [(TagName, TagDeclarationInfo)]
  - jdeclaredaccounts :: [(AccountName, AccountDeclarationInfo)]
  - jdeclaredaccounttags :: Map AccountName [Tag]
  - jdeclaredaccounttypes :: Map AccountType [AccountName]
  - jaccounttypes :: Map AccountName AccountType
  - jdeclaredcommodities :: Map CommoditySymbol Commodity
  - jdeclaredcommoditytags :: Map CommoditySymbol [Tag]
  - jinferredcommoditystyles :: Map CommoditySymbol AmountStyle
  - jglobalcommoditystyles :: Map CommoditySymbol AmountStyle
  - jpricedirectives :: [PriceDirective]
  - jinferredmarketprices :: [MarketPrice]
  - jtxnmodifiers :: [TransactionModifier]
  - jperiodictxns :: [PeriodicTransaction]
  - jtxns :: [Transaction]
  - jfinalcommentlines :: Text
  - jfiles :: [(FilePath, Text)]
  - jlastreadtime :: POSIXTime
  }
- data Ledger = Ledger {
  - ljournal :: Journal
  - laccounts :: [Account BalanceData]
  }
- data PeriodData a = PeriodData {
  - pdpre :: a
  - pdperiods :: Map Day a
  }
- data PeriodicTransaction = PeriodicTransaction {
  - ptperiodexpr :: Text
  - ptinterval :: Interval
  - ptspan :: DateSpan
  - ptsourcepos :: (SourcePos, SourcePos)
  - ptstatus :: Status
  - ptcode :: Text
  - ptdescription :: Text
  - ptcomment :: Text
  - pttags :: [Tag]
  - ptpostings :: [Posting]
  }
- data Posting = Posting {
  - pdate :: Maybe Day
  - pdate2 :: Maybe Day
  - pstatus :: Status
  - paccount :: AccountName
  - pamount :: MixedAmount
  - pcomment :: Text
  - ptype :: PostingType
  - ptags :: [Tag]
  - pbalanceassertion :: Maybe BalanceAssertion
  - ptransaction :: Maybe Transaction
  - poriginal :: Maybe Posting
  }
- data StorageFormat
  - = Rules
  - | Journal'
  - | Ledger'
  - | Timeclock
  - | Timedot
  - | Sep SepFormat
- data Transaction = Transaction {
  - tindex :: Integer
  - tprecedingcomment :: Text
  - tsourcepos :: (SourcePos, SourcePos)
  - tdate :: Day
  - tdate2 :: Maybe Day
  - tstatus :: Status
  - tcode :: Text
  - tdescription :: Text
  - tcomment :: Text
  - ttags :: [Tag]
  - tpostings :: [Posting]
  }
- data TransactionModifier = TransactionModifier {
  - tmquerytxt :: Text
  - tmpostingrules :: [TMPostingRule]
  }
- fromEFDay :: EFDay -> Day
- modifyEFDay :: (Day -> Day) -> EFDay -> EFDay
- type CommoditySymbol = Text
- data AmountPrecision
  - = Precision !Word8
  - | NaturalPrecision
- data AmountStyle = AmountStyle {
  - ascommodityside :: !Side
  - ascommodityspaced :: !Bool
  - asdigitgroups :: !(Maybe DigitGroupStyle)
  - asdecimalmark :: !(Maybe Char)
  - asprecision :: !AmountPrecision
  - asrounding :: !Rounding
  }
- data EFDay
  - = Exact Day
  - | Flex Day
- type YearWeek = Int
- type MonthWeek = Int
- type WeekDay = Int
- data SmartDate
  - = SmartCompleteDate Day
  - | SmartAssumeStart Year (Maybe Month)
  - | SmartFromReference (Maybe Month) MonthDay
  - | SmartMonth Month
  - | SmartRelative Integer SmartInterval
  - | SmartRelativeMonth Ordering Month
  - | SmartRelativeWeekDay Ordering WeekDay
- data WhichDate
  - = PrimaryDate
  - | SecondaryDate
- data DateSpan = DateSpan (Maybe EFDay) (Maybe EFDay)
- type Payee = Text
- data DepthSpec = DepthSpec {
  - dsFlatDepth :: Maybe Int
  - dsRegexpDepths :: [(Regexp, Int)]
  }
- isBalanceSheetAccountType :: AccountType -> Bool
- isIncomeStatementAccountType :: AccountType -> Bool
- isAccountSubtypeOf :: AccountType -> AccountType -> Bool
- data AccountAlias
  - = BasicAlias AccountName AccountName
  - | RegexAlias Regexp Replacement
- type DecimalMark = Char
- isDecimalMark :: Char -> Bool
- type Quantity = Decimal
- data AmountCost
  - = UnitCost !Amount
  - | TotalCost !Amount
- data DigitGroupStyle = DigitGroups !Char ![Word8]
- data Rounding
  - = NoRounding
  - | SoftRounding
  - | HardRounding
  - | AllRounding
- data Commodity = Commodity {
  - csymbol :: CommoditySymbol
  - cformat :: Maybe AmountStyle
  - ccomment :: Text
  - ctags :: [Tag]
  }
- data CostBasis = CostBasis {
  - cbCost :: !(Maybe Amount)
  - cbDate :: !(Maybe Day)
  - cbLabel :: !(Maybe Text)
  }
- class HasAmounts a where
  - styleAmounts :: Map CommoditySymbol AmountStyle -> a -> a
- maCompare :: MixedAmount -> MixedAmount -> Ordering
- data PostingType
  - = RegularPosting
  - | VirtualPosting
  - | BalancedVirtualPosting
- type TagName = Text
- type TagValue = Text
- type HiddenTag = Tag
- type DateTag = (TagName, Day)
- toHiddenTag :: Tag -> HiddenTag
- toHiddenTagName :: TagName -> TagName
- toVisibleTag :: HiddenTag -> Tag
- toVisibleTagName :: TagName -> TagName
- isHiddenTagName :: TagName -> Bool
- nullsourcepos :: SourcePos
- nullsourcepospair :: (SourcePos, SourcePos)
- data BalanceAssertion = BalanceAssertion {
  - baamount :: Amount
  - batotal :: Bool
  - bainclusive :: Bool
  - baposition :: SourcePos
  }
- data TMPostingRule = TMPostingRule {
  - tmprPosting :: Posting
  - tmprIsMultiplier :: Bool
  }
- nulltransactionmodifier :: TransactionModifier
- nullperiodictransaction :: PeriodicTransaction
- data TimeclockCode
  - = SetBalance
  - | SetRequiredHours
  - | In
  - | Out
  - | FinalOut
- data TimeclockEntry = TimeclockEntry {
  - tlsourcepos :: SourcePos
  - tlcode :: TimeclockCode
  - tldatetime :: LocalTime
  - tlaccount :: AccountName
  - tldescription :: Text
  - tlcomment :: Text
  - tltags :: [Tag]
  }
- data PriceDirective = PriceDirective {
  - pdsourcepos :: SourcePos
  - pddate :: Day
  - pdcommodity :: CommoditySymbol
  - pdamount :: Amount
  }
- data MarketPrice = MarketPrice {
  - mpdate :: Day
  - mpfrom :: CommoditySymbol
  - mpto :: CommoditySymbol
  - mprate :: Quantity
  }
- showMarketPrice :: MarketPrice -> String
- showMarketPrices :: [MarketPrice] -> [Char]
- data PayeeDeclarationInfo = PayeeDeclarationInfo {
  - pdicomment :: Text
  - pditags :: [Tag]
  }
- newtype TagDeclarationInfo = TagDeclarationInfo {
  - tdicomment :: Text
  }
- data AccountDeclarationInfo = AccountDeclarationInfo {
  - adicomment :: Text
  - aditags :: [Tag]
  - adideclarationorder :: Int
  - adisourcepos :: SourcePos
  }
- type ParsedJournal = Journal
- nullpayeedeclarationinfo :: PayeeDeclarationInfo
- nulltagdeclarationinfo :: TagDeclarationInfo
- nullaccountdeclarationinfo :: AccountDeclarationInfo
- data NormalSign
  - = NormallyPositive
  - | NormallyNegative
- type Year = Integer

# Documentation

data Side Source #

Constructors

L |
R |

#### Instances

Instances details

FromJSON Side Source # |
Instance details Defined in Hledger.Data.Json Methods parseJSON :: Value -> Parser Side Source # parseJSONList :: Value -> Parser [Side] Source # omittedField :: Maybe Side Source #
ToJSON Side Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: Side -> Value Source # toEncoding :: Side -> Encoding Source # toJSONList :: [Side] -> Value Source # toEncodingList :: [Side] -> Encoding Source # omitField :: Side -> Bool Source #
NFData Side Source # |
Instance details Defined in Hledger.Data.Types Methods rnf :: Side -> () Source #
Generic Side Source # |

Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep Side |
Instance details Defined in Hledger.Data.Types type Rep Side = D1 ('MetaData "Side" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" 'False) (C1 ('MetaCons "L" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "R" 'PrefixI 'False) (U1 :: Type -> Type))

Methods

from :: Side -> Rep Side x Source #

to :: Rep Side x -> Side Source #

Read Side Source # |
Instance details Defined in Hledger.Data.Types Methods readsPrec :: Int -> ReadS Side Source # readList :: ReadS [Side] Source # readPrec :: ReadPrec Side Source # readListPrec :: ReadPrec [Side] Source #
Show Side Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> Side -> ShowS Source # show :: Side -> String Source # showList :: [Side] -> ShowS 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 Methods compare :: Side -> Side -> Ordering Source # (<) :: Side -> Side -> Bool Source # (<=) :: Side -> Side -> Bool Source # (>) :: Side -> Side -> Bool Source # (>=) :: Side -> Side -> Bool Source # max :: Side -> Side -> Side Source # min :: Side -> Side -> Side Source #
type Rep Side Source # |
Instance details Defined in Hledger.Data.Types type Rep Side = D1 ('MetaData "Side" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" 'False) (C1 ('MetaCons "L" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "R" 'PrefixI 'False) (U1 :: Type -> Type))

type Tag Source #

Arguments

= (TagName, TagValue) | A tag name and (possibly empty) value.

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
Gain | a subtype of Revenue - realised capital gains/losses
UnrealisedGain | a subtype of Equity - accumulated unrealised capital gains/losses (used by hledger 2)

#### Instances

Instances details

ToJSON AccountType Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: AccountType -> Value Source # toEncoding :: AccountType -> Encoding Source # toJSONList :: [AccountType] -> Value Source # toEncodingList :: [AccountType] -> Encoding Source # omitField :: AccountType -> Bool Source #
ToJSONKey AccountType Source # |
Instance details Defined in Hledger.Data.Json Methods toJSONKey :: ToJSONKeyFunction AccountType Source # toJSONKeyList :: ToJSONKeyFunction [AccountType] Source #
NFData AccountType Source # |
Instance details Defined in Hledger.Data.Types Methods rnf :: AccountType -> () Source #
Generic AccountType Source # |

Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep AccountType |

Instance details

Defined in Hledger.Data.Types

type Rep AccountType = D1 ('MetaData "AccountType" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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) :+: (C1 ('MetaCons "Gain" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "UnrealisedGain" 'PrefixI 'False) (U1 :: Type -> Type)))))

Methods

from :: AccountType -> Rep AccountType x Source #

to :: Rep AccountType x -> AccountType Source #

Show AccountType Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> AccountType -> ShowS Source # show :: AccountType -> String Source # showList :: [AccountType] -> ShowS Source #
Eq AccountType Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: AccountType -> AccountType -> Bool Source # (/=) :: AccountType -> AccountType -> Bool Source #
Ord AccountType Source # |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: AccountType -> AccountType -> Ordering Source #

(<) :: AccountType -> AccountType -> Bool Source #

(<=) :: AccountType -> AccountType -> Bool Source #

(>) :: AccountType -> AccountType -> Bool Source #

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

max :: AccountType -> AccountType -> AccountType Source #

min :: AccountType -> AccountType -> AccountType Source #

type Rep AccountType Source # |

Instance details

Defined in Hledger.Data.Types

type Rep AccountType = D1 ('MetaData "AccountType" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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) :+: (C1 ('MetaCons "Gain" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "UnrealisedGain" 'PrefixI 'False) (U1 :: Type -> Type)))))

data SepFormat Source #

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

Constructors

Csv |
Tsv |
Ssv |

#### Instances

Instances details

Show SepFormat Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> SepFormat -> ShowS Source # show :: SepFormat -> String Source # showList :: [SepFormat] -> ShowS Source #
Eq SepFormat Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: SepFormat -> SepFormat -> Bool Source # (/=) :: SepFormat -> SepFormat -> Bool Source #
Ord SepFormat Source # |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: SepFormat -> SepFormat -> Ordering Source #

(<) :: SepFormat -> SepFormat -> Bool Source #

(<=) :: SepFormat -> SepFormat -> Bool Source #

(>) :: SepFormat -> SepFormat -> Bool Source #

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

max :: SepFormat -> SepFormat -> SepFormat Source #

min :: SepFormat -> SepFormat -> SepFormat Source #

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 Methods parseJSON :: Value -> Parser Status Source # parseJSONList :: Value -> Parser [Status] Source # omittedField :: Maybe Status Source #
ToJSON Status Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: Status -> Value Source # toEncoding :: Status -> Encoding Source # toJSONList :: [Status] -> Value Source # toEncodingList :: [Status] -> Encoding Source # omitField :: Status -> Bool Source #
NFData Status Source # |
Instance details Defined in Hledger.Data.Types Methods rnf :: Status -> () Source #
Bounded Status Source # |
Instance details Defined in Hledger.Data.Types Methods minBound :: Status Source # maxBound :: Status Source #
Enum Status Source # |

Instance details

Defined in Hledger.Data.Types

Methods

succ :: Status -> Status Source #

pred :: Status -> Status Source #

toEnum :: Int -> Status Source #

fromEnum :: Status -> Int Source #

enumFrom :: Status -> [Status] Source #

enumFromThen :: Status -> Status -> [Status] Source #

enumFromTo :: Status -> Status -> [Status] Source #

enumFromThenTo :: Status -> Status -> Status -> [Status] Source #

Generic Status Source # |

Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep Status |
Instance details Defined in Hledger.Data.Types type Rep Status = D1 ('MetaData "Status" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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)))

Methods

from :: Status -> Rep Status x Source #

to :: Rep Status x -> Status Source #

Show Status Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> Status -> ShowS Source # show :: Status -> String Source # showList :: [Status] -> ShowS Source #
Eq Status Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: Status -> Status -> Bool Source # (/=) :: Status -> Status -> Bool Source #
Ord Status Source # |
Instance details Defined in Hledger.Data.Types Methods compare :: Status -> Status -> Ordering Source # (<) :: Status -> Status -> Bool Source # (<=) :: Status -> Status -> Bool Source # (>) :: Status -> Status -> Bool Source # (>=) :: Status -> Status -> Bool Source # max :: Status -> Status -> Status Source # min :: Status -> Status -> Status Source #
type Rep Status Source # |
Instance details Defined in Hledger.Data.Types type Rep Status = D1 ('MetaData "Status" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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 Period Source #

Constructors

DayPeriod Day |
WeekPeriod Day |
MonthPeriod Year Month |
QuarterPeriod Year Quarter |
YearPeriod Year |
PeriodBetween Day Day |
PeriodFrom Day |
PeriodTo Day |
PeriodAll |

#### Instances

Instances details

ToJSON Period Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: Period -> Value Source # toEncoding :: Period -> Encoding Source # toJSONList :: [Period] -> Value Source # toEncodingList :: [Period] -> Encoding Source # omitField :: Period -> Bool Source #
Default Period Source # |
Instance details Defined in Hledger.Data.Types Methods def :: Period Source #
Generic Period Source # |

Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep Period |

Instance details

Defined in Hledger.Data.Types

type Rep Period = D1 ('MetaData "Period" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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)))))

Methods

from :: Period -> Rep Period x Source #

to :: Rep Period x -> Period Source #

Show Period Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> Period -> ShowS Source # show :: Period -> String Source # showList :: [Period] -> ShowS Source #
Eq Period Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: Period -> Period -> Bool Source # (/=) :: Period -> Period -> Bool Source #
Ord Period Source # |
Instance details Defined in Hledger.Data.Types Methods compare :: Period -> Period -> Ordering Source # (<) :: Period -> Period -> Bool Source # (<=) :: Period -> Period -> Bool Source # (>) :: Period -> Period -> Bool Source # (>=) :: Period -> Period -> Bool Source # max :: Period -> Period -> Period Source # min :: Period -> Period -> Period Source #
HasAmounts PostingsReportItem Source # |
Instance details Defined in Hledger.Reports.PostingsReport Methods styleAmounts :: Map CommoditySymbol AmountStyle -> PostingsReportItem -> PostingsReportItem Source #
type Rep Period Source # |

Instance details

Defined in Hledger.Data.Types

type Rep Period = D1 ('MetaData "Period" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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 SmartInterval Source #

Constructors

Day |
Week |
Month |
Quarter |
Year |

#### Instances

Instances details

Show SmartInterval Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> SmartInterval -> ShowS Source # show :: SmartInterval -> String Source # showList :: [SmartInterval] -> ShowS Source #

type YearDay = Int Source #

type Month = Int Source #

type MonthDay = Int Source #

data Interval Source #

Constructors

NoInterval |
Days Int |
Weeks Int |
Months Int |
Quarters Int |
Years Int |
NthWeekdayOfMonth Int Int |
MonthDay Int |
MonthAndDay Int Int |
DaysOfWeek [Int] |

#### Instances

Instances details

ToJSON Interval Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: Interval -> Value Source # toEncoding :: Interval -> Encoding Source # toJSONList :: [Interval] -> Value Source # toEncodingList :: [Interval] -> Encoding Source # omitField :: Interval -> Bool Source #
Default Interval Source # |
Instance details Defined in Hledger.Data.Types Methods def :: Interval Source #
NFData Interval Source # |
Instance details Defined in Hledger.Data.Types Methods rnf :: Interval -> () Source #
Generic Interval Source # |

Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep Interval |

Instance details

Defined in Hledger.Data.Types

type Rep Interval = D1 ('MetaData "Interval" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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]))))))

Methods

from :: Interval -> Rep Interval x Source #

to :: Rep Interval x -> Interval Source #

Show Interval Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> Interval -> ShowS Source # show :: Interval -> String Source # showList :: [Interval] -> ShowS Source #
Eq Interval Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: Interval -> Interval -> Bool Source # (/=) :: Interval -> Interval -> Bool Source #
Ord Interval Source # |
Instance details Defined in Hledger.Data.Types Methods compare :: Interval -> Interval -> Ordering Source # (<) :: Interval -> Interval -> Bool Source # (<=) :: Interval -> Interval -> Bool Source # (>) :: Interval -> Interval -> Bool Source # (>=) :: Interval -> Interval -> Bool Source # max :: Interval -> Interval -> Interval Source # min :: Interval -> Interval -> Interval Source #
type Rep Interval Source # |

Instance details

Defined in Hledger.Data.Types

type Rep Interval = D1 ('MetaData "Interval" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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]))))))

type Quarter = Int Source #

data MixedAmountKey Source #

Stores the CommoditySymbol of the Amount, along with the CommoditySymbol of the cost, and its unit cost if being used.

Constructors

MixedAmountKeyNoCost !CommoditySymbol |
MixedAmountKeyTotalCost !CommoditySymbol !CommoditySymbol |
MixedAmountKeyUnitCost !CommoditySymbol !CommoditySymbol !Quantity |

#### Instances

Instances details

NFData MixedAmountKey Source # |
Instance details Defined in Hledger.Data.Types Methods rnf :: MixedAmountKey -> () Source #
Generic MixedAmountKey Source # |

Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep MixedAmountKey |

Instance details

Defined in Hledger.Data.Types

type Rep MixedAmountKey = D1 ('MetaData "MixedAmountKey" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" 'False) (C1 ('MetaCons "MixedAmountKeyNoCost" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 CommoditySymbol)) :+: (C1 ('MetaCons "MixedAmountKeyTotalCost" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 CommoditySymbol) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 CommoditySymbol)) :+: C1 ('MetaCons "MixedAmountKeyUnitCost" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 CommoditySymbol) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 CommoditySymbol) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Quantity)))))

Methods

from :: MixedAmountKey -> Rep MixedAmountKey x Source #

to :: Rep MixedAmountKey x -> MixedAmountKey Source #

Show MixedAmountKey Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> MixedAmountKey -> ShowS Source # show :: MixedAmountKey -> String Source # showList :: [MixedAmountKey] -> ShowS Source #
Eq MixedAmountKey Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: MixedAmountKey -> MixedAmountKey -> Bool Source # (/=) :: MixedAmountKey -> MixedAmountKey -> Bool Source #

Ord MixedAmountKey Source #

We don't auto-derive the Ord instance because it would give an undesired ordering. We want the keys to be sorted lexicographically: (1) By the primary commodity of the amount. (2) By the commodity of the cost, with no cost being first. (3) By the unit cost, from most negative to most positive, with total costs before unit costs. For example, we would like the ordering to give MixedAmountKeyNoCost X < MixedAmountKeyTotalCost X Z < MixedAmountKeyNoCost Y

Instance details

Defined in Hledger.Data.Types

Methods

compare :: MixedAmountKey -> MixedAmountKey -> Ordering Source #

(<) :: MixedAmountKey -> MixedAmountKey -> Bool Source #

(<=) :: MixedAmountKey -> MixedAmountKey -> Bool Source #

(>) :: MixedAmountKey -> MixedAmountKey -> Bool Source #

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

max :: MixedAmountKey -> MixedAmountKey -> MixedAmountKey Source #

min :: MixedAmountKey -> MixedAmountKey -> MixedAmountKey Source #

type Rep MixedAmountKey Source # |

Instance details

Defined in Hledger.Data.Types

type Rep MixedAmountKey = D1 ('MetaData "MixedAmountKey" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" 'False) (C1 ('MetaCons "MixedAmountKeyNoCost" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 CommoditySymbol)) :+: (C1 ('MetaCons "MixedAmountKeyTotalCost" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 CommoditySymbol) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 CommoditySymbol)) :+: C1 ('MetaCons "MixedAmountKeyUnitCost" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 CommoditySymbol) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 CommoditySymbol) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Quantity)))))

newtype MixedAmount Source #

Constructors

Mixed (Map MixedAmountKey Amount) |

#### Instances

Instances details

FromJSON MixedAmount Source # |
Instance details Defined in Hledger.Data.Json Methods parseJSON :: Value -> Parser MixedAmount Source # parseJSONList :: Value -> Parser [MixedAmount] Source # omittedField :: Maybe MixedAmount Source #
ToJSON MixedAmount Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: MixedAmount -> Value Source # toEncoding :: MixedAmount -> Encoding Source # toJSONList :: [MixedAmount] -> Value Source # toEncodingList :: [MixedAmount] -> Encoding Source # omitField :: MixedAmount -> Bool Source #
NFData MixedAmount Source # |
Instance details Defined in Hledger.Data.Types Methods rnf :: MixedAmount -> () Source #
Monoid MixedAmount Source # |
Instance details Defined in Hledger.Data.Amount Methods mempty :: MixedAmount Source # mappend :: MixedAmount -> MixedAmount -> MixedAmount Source # mconcat :: [MixedAmount] -> MixedAmount Source #
Semigroup MixedAmount Source # |
Instance details Defined in Hledger.Data.Amount Methods (<>) :: MixedAmount -> MixedAmount -> MixedAmount Source # sconcat :: NonEmpty MixedAmount -> MixedAmount Source # stimes :: Integral b => b -> MixedAmount -> MixedAmount Source #
Generic MixedAmount Source # |

Instance details

Defined in Hledger.Data.Types

Associated Types

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

Methods

from :: MixedAmount -> Rep MixedAmount x Source #

to :: Rep MixedAmount x -> MixedAmount Source #

Num MixedAmount Source # |

Instance details

Defined in Hledger.Data.Amount

Methods

(+) :: MixedAmount -> MixedAmount -> MixedAmount Source #

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

(*) :: MixedAmount -> MixedAmount -> MixedAmount Source #

negate :: MixedAmount -> MixedAmount Source #

abs :: MixedAmount -> MixedAmount Source #

signum :: MixedAmount -> MixedAmount Source #

fromInteger :: Integer -> MixedAmount Source #

Show MixedAmount Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> MixedAmount -> ShowS Source # show :: MixedAmount -> String Source # showList :: [MixedAmount] -> ShowS Source #
Eq MixedAmount Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: MixedAmount -> MixedAmount -> Bool Source # (/=) :: MixedAmount -> MixedAmount -> Bool Source #
Ord MixedAmount Source # |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: MixedAmount -> MixedAmount -> Ordering Source #

(<) :: MixedAmount -> MixedAmount -> Bool Source #

(<=) :: MixedAmount -> MixedAmount -> Bool Source #

(>) :: MixedAmount -> MixedAmount -> Bool Source #

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

max :: MixedAmount -> MixedAmount -> MixedAmount Source #

min :: MixedAmount -> MixedAmount -> MixedAmount Source #

HasAmounts MixedAmount Source # |
Instance details Defined in Hledger.Data.Amount Methods styleAmounts :: Map CommoditySymbol AmountStyle -> MixedAmount -> MixedAmount Source #
HasAmounts AccountTransactionsReportItem Source # |
Instance details Defined in Hledger.Reports.AccountTransactionsReport Methods styleAmounts :: Map CommoditySymbol AmountStyle -> AccountTransactionsReportItem -> AccountTransactionsReportItem Source #
HasAmounts BalanceReportItem Source # |
Instance details Defined in Hledger.Reports.BalanceReport Methods styleAmounts :: Map CommoditySymbol AmountStyle -> BalanceReportItem -> BalanceReportItem Source #
HasAmounts PostingsReportItem Source # |
Instance details Defined in Hledger.Reports.PostingsReport Methods styleAmounts :: Map CommoditySymbol AmountStyle -> PostingsReportItem -> PostingsReportItem Source #
type Rep MixedAmount Source # |
Instance details Defined in Hledger.Data.Types type Rep MixedAmount = D1 ('MetaData "MixedAmount" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" 'True) (C1 ('MetaCons "Mixed" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map MixedAmountKey Amount))))

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

- aname :: AccountName

  full name

- adeclarationinfo :: Maybe AccountDeclarationInfo

  optional extra info from account directives relationships in the tree

- asubs :: [Account a]

  subaccounts

- aparent :: Maybe (Account a)

  parent account

- aboring :: Bool

  used in some reports to indicate elidable accounts

- adata :: PeriodData a

  associated data per report period

#### 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 Methods parseJSON :: Value -> Parser (Account a) Source # parseJSONList :: Value -> Parser [Account a] Source # omittedField :: Maybe (Account a) Source #
ToJSON a => ToJSON (Account a) Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: Account a -> Value Source # toEncoding :: Account a -> Encoding Source # toJSONList :: [Account a] -> Value Source # toEncodingList :: [Account a] -> Encoding Source # omitField :: Account a -> Bool Source #
Generic (Account a) Source # |

Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep (Account a) |

Instance details

Defined in Hledger.Data.Types

type Rep (Account a) = D1 ('MetaData "Account" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" 'False) (C1 ('MetaCons "Account" 'PrefixI 'True) ((S1 ('MetaSel ('Just "aname") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 AccountName) :*: (S1 ('MetaSel ('Just "adeclarationinfo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe AccountDeclarationInfo)) :*: S1 ('MetaSel ('Just "asubs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Account a]))) :*: (S1 ('MetaSel ('Just "aparent") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (Account a))) :*: (S1 ('MetaSel ('Just "aboring") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Just "adata") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (PeriodData a))))))

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 Methods showsPrec :: Int -> Account a -> ShowS Source # show :: Account a -> String Source # showList :: [Account a] -> ShowS Source #
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 Methods styleAmounts :: Map CommoditySymbol AmountStyle -> Account a -> Account a Source #
type Rep (Account a) Source # |

Instance details

Defined in Hledger.Data.Types

type Rep (Account a) = D1 ('MetaData "Account" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" 'False) (C1 ('MetaCons "Account" 'PrefixI 'True) ((S1 ('MetaSel ('Just "aname") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 AccountName) :*: (S1 ('MetaSel ('Just "adeclarationinfo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe AccountDeclarationInfo)) :*: S1 ('MetaSel ('Just "asubs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Account a]))) :*: (S1 ('MetaSel ('Just "aparent") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (Account a))) :*: (S1 ('MetaSel ('Just "aboring") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Just "adata") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (PeriodData a))))))

type AccountName = Text Source #

data Amount Source #

Constructors

Amount |

Fields

- acommodity :: !CommoditySymbol
- aquantity :: !Quantity
- astyle :: !AmountStyle
- acost :: !(Maybe AmountCost)

  transacted exchange rate - the unit or total cost, in another commodity, used for this amount within its transaction

- acostbasis :: !(Maybe CostBasis)

  the cost basis of an investment lot represented by this amount. Or, a matcher to select such a lot from the available lots.

#### Instances

Instances details

FromJSON Amount Source # |
Instance details Defined in Hledger.Data.Json Methods parseJSON :: Value -> Parser Amount Source # parseJSONList :: Value -> Parser [Amount] Source # omittedField :: Maybe Amount Source #
ToJSON Amount Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: Amount -> Value Source # toEncoding :: Amount -> Encoding Source # toJSONList :: [Amount] -> Value Source # toEncodingList :: [Amount] -> Encoding Source # omitField :: Amount -> Bool Source #
NFData Amount Source # |
Instance details Defined in Hledger.Data.Types Methods rnf :: Amount -> () Source #
Generic Amount Source # |

Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep Amount |

Instance details

Defined in Hledger.Data.Types

type Rep Amount = D1 ('MetaData "Amount" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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)) :*: S1 ('MetaSel ('Just "acostbasis") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe CostBasis))))))

Methods

from :: Amount -> Rep Amount x Source #

to :: Rep Amount x -> Amount Source #

Num Amount Source # |
Instance details Defined in Hledger.Data.Amount Methods (+) :: Amount -> Amount -> Amount Source # (-) :: Amount -> Amount -> Amount Source # (*) :: Amount -> Amount -> Amount Source # negate :: Amount -> Amount Source # abs :: Amount -> Amount Source # signum :: Amount -> Amount Source # fromInteger :: Integer -> Amount Source #
Show Amount Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> Amount -> ShowS Source # show :: Amount -> String Source # showList :: [Amount] -> ShowS Source #
Eq Amount Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: Amount -> Amount -> Bool Source # (/=) :: Amount -> Amount -> Bool Source #
Ord Amount Source # |
Instance details Defined in Hledger.Data.Types Methods compare :: Amount -> Amount -> Ordering Source # (<) :: Amount -> Amount -> Bool Source # (<=) :: Amount -> Amount -> Bool Source # (>) :: Amount -> Amount -> Bool Source # (>=) :: Amount -> Amount -> Bool Source # max :: Amount -> Amount -> Amount Source # min :: Amount -> Amount -> Amount Source #
HasAmounts Amount Source # |
Instance details Defined in Hledger.Data.Amount Methods styleAmounts :: Map CommoditySymbol AmountStyle -> Amount -> Amount Source #
type Rep Amount Source # |

Instance details

Defined in Hledger.Data.Types

type Rep Amount = D1 ('MetaData "Amount" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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)) :*: S1 ('MetaSel ('Just "acostbasis") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe CostBasis))))))

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

- bdexcludingsubs :: MixedAmount

  balance data excluding subaccounts

- bdincludingsubs :: MixedAmount

  balance data including subaccounts

- bdnumpostings :: Int

  the number of postings

#### Instances

Instances details

FromJSON BalanceData Source # |
Instance details Defined in Hledger.Data.Json Methods parseJSON :: Value -> Parser BalanceData Source # parseJSONList :: Value -> Parser [BalanceData] Source # omittedField :: Maybe BalanceData Source #
ToJSON BalanceData Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: BalanceData -> Value Source # toEncoding :: BalanceData -> Encoding Source # toJSONList :: [BalanceData] -> Value Source # toEncodingList :: [BalanceData] -> Encoding Source # omitField :: BalanceData -> Bool Source #
Monoid BalanceData Source # |
Instance details Defined in Hledger.Data.BalanceData Methods mempty :: BalanceData Source # mappend :: BalanceData -> BalanceData -> BalanceData Source # mconcat :: [BalanceData] -> BalanceData Source #
Semigroup BalanceData Source # |
Instance details Defined in Hledger.Data.BalanceData Methods (<>) :: BalanceData -> BalanceData -> BalanceData Source # sconcat :: NonEmpty BalanceData -> BalanceData Source # stimes :: Integral b => b -> BalanceData -> BalanceData Source #
Generic BalanceData Source # |

Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep BalanceData |

Instance details

Defined in Hledger.Data.Types

type Rep BalanceData = D1 ('MetaData "BalanceData" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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))))

Methods

from :: BalanceData -> Rep BalanceData x Source #

to :: Rep BalanceData x -> BalanceData Source #

Show BalanceData Source # |
Instance details Defined in Hledger.Data.BalanceData Methods showsPrec :: Int -> BalanceData -> ShowS Source # show :: BalanceData -> String Source # showList :: [BalanceData] -> ShowS Source #
Eq BalanceData Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: BalanceData -> BalanceData -> Bool Source # (/=) :: BalanceData -> BalanceData -> Bool Source #
HasAmounts BalanceData Source # |
Instance details Defined in Hledger.Data.Amount Methods styleAmounts :: Map CommoditySymbol AmountStyle -> BalanceData -> BalanceData Source #
type Rep BalanceData Source # |

Instance details

Defined in Hledger.Data.Types

type Rep BalanceData = D1 ('MetaData "BalanceData" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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

- jparsedefaultyear :: Maybe Year

  the current default year, specified by the most recent Y directive (or current date)

- jparsedefaultcommodity :: Maybe (CommoditySymbol, AmountStyle)

  the current default commodity and its format, specified by the most recent D directive

- jparsedecimalmark :: Maybe DecimalMark

  the character to always parse as decimal point, if set by CsvReader's decimal-mark (or a future journal directive)

- jparseparentaccounts :: [AccountName]

  the current stack of parent account names, specified by apply account directives

- jparsealiases :: [AccountAlias]

  the current account name aliases in effect, specified by alias directives (& options ?) ,jparsetransactioncount :: Integer -- ^ the current count of transactions parsed so far (only journal format txns, currently)

- jparsetimeclockentries :: [TimeclockEntry]

  timeclock sessions which have not been clocked out

- jincludefilestack :: [(FilePath, FilePath)]

  (absolute path, canonical path) of included files, most recent first principal data

- jdeclaredpayees :: [(Payee, PayeeDeclarationInfo)]

  Payees declared by payee directives, in parse order.

- jdeclaredtags :: [(TagName, TagDeclarationInfo)]

  Tags declared by tag directives, in parse order.

- jdeclaredaccounts :: [(AccountName, AccountDeclarationInfo)]

  Accounts declared by account directives, in parse order.

- jdeclaredaccounttags :: Map AccountName [Tag]

  Accounts which were declared with tags, and those tags.

- jdeclaredaccounttypes :: Map AccountType [AccountName]

  Accounts which were declared with a type: tag, grouped by the type.

- jaccounttypes :: Map AccountName AccountType

  All the account types known, from account declarations or account names or parent accounts.

- jdeclaredcommodities :: Map CommoditySymbol Commodity

  Commodities (and their display styles) declared by commodity directives, in parse order.

- jdeclaredcommoditytags :: Map CommoditySymbol [Tag]

  Commodities which were declared with tags, and those tags.

- jinferredcommoditystyles :: Map CommoditySymbol AmountStyle

  Commodity display styles inferred from amounts in the journal.

- jglobalcommoditystyles :: Map CommoditySymbol AmountStyle

  Commodity display styles declared by command line options (sometimes augmented, see the import command).

- jpricedirectives :: [PriceDirective]

  P (market price) directives in the journal, in parse order.

- jinferredmarketprices :: [MarketPrice]

  Market prices inferred from transactions in the journal, in parse order.

- jtxnmodifiers :: [TransactionModifier]

  Auto posting rules declared in the journal.

- jperiodictxns :: [PeriodicTransaction]

  Periodic transaction rules declared in the journal.

- jtxns :: [Transaction]

  Transactions recorded in the journal. The important bit.

- jfinalcommentlines :: Text

  any final trailing comments in the (main) journal file

- jfiles :: [(FilePath, Text)]

  the file path and raw text of the main and any included journal files. The main file is first, followed by any included files in the order encountered. TODO: FilePath is a sloppy type here, don't assume it's a real file; values like "" or "-" can be seen

- jlastreadtime :: POSIXTime

  when this journal was last read from its file(s) NOTE: after adding new fields, eg involving account names, consider updating the Anon instance in Hleger.Cli.Anon

#### Instances

Instances details

ToJSON Journal Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: Journal -> Value Source # toEncoding :: Journal -> Encoding Source # toJSONList :: [Journal] -> Value Source # toEncodingList :: [Journal] -> Encoding Source # omitField :: Journal -> Bool Source #
Default Journal Source # |
Instance details Defined in Hledger.Data.Journal Methods def :: Journal Source #
NFData Journal Source # |
Instance details Defined in Hledger.Data.Types Methods rnf :: Journal -> () Source #
Semigroup Journal Source # |
Instance details Defined in Hledger.Data.Journal Methods (<>) :: Journal -> Journal -> Journal Source # sconcat :: NonEmpty Journal -> Journal Source # stimes :: Integral b => b -> Journal -> Journal Source #
Generic Journal Source # |

Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep Journal |

Instance details

Defined in Hledger.Data.Types

type Rep Journal = D1 ('MetaData "Journal" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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, 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 "jdeclaredcommoditytags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Map CommoditySymbol [Tag])))) :*: (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)))))))

Methods

from :: Journal -> Rep Journal x Source #

to :: Rep Journal x -> Journal Source #

Show Journal Source # |
Instance details Defined in Hledger.Data.Journal Methods showsPrec :: Int -> Journal -> ShowS Source # show :: Journal -> String Source # showList :: [Journal] -> ShowS Source #
Eq Journal Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: Journal -> Journal -> Bool Source # (/=) :: Journal -> Journal -> Bool Source #
type Rep Journal Source # |

Instance details

Defined in Hledger.Data.Types

type Rep Journal = D1 ('MetaData "Journal" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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, 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 "jdeclaredcommoditytags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Map CommoditySymbol [Tag])))) :*: (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 |

Fields

- ljournal :: Journal
- laccounts :: [Account BalanceData]

#### Instances

Instances details

ToJSON Ledger Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: Ledger -> Value Source # toEncoding :: Ledger -> Encoding Source # toJSONList :: [Ledger] -> Value Source # toEncodingList :: [Ledger] -> Encoding Source # omitField :: Ledger -> Bool Source #
Generic Ledger Source # |

Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep Ledger |

Instance details

Defined in Hledger.Data.Types

type Rep Ledger = D1 ('MetaData "Ledger" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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])))

Methods

from :: Ledger -> Rep Ledger x Source #

to :: Rep Ledger x -> Ledger Source #

Show Ledger Source # |
Instance details Defined in Hledger.Data.Ledger Methods showsPrec :: Int -> Ledger -> ShowS Source # show :: Ledger -> String Source # showList :: [Ledger] -> ShowS Source #
type Rep Ledger Source # |

Instance details

Defined in Hledger.Data.Types

type Rep Ledger = D1 ('MetaData "Ledger" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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 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

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 #

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

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 #
FromJSON a => FromJSON (PeriodData a) Source # |
Instance details Defined in Hledger.Data.Json Methods parseJSON :: Value -> Parser (PeriodData a) Source # parseJSONList :: Value -> Parser [PeriodData a] Source # omittedField :: Maybe (PeriodData a) Source #
ToJSON a => ToJSON (PeriodData a) Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: PeriodData a -> Value Source # toEncoding :: PeriodData a -> Encoding Source # toJSONList :: [PeriodData a] -> Value Source # toEncodingList :: [PeriodData a] -> Encoding Source # omitField :: PeriodData a -> Bool Source #
Monoid a => Monoid (PeriodData a) Source # |
Instance details Defined in Hledger.Data.PeriodData Methods mempty :: PeriodData a Source # mappend :: PeriodData a -> PeriodData a -> PeriodData a Source # mconcat :: [PeriodData a] -> PeriodData a Source #
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 Methods (<>) :: PeriodData a -> PeriodData a -> PeriodData a Source # sconcat :: NonEmpty (PeriodData a) -> PeriodData a Source # stimes :: Integral b => b -> PeriodData a -> PeriodData a Source #
Generic (PeriodData a) Source # |

Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep (PeriodData a) |

Instance details

Defined in Hledger.Data.Types

type Rep (PeriodData a) = D1 ('MetaData "PeriodData" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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))))

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 Methods showsPrec :: Int -> PeriodData a -> ShowS Source # show :: PeriodData a -> String Source # showList :: [PeriodData a] -> ShowS Source #
Eq a => Eq (PeriodData a) Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: PeriodData a -> PeriodData a -> Bool Source # (/=) :: PeriodData a -> PeriodData a -> Bool Source #
Ord a => Ord (PeriodData a) Source # |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: PeriodData a -> PeriodData a -> Ordering Source #

(<) :: PeriodData a -> PeriodData a -> Bool Source #

(<=) :: PeriodData a -> PeriodData a -> Bool Source #

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

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

max :: PeriodData a -> PeriodData a -> PeriodData a Source #

min :: PeriodData a -> PeriodData a -> PeriodData a Source #

HasAmounts a => HasAmounts (PeriodData a) Source # |
Instance details Defined in Hledger.Data.Amount Methods styleAmounts :: Map CommoditySymbol AmountStyle -> PeriodData a -> PeriodData a Source #
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.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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

- ptperiodexpr :: Text

  the period expression as written

- ptinterval :: Interval

  the interval at which this transaction recurs

- ptspan :: DateSpan

  the (possibly unbounded) period during which this transaction recurs. Contains a whole number of intervals.

- ptsourcepos :: (SourcePos, SourcePos)

  the file position where the period expression starts, and where the last posting ends

- ptstatus :: Status

  some of Transaction's fields

- ptcode :: Text
- ptdescription :: Text
- ptcomment :: Text
- pttags :: [Tag]
- ptpostings :: [Posting]

#### Instances

Instances details

ToJSON PeriodicTransaction Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: PeriodicTransaction -> Value Source # toEncoding :: PeriodicTransaction -> Encoding Source # toJSONList :: [PeriodicTransaction] -> Value Source # toEncodingList :: [PeriodicTransaction] -> Encoding Source # omitField :: PeriodicTransaction -> Bool Source #
NFData PeriodicTransaction Source # |
Instance details Defined in Hledger.Data.Types Methods rnf :: PeriodicTransaction -> () Source #
Generic PeriodicTransaction Source # |

Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep PeriodicTransaction |

Instance details

Defined in Hledger.Data.Types

type Rep PeriodicTransaction = D1 ('MetaData "PeriodicTransaction" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" 'False) (C1 ('MetaCons "PeriodicTransaction" 'PrefixI 'True) (((S1 ('MetaSel ('Just "ptperiodexpr") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "ptinterval") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Interval)) :*: (S1 ('MetaSel ('Just "ptspan") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 DateSpan) :*: (S1 ('MetaSel ('Just "ptsourcepos") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (SourcePos, SourcePos)) :*: S1 ('MetaSel ('Just "ptstatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Status)))) :*: ((S1 ('MetaSel ('Just "ptcode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "ptdescription") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "ptcomment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Just "pttags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Tag]) :*: S1 ('MetaSel ('Just "ptpostings") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Posting]))))))

Methods

from :: PeriodicTransaction -> Rep PeriodicTransaction x Source #

to :: Rep PeriodicTransaction x -> PeriodicTransaction Source #

Show PeriodicTransaction Source # |
Instance details Defined in Hledger.Data.PeriodicTransaction Methods showsPrec :: Int -> PeriodicTransaction -> ShowS Source # show :: PeriodicTransaction -> String Source # showList :: [PeriodicTransaction] -> ShowS Source #
Eq PeriodicTransaction Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: PeriodicTransaction -> PeriodicTransaction -> Bool Source # (/=) :: PeriodicTransaction -> PeriodicTransaction -> Bool Source #
type Rep PeriodicTransaction Source # |

Instance details

Defined in Hledger.Data.Types

type Rep PeriodicTransaction = D1 ('MetaData "PeriodicTransaction" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" 'False) (C1 ('MetaCons "PeriodicTransaction" 'PrefixI 'True) (((S1 ('MetaSel ('Just "ptperiodexpr") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "ptinterval") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Interval)) :*: (S1 ('MetaSel ('Just "ptspan") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 DateSpan) :*: (S1 ('MetaSel ('Just "ptsourcepos") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (SourcePos, SourcePos)) :*: S1 ('MetaSel ('Just "ptstatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Status)))) :*: ((S1 ('MetaSel ('Just "ptcode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "ptdescription") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "ptcomment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Just "pttags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Tag]) :*: S1 ('MetaSel ('Just "ptpostings") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Posting]))))))

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 Methods parseJSON :: Value -> Parser Posting Source # parseJSONList :: Value -> Parser [Posting] Source # omittedField :: Maybe Posting Source #
ToJSON Posting Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: Posting -> Value Source # toEncoding :: Posting -> Encoding Source # toJSONList :: [Posting] -> Value Source # toEncodingList :: [Posting] -> Encoding Source # omitField :: Posting -> Bool Source #
NFData Posting Source # |
Instance details Defined in Hledger.Data.Types Methods rnf :: Posting -> () Source #
Generic Posting Source # |

Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep Posting |

Instance details

Defined in Hledger.Data.Types

type Rep Posting = D1 ('MetaData "Posting" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" 'False) (C1 ('MetaCons "Posting" 'PrefixI 'True) (((S1 ('MetaSel ('Just "pdate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Day)) :*: S1 ('MetaSel ('Just "pdate2") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Day))) :*: (S1 ('MetaSel ('Just "pstatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Status) :*: (S1 ('MetaSel ('Just "paccount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 AccountName) :*: S1 ('MetaSel ('Just "pamount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 MixedAmount)))) :*: ((S1 ('MetaSel ('Just "pcomment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Just "ptype") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 PostingType) :*: S1 ('MetaSel ('Just "ptags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Tag]))) :*: (S1 ('MetaSel ('Just "pbalanceassertion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe BalanceAssertion)) :*: (S1 ('MetaSel ('Just "ptransaction") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Transaction)) :*: S1 ('MetaSel ('Just "poriginal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Posting)))))))

Methods

from :: Posting -> Rep Posting x Source #

to :: Rep Posting x -> Posting 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 Methods showsPrec :: Int -> Posting -> ShowS Source # show :: Posting -> String Source # showList :: [Posting] -> ShowS Source #
Eq Posting Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: Posting -> Posting -> Bool Source # (/=) :: Posting -> Posting -> Bool Source #
HasAmounts Posting Source # |
Instance details Defined in Hledger.Data.Posting Methods styleAmounts :: Map CommoditySymbol AmountStyle -> Posting -> Posting Source #
HasAmounts PostingsReportItem Source # |
Instance details Defined in Hledger.Reports.PostingsReport Methods styleAmounts :: Map CommoditySymbol AmountStyle -> PostingsReportItem -> PostingsReportItem Source #
type Rep Posting Source # |

Instance details

Defined in Hledger.Data.Types

type Rep Posting = D1 ('MetaData "Posting" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" 'False) (C1 ('MetaCons "Posting" 'PrefixI 'True) (((S1 ('MetaSel ('Just "pdate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Day)) :*: S1 ('MetaSel ('Just "pdate2") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Day))) :*: (S1 ('MetaSel ('Just "pstatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Status) :*: (S1 ('MetaSel ('Just "paccount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 AccountName) :*: S1 ('MetaSel ('Just "pamount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 MixedAmount)))) :*: ((S1 ('MetaSel ('Just "pcomment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Just "ptype") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 PostingType) :*: S1 ('MetaSel ('Just "ptags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Tag]))) :*: (S1 ('MetaSel ('Just "pbalanceassertion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe BalanceAssertion)) :*: (S1 ('MetaSel ('Just "ptransaction") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Transaction)) :*: S1 ('MetaSel ('Just "poriginal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Posting)))))))

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.

Constructors

Rules |
Journal' |
Ledger' |
Timeclock |
Timedot |
Sep SepFormat |

#### Instances

Instances details

Show StorageFormat Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> StorageFormat -> ShowS Source # show :: StorageFormat -> String Source # showList :: [StorageFormat] -> ShowS Source #
Eq StorageFormat Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: StorageFormat -> StorageFormat -> Bool Source # (/=) :: StorageFormat -> StorageFormat -> Bool Source #
Ord StorageFormat Source # |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: StorageFormat -> StorageFormat -> Ordering Source #

(<) :: StorageFormat -> StorageFormat -> Bool Source #

(<=) :: StorageFormat -> StorageFormat -> Bool Source #

(>) :: StorageFormat -> StorageFormat -> Bool Source #

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

max :: StorageFormat -> StorageFormat -> StorageFormat Source #

min :: StorageFormat -> StorageFormat -> StorageFormat Source #

data Transaction Source #

Constructors

Transaction |

Fields

- tindex :: Integer

  this transaction's 1-based position in the transaction stream, or 0 when not available

- tprecedingcomment :: Text

  any comment lines immediately preceding this transaction

- tsourcepos :: (SourcePos, SourcePos)

  the file position where the date starts, and where the last posting ends

- tdate :: Day
- tdate2 :: Maybe Day
- tstatus :: Status
- tcode :: Text
- tdescription :: Text
- tcomment :: Text

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

- ttags :: [Tag]

  tag names and values, extracted from the comment

- tpostings :: [Posting]

  this transaction's postings

#### Instances

Instances details

FromJSON Transaction Source # |
Instance details Defined in Hledger.Data.Json Methods parseJSON :: Value -> Parser Transaction Source # parseJSONList :: Value -> Parser [Transaction] Source # omittedField :: Maybe Transaction Source #
ToJSON Transaction Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: Transaction -> Value Source # toEncoding :: Transaction -> Encoding Source # toJSONList :: [Transaction] -> Value Source # toEncodingList :: [Transaction] -> Encoding Source # omitField :: Transaction -> Bool Source #
NFData Transaction Source # |
Instance details Defined in Hledger.Data.Types Methods rnf :: Transaction -> () Source #
Generic Transaction Source # |

Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep Transaction |

Instance details

Defined in Hledger.Data.Types

type Rep Transaction = D1 ('MetaData "Transaction" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" 'False) (C1 ('MetaCons "Transaction" 'PrefixI 'True) (((S1 ('MetaSel ('Just "tindex") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Integer) :*: S1 ('MetaSel ('Just "tprecedingcomment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "tsourcepos") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (SourcePos, SourcePos)) :*: (S1 ('MetaSel ('Just "tdate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Day) :*: S1 ('MetaSel ('Just "tdate2") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Day))))) :*: ((S1 ('MetaSel ('Just "tstatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Status) :*: (S1 ('MetaSel ('Just "tcode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "tdescription") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text))) :*: (S1 ('MetaSel ('Just "tcomment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Just "ttags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Tag]) :*: S1 ('MetaSel ('Just "tpostings") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Posting]))))))

Methods

from :: Transaction -> Rep Transaction x Source #

to :: Rep Transaction x -> Transaction Source #

Show Transaction Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> Transaction -> ShowS Source # show :: Transaction -> String Source # showList :: [Transaction] -> ShowS Source #
Eq Transaction Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: Transaction -> Transaction -> Bool Source # (/=) :: Transaction -> Transaction -> Bool Source #
HasAmounts Transaction Source # |
Instance details Defined in Hledger.Data.Transaction Methods styleAmounts :: Map CommoditySymbol AmountStyle -> Transaction -> Transaction Source #
HasAmounts AccountTransactionsReportItem Source # |
Instance details Defined in Hledger.Reports.AccountTransactionsReport Methods styleAmounts :: Map CommoditySymbol AmountStyle -> AccountTransactionsReportItem -> AccountTransactionsReportItem Source #
type Rep Transaction Source # |

Instance details

Defined in Hledger.Data.Types

type Rep Transaction = D1 ('MetaData "Transaction" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" 'False) (C1 ('MetaCons "Transaction" 'PrefixI 'True) (((S1 ('MetaSel ('Just "tindex") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Integer) :*: S1 ('MetaSel ('Just "tprecedingcomment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "tsourcepos") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (SourcePos, SourcePos)) :*: (S1 ('MetaSel ('Just "tdate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Day) :*: S1 ('MetaSel ('Just "tdate2") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Day))))) :*: ((S1 ('MetaSel ('Just "tstatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Status) :*: (S1 ('MetaSel ('Just "tcode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "tdescription") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text))) :*: (S1 ('MetaSel ('Just "tcomment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Just "ttags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Tag]) :*: S1 ('MetaSel ('Just "tpostings") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Posting]))))))

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.

Constructors

TransactionModifier |

Fields

- tmquerytxt :: Text
- tmpostingrules :: [TMPostingRule]

#### Instances

Instances details

ToJSON TransactionModifier Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: TransactionModifier -> Value Source # toEncoding :: TransactionModifier -> Encoding Source # toJSONList :: [TransactionModifier] -> Value Source # toEncodingList :: [TransactionModifier] -> Encoding Source # omitField :: TransactionModifier -> Bool Source #
NFData TransactionModifier Source # |
Instance details Defined in Hledger.Data.Types Methods rnf :: TransactionModifier -> () Source #
Generic TransactionModifier Source # |

Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep TransactionModifier |

Instance details

Defined in Hledger.Data.Types

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

Methods

from :: TransactionModifier -> Rep TransactionModifier x Source #

to :: Rep TransactionModifier x -> TransactionModifier Source #

Show TransactionModifier Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> TransactionModifier -> ShowS Source # show :: TransactionModifier -> String Source # showList :: [TransactionModifier] -> ShowS Source #
Eq TransactionModifier Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: TransactionModifier -> TransactionModifier -> Bool Source # (/=) :: TransactionModifier -> TransactionModifier -> Bool Source #
type Rep TransactionModifier Source # |

Instance details

Defined in Hledger.Data.Types

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

fromEFDay :: EFDay -> Day Source #

modifyEFDay :: (Day -> Day) -> EFDay -> EFDay Source #

type CommoditySymbol = Text Source #

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 Methods parseJSON :: Value -> Parser AmountPrecision Source # parseJSONList :: Value -> Parser [AmountPrecision] Source # omittedField :: Maybe AmountPrecision Source #
ToJSON AmountPrecision Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: AmountPrecision -> Value Source # toEncoding :: AmountPrecision -> Encoding Source # toJSONList :: [AmountPrecision] -> Value Source # toEncodingList :: [AmountPrecision] -> Encoding Source # omitField :: AmountPrecision -> Bool Source #
NFData AmountPrecision Source # |
Instance details Defined in Hledger.Data.Types Methods rnf :: AmountPrecision -> () Source #
Generic AmountPrecision Source # |

Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep AmountPrecision |

Instance details

Defined in Hledger.Data.Types

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

Methods

from :: AmountPrecision -> Rep AmountPrecision x Source #

to :: Rep AmountPrecision x -> AmountPrecision Source #

Read AmountPrecision Source # |
Instance details Defined in Hledger.Data.Types Methods readsPrec :: Int -> ReadS AmountPrecision Source # readList :: ReadS [AmountPrecision] Source # readPrec :: ReadPrec AmountPrecision Source # readListPrec :: ReadPrec [AmountPrecision] Source #
Show AmountPrecision Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> AmountPrecision -> ShowS Source # show :: AmountPrecision -> String Source # showList :: [AmountPrecision] -> ShowS Source #
Eq AmountPrecision Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: AmountPrecision -> AmountPrecision -> Bool Source # (/=) :: AmountPrecision -> AmountPrecision -> Bool Source #
Ord AmountPrecision Source # |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: AmountPrecision -> AmountPrecision -> Ordering Source #

(<) :: AmountPrecision -> AmountPrecision -> Bool Source #

(<=) :: AmountPrecision -> AmountPrecision -> Bool Source #

(>) :: AmountPrecision -> AmountPrecision -> Bool Source #

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

max :: AmountPrecision -> AmountPrecision -> AmountPrecision Source #

min :: AmountPrecision -> AmountPrecision -> AmountPrecision Source #

type Rep AmountPrecision Source # |

Instance details

Defined in Hledger.Data.Types

type Rep AmountPrecision = D1 ('MetaData "AmountPrecision" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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 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

- ascommodityside :: !Side

  show the symbol on the left or the right ?

- ascommodityspaced :: !Bool

  show a space between symbol and quantity ?

- asdigitgroups :: !(Maybe DigitGroupStyle)

  show the integer part with these digit group marks, or not

- asdecimalmark :: !(Maybe Char)

  show this character (should be . or ,) as decimal mark, or use the default (.)

- asprecision :: !AmountPrecision

  "display precision" - show this number of digits after the decimal point

- asrounding :: !Rounding

  "rounding strategy" - kept here for convenience, for now: when displaying an amount, it is ignored, but when applying this style to another amount, it determines how hard we should try to adjust that amount's display precision.

#### Instances

Instances details

FromJSON AmountStyle Source # |
Instance details Defined in Hledger.Data.Json Methods parseJSON :: Value -> Parser AmountStyle Source # parseJSONList :: Value -> Parser [AmountStyle] Source # omittedField :: Maybe AmountStyle Source #
ToJSON AmountStyle Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: AmountStyle -> Value Source # toEncoding :: AmountStyle -> Encoding Source # toJSONList :: [AmountStyle] -> Value Source # toEncodingList :: [AmountStyle] -> Encoding Source # omitField :: AmountStyle -> Bool Source #
NFData AmountStyle Source # |
Instance details Defined in Hledger.Data.Types Methods rnf :: AmountStyle -> () Source #
Generic AmountStyle Source # |

Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep AmountStyle |

Instance details

Defined in Hledger.Data.Types

type Rep AmountStyle = D1 ('MetaData "AmountStyle" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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)))))

Methods

from :: AmountStyle -> Rep AmountStyle x Source #

to :: Rep AmountStyle x -> AmountStyle Source #

Read AmountStyle Source # |
Instance details Defined in Hledger.Data.Types Methods readsPrec :: Int -> ReadS AmountStyle Source # readList :: ReadS [AmountStyle] Source # readPrec :: ReadPrec AmountStyle Source # readListPrec :: ReadPrec [AmountStyle] Source #
Show AmountStyle Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> AmountStyle -> ShowS Source # show :: AmountStyle -> String Source # showList :: [AmountStyle] -> ShowS Source #
Eq AmountStyle Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: AmountStyle -> AmountStyle -> Bool Source # (/=) :: AmountStyle -> AmountStyle -> Bool Source #
Ord AmountStyle Source # |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: AmountStyle -> AmountStyle -> Ordering Source #

(<) :: AmountStyle -> AmountStyle -> Bool Source #

(<=) :: AmountStyle -> AmountStyle -> Bool Source #

(>) :: AmountStyle -> AmountStyle -> Bool Source #

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

max :: AmountStyle -> AmountStyle -> AmountStyle Source #

min :: AmountStyle -> AmountStyle -> AmountStyle Source #

type Rep AmountStyle Source # |

Instance details

Defined in Hledger.Data.Types

type Rep AmountStyle = D1 ('MetaData "AmountStyle" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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 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 Methods toJSON :: EFDay -> Value Source # toEncoding :: EFDay -> Encoding Source # toJSONList :: [EFDay] -> Value Source # toEncodingList :: [EFDay] -> Encoding Source # omitField :: EFDay -> Bool Source #
NFData EFDay Source # |
Instance details Defined in Hledger.Data.Types Methods rnf :: EFDay -> () Source #
Generic EFDay Source # |

Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep EFDay |

Instance details

Defined in Hledger.Data.Types

type Rep EFDay = D1 ('MetaData "EFDay" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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)))

Methods

from :: EFDay -> Rep EFDay x Source #

to :: Rep EFDay x -> EFDay Source #

Show EFDay Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> EFDay -> ShowS Source # show :: EFDay -> String Source # showList :: [EFDay] -> ShowS 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 Methods compare :: EFDay -> EFDay -> Ordering Source # (<) :: EFDay -> EFDay -> Bool Source # (<=) :: EFDay -> EFDay -> Bool Source # (>) :: EFDay -> EFDay -> Bool Source # (>=) :: EFDay -> EFDay -> Bool Source # max :: EFDay -> EFDay -> EFDay Source # min :: EFDay -> EFDay -> EFDay Source #
type Rep EFDay Source # |

Instance details

Defined in Hledger.Data.Types

type Rep EFDay = D1 ('MetaData "EFDay" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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)))

type YearWeek = Int Source #

type MonthWeek = Int Source #

type WeekDay = Int Source #

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 a numeric offset relative to the reference date: (last|this|next) (day|week|month|quarter|year), where "this" means the period containing the reference date.

Or, (last|this|next) weekdayname, where "this" "next".

Or, (last|this|next) monthname, where "this" means the previous 1st if in that month, otherwise the start of the next occurrence of that month.

Constructors

SmartCompleteDate Day |
SmartAssumeStart Year (Maybe Month) |
SmartFromReference (Maybe Month) MonthDay |
SmartMonth Month |
SmartRelative Integer SmartInterval |
SmartRelativeMonth Ordering Month | EQ will be treated like GT
SmartRelativeWeekDay Ordering WeekDay |

#### Instances

Instances details

Show SmartDate Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> SmartDate -> ShowS Source # show :: SmartDate -> String Source # showList :: [SmartDate] -> ShowS Source #

data WhichDate Source #

Constructors

PrimaryDate |
SecondaryDate |

#### Instances

Instances details

Show WhichDate Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> WhichDate -> ShowS Source # show :: WhichDate -> String Source # showList :: [WhichDate] -> ShowS Source #
Eq WhichDate Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: WhichDate -> WhichDate -> Bool Source # (/=) :: WhichDate -> WhichDate -> Bool Source #

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 Methods toJSON :: DateSpan -> Value Source # toEncoding :: DateSpan -> Encoding Source # toJSONList :: [DateSpan] -> Value Source # toEncodingList :: [DateSpan] -> Encoding Source # omitField :: DateSpan -> Bool Source #
Default DateSpan Source # |
Instance details Defined in Hledger.Data.Types Methods def :: DateSpan Source #
NFData DateSpan Source # |
Instance details Defined in Hledger.Data.Types Methods rnf :: DateSpan -> () Source #
Generic DateSpan Source # |

Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep DateSpan |

Instance details

Defined in Hledger.Data.Types

type Rep DateSpan = D1 ('MetaData "DateSpan" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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))))

Methods

from :: DateSpan -> Rep DateSpan x Source #

to :: Rep DateSpan x -> DateSpan Source #

Show DateSpan Source # |
Instance details Defined in Hledger.Data.Dates Methods showsPrec :: Int -> DateSpan -> ShowS Source # show :: DateSpan -> String Source # showList :: [DateSpan] -> ShowS Source #
Eq DateSpan Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: DateSpan -> DateSpan -> Bool Source # (/=) :: DateSpan -> DateSpan -> Bool Source #
Ord DateSpan Source # |
Instance details Defined in Hledger.Data.Types Methods compare :: DateSpan -> DateSpan -> Ordering Source # (<) :: DateSpan -> DateSpan -> Bool Source # (<=) :: DateSpan -> DateSpan -> Bool Source # (>) :: DateSpan -> DateSpan -> Bool Source # (>=) :: DateSpan -> DateSpan -> Bool Source # max :: DateSpan -> DateSpan -> DateSpan Source # min :: DateSpan -> DateSpan -> DateSpan Source #
type Rep DateSpan Source # |

Instance details

Defined in Hledger.Data.Types

type Rep DateSpan = D1 ('MetaData "DateSpan" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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))))

type Payee = Text Source #

data DepthSpec Source #

Constructors

DepthSpec |

Fields

- dsFlatDepth :: Maybe Int
- dsRegexpDepths :: [(Regexp, Int)]

#### Instances

Instances details

Monoid DepthSpec Source # |
Instance details Defined in Hledger.Data.Types Methods mempty :: DepthSpec Source # mappend :: DepthSpec -> DepthSpec -> DepthSpec Source # mconcat :: [DepthSpec] -> DepthSpec Source #
Semigroup DepthSpec Source # |
Instance details Defined in Hledger.Data.Types Methods (<>) :: DepthSpec -> DepthSpec -> DepthSpec Source # sconcat :: NonEmpty DepthSpec -> DepthSpec Source # stimes :: Integral b => b -> DepthSpec -> DepthSpec Source #
Show DepthSpec Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> DepthSpec -> ShowS Source # show :: DepthSpec -> String Source # showList :: [DepthSpec] -> ShowS Source #
Eq DepthSpec Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: DepthSpec -> DepthSpec -> Bool Source # (/=) :: DepthSpec -> DepthSpec -> Bool Source #

isBalanceSheetAccountType :: AccountType -> Bool Source #

isIncomeStatementAccountType :: AccountType -> Bool Source #

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

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

data AccountAlias Source #

Constructors

BasicAlias AccountName AccountName |
RegexAlias Regexp Replacement |

#### Instances

Instances details

ToJSON AccountAlias Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: AccountAlias -> Value Source # toEncoding :: AccountAlias -> Encoding Source # toJSONList :: [AccountAlias] -> Value Source # toEncodingList :: [AccountAlias] -> Encoding Source # omitField :: AccountAlias -> Bool Source #
NFData AccountAlias Source # |
Instance details Defined in Hledger.Data.Types Methods rnf :: AccountAlias -> () Source #
Generic AccountAlias Source # |

Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep AccountAlias |

Instance details

Defined in Hledger.Data.Types

type Rep AccountAlias = D1 ('MetaData "AccountAlias" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" 'False) (C1 ('MetaCons "BasicAlias" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 AccountName) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 AccountName)) :+: C1 ('MetaCons "RegexAlias" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Regexp) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Replacement)))

Methods

from :: AccountAlias -> Rep AccountAlias x Source #

to :: Rep AccountAlias x -> AccountAlias Source #

Read AccountAlias Source # |
Instance details Defined in Hledger.Data.Types Methods readsPrec :: Int -> ReadS AccountAlias Source # readList :: ReadS [AccountAlias] Source # readPrec :: ReadPrec AccountAlias Source # readListPrec :: ReadPrec [AccountAlias] Source #
Show AccountAlias Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> AccountAlias -> ShowS Source # show :: AccountAlias -> String Source # showList :: [AccountAlias] -> ShowS Source #
Eq AccountAlias Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: AccountAlias -> AccountAlias -> Bool Source # (/=) :: AccountAlias -> AccountAlias -> Bool Source #
Ord AccountAlias Source # |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: AccountAlias -> AccountAlias -> Ordering Source #

(<) :: AccountAlias -> AccountAlias -> Bool Source #

(<=) :: AccountAlias -> AccountAlias -> Bool Source #

(>) :: AccountAlias -> AccountAlias -> Bool Source #

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

max :: AccountAlias -> AccountAlias -> AccountAlias Source #

min :: AccountAlias -> AccountAlias -> AccountAlias Source #

type Rep AccountAlias Source # |

Instance details

Defined in Hledger.Data.Types

type Rep AccountAlias = D1 ('MetaData "AccountAlias" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" 'False) (C1 ('MetaCons "BasicAlias" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 AccountName) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 AccountName)) :+: C1 ('MetaCons "RegexAlias" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Regexp) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Replacement)))

type DecimalMark = Char Source #

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

isDecimalMark :: Char -> Bool Source #

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 Methods parseJSON :: Value -> Parser AmountCost Source # parseJSONList :: Value -> Parser [AmountCost] Source # omittedField :: Maybe AmountCost Source #
ToJSON AmountCost Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: AmountCost -> Value Source # toEncoding :: AmountCost -> Encoding Source # toJSONList :: [AmountCost] -> Value Source # toEncodingList :: [AmountCost] -> Encoding Source # omitField :: AmountCost -> Bool Source #
NFData AmountCost Source # |
Instance details Defined in Hledger.Data.Types Methods rnf :: AmountCost -> () Source #
Generic AmountCost Source # |

Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep AmountCost |

Instance details

Defined in Hledger.Data.Types

type Rep AmountCost = D1 ('MetaData "AmountCost" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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)))

Methods

from :: AmountCost -> Rep AmountCost x Source #

to :: Rep AmountCost x -> AmountCost Source #

Show AmountCost Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> AmountCost -> ShowS Source # show :: AmountCost -> String Source # showList :: [AmountCost] -> ShowS Source #
Eq AmountCost Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: AmountCost -> AmountCost -> Bool Source # (/=) :: AmountCost -> AmountCost -> Bool Source #
Ord AmountCost Source # |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: AmountCost -> AmountCost -> Ordering Source #

(<) :: AmountCost -> AmountCost -> Bool Source #

(<=) :: AmountCost -> AmountCost -> Bool Source #

(>) :: AmountCost -> AmountCost -> Bool Source #

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

max :: AmountCost -> AmountCost -> AmountCost Source #

min :: AmountCost -> AmountCost -> AmountCost Source #

type Rep AmountCost Source # |

Instance details

Defined in Hledger.Data.Types

type Rep AmountCost = D1 ('MetaData "AmountCost" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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 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 Methods parseJSON :: Value -> Parser DigitGroupStyle Source # parseJSONList :: Value -> Parser [DigitGroupStyle] Source # omittedField :: Maybe DigitGroupStyle Source #
ToJSON DigitGroupStyle Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: DigitGroupStyle -> Value Source # toEncoding :: DigitGroupStyle -> Encoding Source # toJSONList :: [DigitGroupStyle] -> Value Source # toEncodingList :: [DigitGroupStyle] -> Encoding Source # omitField :: DigitGroupStyle -> Bool Source #
NFData DigitGroupStyle Source # |
Instance details Defined in Hledger.Data.Types Methods rnf :: DigitGroupStyle -> () Source #
Generic DigitGroupStyle Source # |

Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep DigitGroupStyle |

Instance details

Defined in Hledger.Data.Types

type Rep DigitGroupStyle = D1 ('MetaData "DigitGroupStyle" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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])))

Methods

from :: DigitGroupStyle -> Rep DigitGroupStyle x Source #

to :: Rep DigitGroupStyle x -> DigitGroupStyle Source #

Read DigitGroupStyle Source # |
Instance details Defined in Hledger.Data.Types Methods readsPrec :: Int -> ReadS DigitGroupStyle Source # readList :: ReadS [DigitGroupStyle] Source # readPrec :: ReadPrec DigitGroupStyle Source # readListPrec :: ReadPrec [DigitGroupStyle] Source #
Show DigitGroupStyle Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> DigitGroupStyle -> ShowS Source # show :: DigitGroupStyle -> String Source # showList :: [DigitGroupStyle] -> ShowS Source #
Eq DigitGroupStyle Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: DigitGroupStyle -> DigitGroupStyle -> Bool Source # (/=) :: DigitGroupStyle -> DigitGroupStyle -> Bool Source #
Ord DigitGroupStyle Source # |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: DigitGroupStyle -> DigitGroupStyle -> Ordering Source #

(<) :: DigitGroupStyle -> DigitGroupStyle -> Bool Source #

(<=) :: DigitGroupStyle -> DigitGroupStyle -> Bool Source #

(>) :: DigitGroupStyle -> DigitGroupStyle -> Bool Source #

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

max :: DigitGroupStyle -> DigitGroupStyle -> DigitGroupStyle Source #

min :: DigitGroupStyle -> DigitGroupStyle -> DigitGroupStyle Source #

type Rep DigitGroupStyle Source # |

Instance details

Defined in Hledger.Data.Types

type Rep DigitGroupStyle = D1 ('MetaData "DigitGroupStyle" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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 Methods parseJSON :: Value -> Parser Rounding Source # parseJSONList :: Value -> Parser [Rounding] Source # omittedField :: Maybe Rounding Source #
ToJSON Rounding Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: Rounding -> Value Source # toEncoding :: Rounding -> Encoding Source # toJSONList :: [Rounding] -> Value Source # toEncodingList :: [Rounding] -> Encoding Source # omitField :: Rounding -> Bool Source #
NFData Rounding Source # |
Instance details Defined in Hledger.Data.Types Methods rnf :: Rounding -> () Source #
Generic Rounding Source # |

Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep Rounding |

Instance details

Defined in Hledger.Data.Types

type Rep Rounding = D1 ('MetaData "Rounding" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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)))

Methods

from :: Rounding -> Rep Rounding x Source #

to :: Rep Rounding x -> Rounding Source #

Read Rounding Source # |
Instance details Defined in Hledger.Data.Types Methods readsPrec :: Int -> ReadS Rounding Source # readList :: ReadS [Rounding] Source # readPrec :: ReadPrec Rounding Source # readListPrec :: ReadPrec [Rounding] Source #
Show Rounding Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> Rounding -> ShowS Source # show :: Rounding -> String Source # showList :: [Rounding] -> ShowS Source #
Eq Rounding Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: Rounding -> Rounding -> Bool Source # (/=) :: Rounding -> Rounding -> Bool Source #
Ord Rounding Source # |
Instance details Defined in Hledger.Data.Types Methods compare :: Rounding -> Rounding -> Ordering Source # (<) :: Rounding -> Rounding -> Bool Source # (<=) :: Rounding -> Rounding -> Bool Source # (>) :: Rounding -> Rounding -> Bool Source # (>=) :: Rounding -> Rounding -> Bool Source # max :: Rounding -> Rounding -> Rounding Source # min :: Rounding -> Rounding -> Rounding Source #
type Rep Rounding Source # |

Instance details

Defined in Hledger.Data.Types

type Rep Rounding = D1 ('MetaData "Rounding" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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 #

Constructors

Commodity |

Fields

- csymbol :: CommoditySymbol
- cformat :: Maybe AmountStyle
- ccomment :: Text

  any comment lines following the commodity directive

- ctags :: [Tag]

  tags extracted from the comment, if any

#### Instances

Instances details

ToJSON Commodity Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: Commodity -> Value Source # toEncoding :: Commodity -> Encoding Source # toJSONList :: [Commodity] -> Value Source # toEncodingList :: [Commodity] -> Encoding Source # omitField :: Commodity -> Bool Source #
NFData Commodity Source # |
Instance details Defined in Hledger.Data.Types Methods rnf :: Commodity -> () Source #
Generic Commodity Source # |

Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep Commodity |

Instance details

Defined in Hledger.Data.Types

type Rep Commodity = D1 ('MetaData "Commodity" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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))) :*: (S1 ('MetaSel ('Just "ccomment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "ctags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Tag]))))

Methods

from :: Commodity -> Rep Commodity x Source #

to :: Rep Commodity x -> Commodity Source #

Show Commodity Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> Commodity -> ShowS Source # show :: Commodity -> String Source # showList :: [Commodity] -> ShowS Source #
Eq Commodity Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: Commodity -> Commodity -> Bool Source # (/=) :: Commodity -> Commodity -> Bool Source #
type Rep Commodity Source # |

Instance details

Defined in Hledger.Data.Types

type Rep Commodity = D1 ('MetaData "Commodity" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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))) :*: (S1 ('MetaSel ('Just "ccomment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "ctags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Tag]))))

data CostBasis Source #

The cost basis of an individual lot - some quantity of an asset acquired at a given date and time. This can represent a definite cost basis, which must have a cost and date; the label is optional. Or it can represent a cost basis matcher for selecting lots. Note: cost is always stored as a per-unit cost, even if the user specified total cost with {{}}.

Constructors

CostBasis |

Fields

- cbCost :: !(Maybe Amount)

  nominal acquisition cost (per-unit)

- cbDate :: !(Maybe Day)

  nominal acquisition date

- cbLabel :: !(Maybe Text)

  a short label to ensure uniqueness, correct intra-day order, or memorability, if needed

#### Instances

Instances details

FromJSON CostBasis Source # |
Instance details Defined in Hledger.Data.Json Methods parseJSON :: Value -> Parser CostBasis Source # parseJSONList :: Value -> Parser [CostBasis] Source # omittedField :: Maybe CostBasis Source #
ToJSON CostBasis Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: CostBasis -> Value Source # toEncoding :: CostBasis -> Encoding Source # toJSONList :: [CostBasis] -> Value Source # toEncodingList :: [CostBasis] -> Encoding Source # omitField :: CostBasis -> Bool Source #
NFData CostBasis Source # |
Instance details Defined in Hledger.Data.Types Methods rnf :: CostBasis -> () Source #
Generic CostBasis Source # |

Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep CostBasis |

Instance details

Defined in Hledger.Data.Types

type Rep CostBasis = D1 ('MetaData "CostBasis" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" 'False) (C1 ('MetaCons "CostBasis" 'PrefixI 'True) (S1 ('MetaSel ('Just "cbCost") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Amount)) :*: (S1 ('MetaSel ('Just "cbDate") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Day)) :*: S1 ('MetaSel ('Just "cbLabel") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Text)))))

Methods

from :: CostBasis -> Rep CostBasis x Source #

to :: Rep CostBasis x -> CostBasis Source #

Show CostBasis Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> CostBasis -> ShowS Source # show :: CostBasis -> String Source # showList :: [CostBasis] -> ShowS Source #
Eq CostBasis Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: CostBasis -> CostBasis -> Bool Source # (/=) :: CostBasis -> CostBasis -> Bool Source #
Ord CostBasis Source # |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: CostBasis -> CostBasis -> Ordering Source #

(<) :: CostBasis -> CostBasis -> Bool Source #

(<=) :: CostBasis -> CostBasis -> Bool Source #

(>) :: CostBasis -> CostBasis -> Bool Source #

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

max :: CostBasis -> CostBasis -> CostBasis Source #

min :: CostBasis -> CostBasis -> CostBasis Source #

type Rep CostBasis Source # |

Instance details

Defined in Hledger.Data.Types

type Rep CostBasis = D1 ('MetaData "CostBasis" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" 'False) (C1 ('MetaCons "CostBasis" 'PrefixI 'True) (S1 ('MetaSel ('Just "cbCost") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Amount)) :*: (S1 ('MetaSel ('Just "cbDate") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Day)) :*: S1 ('MetaSel ('Just "cbLabel") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Text)))))

class HasAmounts a where Source #

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

Methods

styleAmounts :: Map CommoditySymbol AmountStyle -> a -> a Source #

#### Instances

Instances details

HasAmounts Amount Source # |
Instance details Defined in Hledger.Data.Amount Methods styleAmounts :: Map CommoditySymbol AmountStyle -> Amount -> Amount Source #
HasAmounts BalanceAssertion Source # |
Instance details Defined in Hledger.Data.Posting Methods styleAmounts :: Map CommoditySymbol AmountStyle -> BalanceAssertion -> BalanceAssertion Source #
HasAmounts BalanceData Source # |
Instance details Defined in Hledger.Data.Amount Methods styleAmounts :: Map CommoditySymbol AmountStyle -> BalanceData -> BalanceData Source #
HasAmounts MixedAmount Source # |
Instance details Defined in Hledger.Data.Amount Methods styleAmounts :: Map CommoditySymbol AmountStyle -> MixedAmount -> MixedAmount Source #
HasAmounts Posting Source # |
Instance details Defined in Hledger.Data.Posting Methods styleAmounts :: Map CommoditySymbol AmountStyle -> Posting -> Posting Source #
HasAmounts Transaction Source # |
Instance details Defined in Hledger.Data.Transaction Methods styleAmounts :: Map CommoditySymbol AmountStyle -> Transaction -> Transaction Source #
HasAmounts AccountTransactionsReportItem Source # |
Instance details Defined in Hledger.Reports.AccountTransactionsReport Methods styleAmounts :: Map CommoditySymbol AmountStyle -> AccountTransactionsReportItem -> AccountTransactionsReportItem Source #
HasAmounts BalanceReportItem Source # |
Instance details Defined in Hledger.Reports.BalanceReport Methods styleAmounts :: Map CommoditySymbol AmountStyle -> BalanceReportItem -> BalanceReportItem Source #
HasAmounts PostingsReportItem Source # |
Instance details Defined in Hledger.Reports.PostingsReport Methods styleAmounts :: Map CommoditySymbol AmountStyle -> PostingsReportItem -> PostingsReportItem Source #
HasAmounts a => HasAmounts (Account a) Source # |
Instance details Defined in Hledger.Data.Amount Methods styleAmounts :: Map CommoditySymbol AmountStyle -> Account a -> Account a Source #
HasAmounts a => HasAmounts (PeriodData a) Source # |
Instance details Defined in Hledger.Data.Amount Methods styleAmounts :: Map CommoditySymbol AmountStyle -> PeriodData a -> PeriodData a Source #
HasAmounts a => HasAmounts (Maybe a) Source # |
Instance details Defined in Hledger.Data.Types Methods styleAmounts :: Map CommoditySymbol AmountStyle -> Maybe a -> Maybe a Source #
HasAmounts a => HasAmounts [a] Source # |
Instance details Defined in Hledger.Data.Types Methods styleAmounts :: Map CommoditySymbol AmountStyle -> [a] -> [a] Source #
HasAmounts b => HasAmounts (CompoundPeriodicReport a b) Source # |
Instance details Defined in Hledger.Reports.ReportTypes Methods styleAmounts :: Map CommoditySymbol AmountStyle -> CompoundPeriodicReport a b -> CompoundPeriodicReport a b Source #
HasAmounts b => HasAmounts (PeriodicReport a b) Source # |
Instance details Defined in Hledger.Reports.ReportTypes Methods styleAmounts :: Map CommoditySymbol AmountStyle -> PeriodicReport a b -> PeriodicReport a b Source #
HasAmounts b => HasAmounts (PeriodicReportRow a b) Source # |
Instance details Defined in Hledger.Reports.ReportTypes Methods styleAmounts :: Map CommoditySymbol AmountStyle -> PeriodicReportRow a b -> PeriodicReportRow a b Source #
(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 Methods styleAmounts :: Map CommoditySymbol AmountStyle -> (Text, PeriodicReport a b, Bool) -> (Text, PeriodicReport a b, Bool) Source #

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

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

data PostingType Source #

Constructors

RegularPosting |
VirtualPosting |
BalancedVirtualPosting |

#### Instances

Instances details

FromJSON PostingType Source # |
Instance details Defined in Hledger.Data.Json Methods parseJSON :: Value -> Parser PostingType Source # parseJSONList :: Value -> Parser [PostingType] Source # omittedField :: Maybe PostingType Source #
ToJSON PostingType Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: PostingType -> Value Source # toEncoding :: PostingType -> Encoding Source # toJSONList :: [PostingType] -> Value Source # toEncodingList :: [PostingType] -> Encoding Source # omitField :: PostingType -> Bool Source #
NFData PostingType Source # |
Instance details Defined in Hledger.Data.Types Methods rnf :: PostingType -> () Source #
Generic PostingType Source # |

Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep PostingType |
Instance details Defined in Hledger.Data.Types type Rep PostingType = D1 ('MetaData "PostingType" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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)))

Methods

from :: PostingType -> Rep PostingType x Source #

to :: Rep PostingType x -> PostingType Source #

Show PostingType Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> PostingType -> ShowS Source # show :: PostingType -> String Source # showList :: [PostingType] -> ShowS Source #
Eq PostingType Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: PostingType -> PostingType -> Bool Source # (/=) :: PostingType -> PostingType -> Bool Source #
type Rep PostingType Source # |
Instance details Defined in Hledger.Data.Types type Rep PostingType = D1 ('MetaData "PostingType" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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 TagName = Text Source #

type TagValue = Text Source #

type HiddenTag Source #

Arguments

= Tag | A tag whose name begins with _.

type DateTag = (TagName, Day) Source #

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 (_) ?

nullsourcepos :: SourcePos Source #

nullsourcepospair :: (SourcePos, SourcePos) Source #

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

- baamount :: Amount

  the expected balance in a particular commodity

- batotal :: Bool

  disallow additional non-asserted commodities ?

- bainclusive :: Bool

  include subaccounts when calculating the actual balance ?

- baposition :: SourcePos

  the assertion's file position, for error reporting

#### Instances

Instances details

FromJSON BalanceAssertion Source # |
Instance details Defined in Hledger.Data.Json Methods parseJSON :: Value -> Parser BalanceAssertion Source # parseJSONList :: Value -> Parser [BalanceAssertion] Source # omittedField :: Maybe BalanceAssertion Source #
ToJSON BalanceAssertion Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: BalanceAssertion -> Value Source # toEncoding :: BalanceAssertion -> Encoding Source # toJSONList :: [BalanceAssertion] -> Value Source # toEncodingList :: [BalanceAssertion] -> Encoding Source # omitField :: BalanceAssertion -> Bool Source #
NFData BalanceAssertion Source # |
Instance details Defined in Hledger.Data.Types Methods rnf :: BalanceAssertion -> () Source #
Generic BalanceAssertion Source # |

Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep BalanceAssertion |

Instance details

Defined in Hledger.Data.Types

type Rep BalanceAssertion = D1 ('MetaData "BalanceAssertion" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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))))

Methods

from :: BalanceAssertion -> Rep BalanceAssertion x Source #

to :: Rep BalanceAssertion x -> BalanceAssertion Source #

Show BalanceAssertion Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> BalanceAssertion -> ShowS Source # show :: BalanceAssertion -> String Source # showList :: [BalanceAssertion] -> ShowS Source #
Eq BalanceAssertion Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: BalanceAssertion -> BalanceAssertion -> Bool Source # (/=) :: BalanceAssertion -> BalanceAssertion -> Bool Source #
HasAmounts BalanceAssertion Source # |
Instance details Defined in Hledger.Data.Posting Methods styleAmounts :: Map CommoditySymbol AmountStyle -> BalanceAssertion -> BalanceAssertion Source #
type Rep BalanceAssertion Source # |

Instance details

Defined in Hledger.Data.Types

type Rep BalanceAssertion = D1 ('MetaData "BalanceAssertion" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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.

Constructors

TMPostingRule |

Fields

- tmprPosting :: Posting
- tmprIsMultiplier :: Bool

#### Instances

Instances details

ToJSON TMPostingRule Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: TMPostingRule -> Value Source # toEncoding :: TMPostingRule -> Encoding Source # toJSONList :: [TMPostingRule] -> Value Source # toEncodingList :: [TMPostingRule] -> Encoding Source # omitField :: TMPostingRule -> Bool Source #
NFData TMPostingRule Source # |
Instance details Defined in Hledger.Data.Types Methods rnf :: TMPostingRule -> () Source #
Generic TMPostingRule Source # |

Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep TMPostingRule |

Instance details

Defined in Hledger.Data.Types

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

Methods

from :: TMPostingRule -> Rep TMPostingRule x Source #

to :: Rep TMPostingRule x -> TMPostingRule Source #

Show TMPostingRule Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> TMPostingRule -> ShowS Source # show :: TMPostingRule -> String Source # showList :: [TMPostingRule] -> ShowS Source #
Eq TMPostingRule Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: TMPostingRule -> TMPostingRule -> Bool Source # (/=) :: TMPostingRule -> TMPostingRule -> Bool Source #
type Rep TMPostingRule Source # |

Instance details

Defined in Hledger.Data.Types

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

nulltransactionmodifier :: TransactionModifier Source #

nullperiodictransaction :: PeriodicTransaction Source #

data TimeclockCode Source #

Constructors

SetBalance |
SetRequiredHours |
In |
Out |
FinalOut |

#### Instances

Instances details

ToJSON TimeclockCode Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: TimeclockCode -> Value Source # toEncoding :: TimeclockCode -> Encoding Source # toJSONList :: [TimeclockCode] -> Value Source # toEncodingList :: [TimeclockCode] -> Encoding Source # omitField :: TimeclockCode -> Bool Source #
NFData TimeclockCode Source # |
Instance details Defined in Hledger.Data.Types Methods rnf :: TimeclockCode -> () Source #
Generic TimeclockCode Source # |

Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep TimeclockCode |

Instance details

Defined in Hledger.Data.Types

type Rep TimeclockCode = D1 ('MetaData "TimeclockCode" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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))))

Methods

from :: TimeclockCode -> Rep TimeclockCode x Source #

to :: Rep TimeclockCode x -> TimeclockCode Source #

Read TimeclockCode Source # |
Instance details Defined in Hledger.Data.Timeclock Methods readsPrec :: Int -> ReadS TimeclockCode Source # readList :: ReadS [TimeclockCode] Source # readPrec :: ReadPrec TimeclockCode Source # readListPrec :: ReadPrec [TimeclockCode] Source #
Show TimeclockCode Source # |
Instance details Defined in Hledger.Data.Timeclock Methods showsPrec :: Int -> TimeclockCode -> ShowS Source # show :: TimeclockCode -> String Source # showList :: [TimeclockCode] -> ShowS Source #
Eq TimeclockCode Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: TimeclockCode -> TimeclockCode -> Bool Source # (/=) :: TimeclockCode -> TimeclockCode -> Bool Source #
Ord TimeclockCode Source # |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: TimeclockCode -> TimeclockCode -> Ordering Source #

(<) :: TimeclockCode -> TimeclockCode -> Bool Source #

(<=) :: TimeclockCode -> TimeclockCode -> Bool Source #

(>) :: TimeclockCode -> TimeclockCode -> Bool Source #

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

max :: TimeclockCode -> TimeclockCode -> TimeclockCode Source #

min :: TimeclockCode -> TimeclockCode -> TimeclockCode Source #

type Rep TimeclockCode Source # |

Instance details

Defined in Hledger.Data.Types

type Rep TimeclockCode = D1 ('MetaData "TimeclockCode" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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 #

Constructors

TimeclockEntry |

Fields

- tlsourcepos :: SourcePos
- tlcode :: TimeclockCode
- tldatetime :: LocalTime
- tlaccount :: AccountName
- tldescription :: Text
- tlcomment :: Text
- tltags :: [Tag]

#### Instances

Instances details

ToJSON TimeclockEntry Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: TimeclockEntry -> Value Source # toEncoding :: TimeclockEntry -> Encoding Source # toJSONList :: [TimeclockEntry] -> Value Source # toEncodingList :: [TimeclockEntry] -> Encoding Source # omitField :: TimeclockEntry -> Bool Source #
NFData TimeclockEntry Source # |
Instance details Defined in Hledger.Data.Types Methods rnf :: TimeclockEntry -> () Source #
Generic TimeclockEntry Source # |

Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep TimeclockEntry |

Instance details

Defined in Hledger.Data.Types

type Rep TimeclockEntry = D1 ('MetaData "TimeclockEntry" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" 'False) (C1 ('MetaCons "TimeclockEntry" 'PrefixI 'True) ((S1 ('MetaSel ('Just "tlsourcepos") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SourcePos) :*: (S1 ('MetaSel ('Just "tlcode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 TimeclockCode) :*: S1 ('MetaSel ('Just "tldatetime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 LocalTime))) :*: ((S1 ('MetaSel ('Just "tlaccount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 AccountName) :*: S1 ('MetaSel ('Just "tldescription") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "tlcomment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "tltags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Tag])))))

Methods

from :: TimeclockEntry -> Rep TimeclockEntry x Source #

to :: Rep TimeclockEntry x -> TimeclockEntry Source #

Show TimeclockEntry Source # |
Instance details Defined in Hledger.Data.Timeclock Methods showsPrec :: Int -> TimeclockEntry -> ShowS Source # show :: TimeclockEntry -> String Source # showList :: [TimeclockEntry] -> ShowS Source #
Eq TimeclockEntry Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: TimeclockEntry -> TimeclockEntry -> Bool Source # (/=) :: TimeclockEntry -> TimeclockEntry -> Bool Source #
Ord TimeclockEntry Source # |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: TimeclockEntry -> TimeclockEntry -> Ordering Source #

(<) :: TimeclockEntry -> TimeclockEntry -> Bool Source #

(<=) :: TimeclockEntry -> TimeclockEntry -> Bool Source #

(>) :: TimeclockEntry -> TimeclockEntry -> Bool Source #

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

max :: TimeclockEntry -> TimeclockEntry -> TimeclockEntry Source #

min :: TimeclockEntry -> TimeclockEntry -> TimeclockEntry Source #

type Rep TimeclockEntry Source # |

Instance details

Defined in Hledger.Data.Types

type Rep TimeclockEntry = D1 ('MetaData "TimeclockEntry" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" 'False) (C1 ('MetaCons "TimeclockEntry" 'PrefixI 'True) ((S1 ('MetaSel ('Just "tlsourcepos") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SourcePos) :*: (S1 ('MetaSel ('Just "tlcode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 TimeclockCode) :*: S1 ('MetaSel ('Just "tldatetime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 LocalTime))) :*: ((S1 ('MetaSel ('Just "tlaccount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 AccountName) :*: S1 ('MetaSel ('Just "tldescription") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "tlcomment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "tltags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Tag])))))

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.

Constructors

PriceDirective |

Fields

- pdsourcepos :: SourcePos
- pddate :: Day
- pdcommodity :: CommoditySymbol
- pdamount :: Amount

#### Instances

Instances details

ToJSON PriceDirective Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: PriceDirective -> Value Source # toEncoding :: PriceDirective -> Encoding Source # toJSONList :: [PriceDirective] -> Value Source # toEncodingList :: [PriceDirective] -> Encoding Source # omitField :: PriceDirective -> Bool Source #
NFData PriceDirective Source # |
Instance details Defined in Hledger.Data.Types Methods rnf :: PriceDirective -> () Source #
Generic PriceDirective Source # |

Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep PriceDirective |

Instance details

Defined in Hledger.Data.Types

type Rep PriceDirective = D1 ('MetaData "PriceDirective" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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))))

Methods

from :: PriceDirective -> Rep PriceDirective x Source #

to :: Rep PriceDirective x -> PriceDirective Source #

Show PriceDirective Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> PriceDirective -> ShowS Source # show :: PriceDirective -> String Source # showList :: [PriceDirective] -> ShowS Source #
Eq PriceDirective Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: PriceDirective -> PriceDirective -> Bool Source # (/=) :: PriceDirective -> PriceDirective -> Bool Source #
Ord PriceDirective Source # |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: PriceDirective -> PriceDirective -> Ordering Source #

(<) :: PriceDirective -> PriceDirective -> Bool Source #

(<=) :: PriceDirective -> PriceDirective -> Bool Source #

(>) :: PriceDirective -> PriceDirective -> Bool Source #

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

max :: PriceDirective -> PriceDirective -> PriceDirective Source #

min :: PriceDirective -> PriceDirective -> PriceDirective Source #

type Rep PriceDirective Source # |

Instance details

Defined in Hledger.Data.Types

type Rep PriceDirective = D1 ('MetaData "PriceDirective" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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

- mpdate :: Day

  Date on which this price becomes effective.

- mpfrom :: CommoditySymbol

  The commodity being converted from.

- mpto :: CommoditySymbol

  The commodity being converted to.

- mprate :: Quantity

  One unit of the "from" commodity is worth this quantity of the "to" commodity.

#### Instances

Instances details

FromJSON MarketPrice Source # |
Instance details Defined in Hledger.Data.Json Methods parseJSON :: Value -> Parser MarketPrice Source # parseJSONList :: Value -> Parser [MarketPrice] Source # omittedField :: Maybe MarketPrice Source #
ToJSON MarketPrice Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: MarketPrice -> Value Source # toEncoding :: MarketPrice -> Encoding Source # toJSONList :: [MarketPrice] -> Value Source # toEncodingList :: [MarketPrice] -> Encoding Source # omitField :: MarketPrice -> Bool Source #
NFData MarketPrice Source # |
Instance details Defined in Hledger.Data.Types Methods rnf :: MarketPrice -> () Source #
Generic MarketPrice Source # |

Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep MarketPrice |

Instance details

Defined in Hledger.Data.Types

type Rep MarketPrice = D1 ('MetaData "MarketPrice" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" 'False) (C1 ('MetaCons "MarketPrice" 'PrefixI 'True) ((S1 ('MetaSel ('Just "mpdate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Day) :*: S1 ('MetaSel ('Just "mpfrom") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 CommoditySymbol)) :*: (S1 ('MetaSel ('Just "mpto") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 CommoditySymbol) :*: S1 ('MetaSel ('Just "mprate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Quantity))))

Methods

from :: MarketPrice -> Rep MarketPrice x Source #

to :: Rep MarketPrice x -> MarketPrice Source #

Show MarketPrice Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> MarketPrice -> ShowS Source # show :: MarketPrice -> String Source # showList :: [MarketPrice] -> ShowS Source #
Eq MarketPrice Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: MarketPrice -> MarketPrice -> Bool Source # (/=) :: MarketPrice -> MarketPrice -> Bool Source #
Ord MarketPrice Source # |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: MarketPrice -> MarketPrice -> Ordering Source #

(<) :: MarketPrice -> MarketPrice -> Bool Source #

(<=) :: MarketPrice -> MarketPrice -> Bool Source #

(>) :: MarketPrice -> MarketPrice -> Bool Source #

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

max :: MarketPrice -> MarketPrice -> MarketPrice Source #

min :: MarketPrice -> MarketPrice -> MarketPrice Source #

type Rep MarketPrice Source # |

Instance details

Defined in Hledger.Data.Types

type Rep MarketPrice = D1 ('MetaData "MarketPrice" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" 'False) (C1 ('MetaCons "MarketPrice" 'PrefixI 'True) ((S1 ('MetaSel ('Just "mpdate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Day) :*: S1 ('MetaSel ('Just "mpfrom") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 CommoditySymbol)) :*: (S1 ('MetaSel ('Just "mpto") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 CommoditySymbol) :*: S1 ('MetaSel ('Just "mprate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Quantity))))

showMarketPrice :: MarketPrice -> String Source #

showMarketPrices :: [MarketPrice] -> [Char] Source #

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 Methods toJSON :: PayeeDeclarationInfo -> Value Source # toEncoding :: PayeeDeclarationInfo -> Encoding Source # toJSONList :: [PayeeDeclarationInfo] -> Value Source # toEncodingList :: [PayeeDeclarationInfo] -> Encoding Source # omitField :: PayeeDeclarationInfo -> Bool Source #
NFData PayeeDeclarationInfo Source # |
Instance details Defined in Hledger.Data.Types Methods rnf :: PayeeDeclarationInfo -> () Source #
Generic PayeeDeclarationInfo Source # |

Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep PayeeDeclarationInfo |

Instance details

Defined in Hledger.Data.Types

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

Methods

from :: PayeeDeclarationInfo -> Rep PayeeDeclarationInfo x Source #

to :: Rep PayeeDeclarationInfo x -> PayeeDeclarationInfo Source #

Show PayeeDeclarationInfo Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> PayeeDeclarationInfo -> ShowS Source # show :: PayeeDeclarationInfo -> String Source # showList :: [PayeeDeclarationInfo] -> ShowS Source #
Eq PayeeDeclarationInfo Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: PayeeDeclarationInfo -> PayeeDeclarationInfo -> Bool Source # (/=) :: PayeeDeclarationInfo -> PayeeDeclarationInfo -> Bool Source #
type Rep PayeeDeclarationInfo Source # |

Instance details

Defined in Hledger.Data.Types

type Rep PayeeDeclarationInfo = D1 ('MetaData "PayeeDeclarationInfo" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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 Methods toJSON :: TagDeclarationInfo -> Value Source # toEncoding :: TagDeclarationInfo -> Encoding Source # toJSONList :: [TagDeclarationInfo] -> Value Source # toEncodingList :: [TagDeclarationInfo] -> Encoding Source # omitField :: TagDeclarationInfo -> Bool Source #
NFData TagDeclarationInfo Source # |
Instance details Defined in Hledger.Data.Types Methods rnf :: TagDeclarationInfo -> () Source #
Generic TagDeclarationInfo Source # |

Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep TagDeclarationInfo |
Instance details Defined in Hledger.Data.Types type Rep TagDeclarationInfo = D1 ('MetaData "TagDeclarationInfo" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" 'True) (C1 ('MetaCons "TagDeclarationInfo" 'PrefixI 'True) (S1 ('MetaSel ('Just "tdicomment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

Methods

from :: TagDeclarationInfo -> Rep TagDeclarationInfo x Source #

to :: Rep TagDeclarationInfo x -> TagDeclarationInfo Source #

Show TagDeclarationInfo Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> TagDeclarationInfo -> ShowS Source # show :: TagDeclarationInfo -> String Source # showList :: [TagDeclarationInfo] -> ShowS Source #
Eq TagDeclarationInfo Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: TagDeclarationInfo -> TagDeclarationInfo -> Bool Source # (/=) :: TagDeclarationInfo -> TagDeclarationInfo -> Bool Source #
type Rep TagDeclarationInfo Source # |
Instance details Defined in Hledger.Data.Types type Rep TagDeclarationInfo = D1 ('MetaData "TagDeclarationInfo" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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

- 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..)

- adisourcepos :: SourcePos

  source file and position

#### Instances

Instances details

FromJSON AccountDeclarationInfo Source # |
Instance details Defined in Hledger.Data.Json Methods parseJSON :: Value -> Parser AccountDeclarationInfo Source # parseJSONList :: Value -> Parser [AccountDeclarationInfo] Source # omittedField :: Maybe AccountDeclarationInfo Source #
ToJSON AccountDeclarationInfo Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: AccountDeclarationInfo -> Value Source # toEncoding :: AccountDeclarationInfo -> Encoding Source # toJSONList :: [AccountDeclarationInfo] -> Value Source # toEncodingList :: [AccountDeclarationInfo] -> Encoding Source # omitField :: AccountDeclarationInfo -> Bool Source #
NFData AccountDeclarationInfo Source # |
Instance details Defined in Hledger.Data.Types Methods rnf :: AccountDeclarationInfo -> () Source #
Generic AccountDeclarationInfo Source # |

Instance details

Defined in Hledger.Data.Types

Associated Types

type Rep AccountDeclarationInfo |

Instance details

Defined in Hledger.Data.Types

type Rep AccountDeclarationInfo = D1 ('MetaData "AccountDeclarationInfo" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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))))

Methods

from :: AccountDeclarationInfo -> Rep AccountDeclarationInfo x Source #

to :: Rep AccountDeclarationInfo x -> AccountDeclarationInfo Source #

Show AccountDeclarationInfo Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> AccountDeclarationInfo -> ShowS Source # show :: AccountDeclarationInfo -> String Source # showList :: [AccountDeclarationInfo] -> ShowS Source #
Eq AccountDeclarationInfo Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: AccountDeclarationInfo -> AccountDeclarationInfo -> Bool Source # (/=) :: AccountDeclarationInfo -> AccountDeclarationInfo -> Bool Source #
type Rep AccountDeclarationInfo Source # |

Instance details

Defined in Hledger.Data.Types

type Rep AccountDeclarationInfo = D1 ('MetaData "AccountDeclarationInfo" "Hledger.Data.Types" "hledger-lib-1.52.1-Hezqb1EQJRFEYYQgNd1QQB" '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.

nullpayeedeclarationinfo :: PayeeDeclarationInfo Source #

nulltagdeclarationinfo :: TagDeclarationInfo Source #

nullaccountdeclarationinfo :: AccountDeclarationInfo Source #

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

Constructors

NormallyPositive |
NormallyNegative |

#### Instances

Instances details

Show NormalSign Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> NormalSign -> ShowS Source # show :: NormalSign -> String Source # showList :: [NormalSign] -> ShowS Source #
Eq NormalSign Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: NormalSign -> NormalSign -> Bool Source # (/=) :: NormalSign -> NormalSign -> Bool Source #

type Year = Integer Source #

Year of Common Era (when positive).

# Orphan instances

ToMarkup Quantity Source # |
Instance details Methods toMarkup :: Quantity -> Markup Source # preEscapedToMarkup :: Quantity -> Markup Source #
Generic (DecimalRaw a) Source # |

Instance details

Associated Types

type Rep (DecimalRaw a) |

Instance details

Defined in Hledger.Data.Types

type Rep (DecimalRaw a) = D1 ('MetaData "DecimalRaw" "Data.Decimal" "Decimal-0.5.2-AklgH2P23aL4MD4gmNPGrt" 'False) (C1 ('MetaCons "Decimal" 'PrefixI 'True) (S1 ('MetaSel ('Just "decimalPlaces") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word8) :*: S1 ('MetaSel ('Just "decimalMantissa") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a)))

Methods

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

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