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

Hledger.Data.Json

Synopsis

Instances

Utilities

toJsonText :: ToJSON a => a -> Text Source #

Show a JSON-convertible haskell value as pretty-printed JSON text.

writeJsonFile :: ToJSON a => FilePath -> a -> IO () Source #

Write a JSON-convertible haskell value to a pretty-printed JSON file. Eg: writeJsonFile "a.json" nulltransaction

readJsonFile :: FromJSON a => FilePath -> IO a Source #

Read a JSON file and decode it to the target type, or raise an error if we can't. Eg: readJsonFile "a.json" :: IO Transaction

Orphan instances

Generic Ledger Source # 
Instance details

Associated Types

type Rep Ledger :: Type -> Type

Methods

from :: Ledger -> Rep Ledger x

to :: Rep Ledger x -> Ledger

FromJSON Account Source # 
Instance details

Methods

parseJSON :: Value -> Parser Account

parseJSONList :: Value -> Parser [Account]

FromJSON AccountDeclarationInfo Source # 
Instance details

Methods

parseJSON :: Value -> Parser AccountDeclarationInfo

parseJSONList :: Value -> Parser [AccountDeclarationInfo]

FromJSON MarketPrice Source # 
Instance details

Methods

parseJSON :: Value -> Parser MarketPrice

parseJSONList :: Value -> Parser [MarketPrice]

FromJSON Transaction Source # 
Instance details

Methods

parseJSON :: Value -> Parser Transaction

parseJSONList :: Value -> Parser [Transaction]

FromJSON GenericSourcePos Source # 
Instance details

Methods

parseJSON :: Value -> Parser GenericSourcePos

parseJSONList :: Value -> Parser [GenericSourcePos]

FromJSON Posting Source # 
Instance details

Methods

parseJSON :: Value -> Parser Posting

parseJSONList :: Value -> Parser [Posting]

FromJSON BalanceAssertion Source # 
Instance details

Methods

parseJSON :: Value -> Parser BalanceAssertion

parseJSONList :: Value -> Parser [BalanceAssertion]

FromJSON Status Source # 
Instance details

Methods

parseJSON :: Value -> Parser Status

parseJSONList :: Value -> Parser [Status]

FromJSON PostingType Source # 
Instance details

Methods

parseJSON :: Value -> Parser PostingType

parseJSONList :: Value -> Parser [PostingType]

FromJSON MixedAmount Source # 
Instance details

Methods

parseJSON :: Value -> Parser MixedAmount

parseJSONList :: Value -> Parser [MixedAmount]

FromJSON Amount Source # 
Instance details

Methods

parseJSON :: Value -> Parser Amount

parseJSONList :: Value -> Parser [Amount]

FromJSON DigitGroupStyle Source # 
Instance details

Methods

parseJSON :: Value -> Parser DigitGroupStyle

parseJSONList :: Value -> Parser [DigitGroupStyle]

FromJSON AmountStyle Source # 
Instance details

Methods

parseJSON :: Value -> Parser AmountStyle

parseJSONList :: Value -> Parser [AmountStyle]

FromJSON AmountPrice Source # 
Instance details

Methods

parseJSON :: Value -> Parser AmountPrice

parseJSONList :: Value -> Parser [AmountPrice]

FromJSON Side Source # 
Instance details

Methods

parseJSON :: Value -> Parser Side

parseJSONList :: Value -> Parser [Side]

ToJSON Decimal Source # 
Instance details

Methods

toJSON :: Decimal -> Value

toEncoding :: Decimal -> Encoding

toJSONList :: [Decimal] -> Value

toEncodingList :: [Decimal] -> Encoding

ToJSON ClockTime Source # 
Instance details

Methods

toJSON :: ClockTime -> Value

toEncoding :: ClockTime -> Encoding

toJSONList :: [ClockTime] -> Value

toEncodingList :: [ClockTime] -> Encoding

ToJSON Ledger Source # 
Instance details

Methods

toJSON :: Ledger -> Value

toEncoding :: Ledger -> Encoding

toJSONList :: [Ledger] -> Value

toEncodingList :: [Ledger] -> Encoding

ToJSON Account Source # 
Instance details

Methods

toJSON :: Account -> Value

toEncoding :: Account -> Encoding

toJSONList :: [Account] -> Value

toEncodingList :: [Account] -> Encoding

ToJSON AccountDeclarationInfo Source # 
Instance details

ToJSON Journal Source # 
Instance details

Methods

toJSON :: Journal -> Value

toEncoding :: Journal -> Encoding

toJSONList :: [Journal] -> Value

toEncodingList :: [Journal] -> Encoding

ToJSON MarketPrice Source # 
Instance details

Methods

toJSON :: MarketPrice -> Value

toEncoding :: MarketPrice -> Encoding

toJSONList :: [MarketPrice] -> Value

toEncodingList :: [MarketPrice] -> Encoding

ToJSON PriceDirective Source # 
Instance details

Methods

toJSON :: PriceDirective -> Value

toEncoding :: PriceDirective -> Encoding

toJSONList :: [PriceDirective] -> Value

toEncodingList :: [PriceDirective] -> Encoding

ToJSON TimeclockEntry Source # 
Instance details

Methods

toJSON :: TimeclockEntry -> Value

toEncoding :: TimeclockEntry -> Encoding

toJSONList :: [TimeclockEntry] -> Value

toEncodingList :: [TimeclockEntry] -> Encoding

ToJSON TimeclockCode Source # 
Instance details

Methods

toJSON :: TimeclockCode -> Value

toEncoding :: TimeclockCode -> Encoding

toJSONList :: [TimeclockCode] -> Value

toEncodingList :: [TimeclockCode] -> Encoding

ToJSON PeriodicTransaction Source # 
Instance details

ToJSON TransactionModifier Source # 
Instance details

ToJSON Transaction Source # 
Instance details

Methods

toJSON :: Transaction -> Value

toEncoding :: Transaction -> Encoding

toJSONList :: [Transaction] -> Value

toEncodingList :: [Transaction] -> Encoding

ToJSON GenericSourcePos Source # 
Instance details

ToJSON Posting Source # 
Instance details

Methods

toJSON :: Posting -> Value

toEncoding :: Posting -> Encoding

toJSONList :: [Posting] -> Value

toEncodingList :: [Posting] -> Encoding

ToJSON BalanceAssertion Source # 
Instance details

ToJSON Status Source # 
Instance details

Methods

toJSON :: Status -> Value

toEncoding :: Status -> Encoding

toJSONList :: [Status] -> Value

toEncodingList :: [Status] -> Encoding

ToJSON PostingType Source # 
Instance details

Methods

toJSON :: PostingType -> Value

toEncoding :: PostingType -> Encoding

toJSONList :: [PostingType] -> Value

toEncodingList :: [PostingType] -> Encoding

ToJSON MixedAmount Source # 
Instance details

Methods

toJSON :: MixedAmount -> Value

toEncoding :: MixedAmount -> Encoding

toJSONList :: [MixedAmount] -> Value

toEncodingList :: [MixedAmount] -> Encoding

ToJSON Amount Source # 
Instance details

Methods

toJSON :: Amount -> Value

toEncoding :: Amount -> Encoding

toJSONList :: [Amount] -> Value

toEncodingList :: [Amount] -> Encoding

ToJSON Commodity Source # 
Instance details

Methods

toJSON :: Commodity -> Value

toEncoding :: Commodity -> Encoding

toJSONList :: [Commodity] -> Value

toEncodingList :: [Commodity] -> Encoding

ToJSON DigitGroupStyle Source # 
Instance details

Methods

toJSON :: DigitGroupStyle -> Value

toEncoding :: DigitGroupStyle -> Encoding

toJSONList :: [DigitGroupStyle] -> Value

toEncodingList :: [DigitGroupStyle] -> Encoding

ToJSON AmountStyle Source # 
Instance details

Methods

toJSON :: AmountStyle -> Value

toEncoding :: AmountStyle -> Encoding

toJSONList :: [AmountStyle] -> Value

toEncodingList :: [AmountStyle] -> Encoding

ToJSON AmountPrice Source # 
Instance details

Methods

toJSON :: AmountPrice -> Value

toEncoding :: AmountPrice -> Encoding

toJSONList :: [AmountPrice] -> Value

toEncodingList :: [AmountPrice] -> Encoding

ToJSON Side Source # 
Instance details

Methods

toJSON :: Side -> Value

toEncoding :: Side -> Encoding

toJSONList :: [Side] -> Value

toEncodingList :: [Side] -> Encoding

ToJSON AccountAlias Source # 
Instance details

Methods

toJSON :: AccountAlias -> Value

toEncoding :: AccountAlias -> Encoding

toJSONList :: [AccountAlias] -> Value

toEncodingList :: [AccountAlias] -> Encoding

ToJSON AccountType Source # 
Instance details

Methods

toJSON :: AccountType -> Value

toEncoding :: AccountType -> Encoding

toJSONList :: [AccountType] -> Value

toEncodingList :: [AccountType] -> Encoding

ToJSON Interval Source # 
Instance details

Methods

toJSON :: Interval -> Value

toEncoding :: Interval -> Encoding

toJSONList :: [Interval] -> Value

toEncodingList :: [Interval] -> Encoding

ToJSON DateSpan Source # 
Instance details

Methods

toJSON :: DateSpan -> Value

toEncoding :: DateSpan -> Encoding

toJSONList :: [DateSpan] -> Value

toEncodingList :: [DateSpan] -> Encoding

ToJSONKey AccountType Source # 
Instance details

Methods

toJSONKey :: ToJSONKeyFunction AccountType

toJSONKeyList :: ToJSONKeyFunction [AccountType]

Generic (DecimalRaw a) Source # 
Instance details

Associated Types

type Rep (DecimalRaw a) :: Type -> Type

Methods

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

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

FromJSON (DecimalRaw Integer) Source # 
Instance details

Methods

parseJSON :: Value -> Parser (DecimalRaw Integer)

parseJSONList :: Value -> Parser [DecimalRaw Integer]