hledger-web-1.14.1: Web interface for the hledger accounting tool

Safe HaskellNone
LanguageHaskell2010

Hledger.Web.Json

Contents

Synopsis

Instances

Utilities

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

Read a json from a file and decode/parse it as the target type, if we can. Example: >>> readJsonFile "in.json" :: IO MixedAmount

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

Write some to-JSON-convertible haskell value to a json file, if we can. Example: >>> writeJsonFile "out.json" nullmixedamt

Orphan instances

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

Methods

parseJSON :: Value -> Parser Amount #

parseJSONList :: Value -> Parser [Amount] #

FromJSON AmountStyle Source # 
Instance details

Methods

parseJSON :: Value -> Parser AmountStyle #

parseJSONList :: Value -> Parser [AmountStyle] #

FromJSON BalanceAssertion Source # 
Instance details

Methods

parseJSON :: Value -> Parser BalanceAssertion #

parseJSONList :: Value -> Parser [BalanceAssertion] #

FromJSON DigitGroupStyle Source # 
Instance details

Methods

parseJSON :: Value -> Parser DigitGroupStyle #

parseJSONList :: Value -> Parser [DigitGroupStyle] #

FromJSON GenericSourcePos Source # 
Instance details

Methods

parseJSON :: Value -> Parser GenericSourcePos #

parseJSONList :: Value -> Parser [GenericSourcePos] #

FromJSON MarketPrice Source # 
Instance details

Methods

parseJSON :: Value -> Parser MarketPrice #

parseJSONList :: Value -> Parser [MarketPrice] #

FromJSON MixedAmount Source # 
Instance details

Methods

parseJSON :: Value -> Parser MixedAmount #

parseJSONList :: Value -> Parser [MixedAmount] #

FromJSON Posting Source # 
Instance details

Methods

parseJSON :: Value -> Parser Posting #

parseJSONList :: Value -> Parser [Posting] #

FromJSON PostingType Source # 
Instance details

Methods

parseJSON :: Value -> Parser PostingType #

parseJSONList :: Value -> Parser [PostingType] #

FromJSON Price Source # 
Instance details

Methods

parseJSON :: Value -> Parser Price #

parseJSONList :: Value -> Parser [Price] #

FromJSON Side Source # 
Instance details

Methods

parseJSON :: Value -> Parser Side #

parseJSONList :: Value -> Parser [Side] #

FromJSON Status Source # 
Instance details

Methods

parseJSON :: Value -> Parser Status #

parseJSONList :: Value -> Parser [Status] #

FromJSON Transaction Source # 
Instance details

Methods

parseJSON :: Value -> Parser Transaction #

parseJSONList :: Value -> Parser [Transaction] #

ToJSON Decimal Source # 
Instance details

Methods

toJSON :: Decimal -> Value #

toEncoding :: Decimal -> Encoding #

toJSONList :: [Decimal] -> Value #

toEncodingList :: [Decimal] -> Encoding #

ToJSON Account Source # 
Instance details

Methods

toJSON :: Account -> Value #

toEncoding :: Account -> Encoding #

toJSONList :: [Account] -> Value #

toEncodingList :: [Account] -> Encoding #

ToJSON Amount Source # 
Instance details

Methods

toJSON :: Amount -> Value #

toEncoding :: Amount -> Encoding #

toJSONList :: [Amount] -> Value #

toEncodingList :: [Amount] -> Encoding #

ToJSON AmountStyle Source # 
Instance details

Methods

toJSON :: AmountStyle -> Value #

toEncoding :: AmountStyle -> Encoding #

toJSONList :: [AmountStyle] -> Value #

toEncodingList :: [AmountStyle] -> Encoding #

ToJSON BalanceAssertion Source # 
Instance details

Methods

toJSON :: BalanceAssertion -> Value #

toEncoding :: BalanceAssertion -> Encoding #

toJSONList :: [BalanceAssertion] -> Value #

toEncodingList :: [BalanceAssertion] -> Encoding #

ToJSON DigitGroupStyle Source # 
Instance details

Methods

toJSON :: DigitGroupStyle -> Value #

toEncoding :: DigitGroupStyle -> Encoding #

toJSONList :: [DigitGroupStyle] -> Value #

toEncodingList :: [DigitGroupStyle] -> Encoding #

ToJSON GenericSourcePos Source # 
Instance details

Methods

toJSON :: GenericSourcePos -> Value #

toEncoding :: GenericSourcePos -> Encoding #

toJSONList :: [GenericSourcePos] -> Value #

toEncodingList :: [GenericSourcePos] -> Encoding #

ToJSON MarketPrice Source # 
Instance details

Methods

toJSON :: MarketPrice -> Value #

toEncoding :: MarketPrice -> Encoding #

toJSONList :: [MarketPrice] -> Value #

toEncodingList :: [MarketPrice] -> Encoding #

ToJSON MixedAmount Source # 
Instance details

Methods

toJSON :: MixedAmount -> Value #

toEncoding :: MixedAmount -> Encoding #

toJSONList :: [MixedAmount] -> Value #

toEncodingList :: [MixedAmount] -> Encoding #

ToJSON Posting Source # 
Instance details

Methods

toJSON :: Posting -> Value #

toEncoding :: Posting -> Encoding #

toJSONList :: [Posting] -> Value #

toEncodingList :: [Posting] -> Encoding #

ToJSON PostingType Source # 
Instance details

Methods

toJSON :: PostingType -> Value #

toEncoding :: PostingType -> Encoding #

toJSONList :: [PostingType] -> Value #

toEncodingList :: [PostingType] -> Encoding #

ToJSON Price Source # 
Instance details

Methods

toJSON :: Price -> Value #

toEncoding :: Price -> Encoding #

toJSONList :: [Price] -> Value #

toEncodingList :: [Price] -> Encoding #

ToJSON Side Source # 
Instance details

Methods

toJSON :: Side -> Value #

toEncoding :: Side -> Encoding #

toJSONList :: [Side] -> Value #

toEncodingList :: [Side] -> Encoding #

ToJSON Status Source # 
Instance details

Methods

toJSON :: Status -> Value #

toEncoding :: Status -> Encoding #

toJSONList :: [Status] -> Value #

toEncodingList :: [Status] -> Encoding #

ToJSON Transaction Source # 
Instance details

Methods

toJSON :: Transaction -> Value #

toEncoding :: Transaction -> Encoding #

toJSONList :: [Transaction] -> Value #

toEncodingList :: [Transaction] -> Encoding #

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