HORIZON HASKELLDocslts/ghc-10.0.x8c2f8e82026-10-19Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8c2f8e8 · 2026-10-19

Modulehledger-lib-1.52.4GHC2021

Hledger.Data

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

  • 62 types
  • 1 class
  • 22 values
datadata Account a
#

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

Instances8Functor, Eq, Show, Generic, FromJSON, ToJSON, …
datadata AccountAlias
#
Instances8Eq, Ord, Read, Show, Generic, NFData, …

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

Constructors

Instances7Eq, Show, Generic, NFData, FromJSON, ToJSON, …
datadata AccountType
#

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)

Instances8Eq, Ord, Show, Generic, NFData, ToJSON, …
datadata Amount
#

Constructors

Instances10Eq, Num, Ord, Show, Generic, NFData, …
datadata AmountCost
#

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.

Instances8Eq, Ord, Show, Generic, NFData, FromJSON, …
datadata AmountPrecision
#

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

Instances9Eq, Ord, Read, Show, Generic, NFData, …
datadata AmountStyle
#

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

Instances9Eq, Ord, Read, Show, Generic, NFData, …
datadata BalanceAssertion
#

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

Instances8Eq, Show, Generic, NFData, FromJSON, ToJSON, …
datadata BalanceData
#

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

Instances9Eq, Show, Generic, Semigroup, Monoid, FromJSON, …
datadata Commodity
#

Constructors

Instances6Eq, Show, Generic, NFData, ToJSON, Rep
datadata CostBasis
#

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

Instances8Eq, Ord, Show, Generic, NFData, FromJSON, …
datadata DateSpan
#

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

Instances8Eq, Ord, Show, Generic, NFData, ToJSON, …
typetype DecimalMark = Char
#

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

datadata DigitGroupStyle
#

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

Instances9Eq, Ord, Read, Show, Generic, NFData, …
datadata EFDay
#

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

Constructors

Instances7Eq, Ord, Show, Generic, NFData, ToJSON, …
classclass HasAmounts a where
#

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

Instances18HasAmounts, …
datadata Interval
#
Instances8Eq, Ord, Show, Generic, NFData, ToJSON, …
datadata Journal
#

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

Instances8Eq, Show, Generic, Semigroup, NFData, ToJSON, …
datadata Ledger
#

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.

Instances4Show, Generic, ToJSON, Rep
datadata MarketPrice
#

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

Constructors

Instances8Eq, Ord, Show, Generic, NFData, FromJSON, …
newtypenewtype MixedAmount
#
Instances15Eq, Num, Ord, Show, Generic, Semigroup, …
datadata NormalSign
#

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

Instances2Eq, Show
  • Eq NormalSignDefined in hledger-lib-1.52.4 · Hledger.Data.Types
  • Show NormalSignDefined in hledger-lib-1.52.4 · Hledger.Data.Types
typetype ParsedJournal = Journal
#

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

datadata PayeeDeclarationInfo
#

Extra information found in a payee directive.

Constructors

Instances6Eq, Show, Generic, NFData, ToJSON, Rep
datadata Period
#
Instances8Eq, Ord, Show, Generic, ToJSON, Default, …
datadata PeriodData a
#

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

Instances14Functor, Foldable, Traversable, Foldable1, Eq, Ord, …
datadata PeriodicTransaction
#

A periodic transaction rule, describing a transaction that recurs.

Constructors

Instances6Eq, Show, Generic, NFData, ToJSON, Rep
datadata Posting
#

Constructors

Instances9Eq, Show, Generic, NFData, FromJSON, ToJSON, …
datadata PostingType
#
Instances7Eq, Show, Generic, NFData, FromJSON, ToJSON, …
datadata PriceDirective
#

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.

Instances7Eq, Ord, Show, Generic, NFData, ToJSON, …
datadata Rounding
#

"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

Instances9Eq, Ord, Read, Show, Generic, NFData, …
datadata SepFormat
#

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

Instances3Eq, Ord, Show
  • Eq SepFormatDefined in hledger-lib-1.52.4 · Hledger.Data.Types
  • Ord SepFormatDefined in hledger-lib-1.52.4 · Hledger.Data.Types
  • Show SepFormatDefined in hledger-lib-1.52.4 · Hledger.Data.Types
datadata Side
#
Instances9Eq, Ord, Read, Show, Generic, NFData, …
  • Eq SideDefined in hledger-lib-1.52.4 · Hledger.Data.Types
  • Ord SideDefined in hledger-lib-1.52.4 · Hledger.Data.Types
  • Read SideDefined in hledger-lib-1.52.4 · Hledger.Data.Types
  • Show SideDefined in hledger-lib-1.52.4 · Hledger.Data.Types
  • Generic SideDefined in hledger-lib-1.52.4 · Hledger.Data.Types
  • NFData SideDefined in hledger-lib-1.52.4 · Hledger.Data.Types
  • FromJSON SideDefined in hledger-lib-1.52.4 · Hledger.Data.Json · orphan
  • ToJSON SideDefined in hledger-lib-1.52.4 · Hledger.Data.Json · orphan
  • type Rep Side = D1 ('MetaData "Side" "Hledger.Data.Types" "hledger-lib-1.52.4-9hXfdej3TnZFrbN8mI8ppA" 'False) (C1 ('MetaCons "L" 'PrefixI 'False) U1 :+: C1 ('MetaCons "R" 'PrefixI 'False) U1)Defined in hledger-lib-1.52.4 · Hledger.Data.Types
datadata SmartDate
#

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.

Instances1Show
  • Show SmartDateDefined in hledger-lib-1.52.4 · Hledger.Data.Types
datadata Status
#

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

Instances10Bounded, Enum, Eq, Ord, Show, Generic, …
datadata TMPostingRule
#

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.

Instances6Eq, Show, Generic, NFData, ToJSON, Rep
newtypenewtype TagDeclarationInfo
#

Extra information found in a tag directive.

Constructors

Instances6Eq, Show, Generic, NFData, ToJSON, Rep
datadata TimeclockCode
#
Instances8Eq, Ord, Read, Show, Generic, NFData, …
datadata TimeclockEntry
#
Instances7Eq, Ord, Show, Generic, NFData, ToJSON, …
datadata Transaction
#

Constructors

Instances9Eq, Show, Generic, NFData, FromJSON, ToJSON, …
datadata TransactionModifier
#

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.

Instances6Eq, Show, Generic, NFData, ToJSON, Rep
typetype Year = Integer
#

Year of Common Era (when positive).