ToJSON instances for all (?) remaining data types, up to Ledger
This commit is contained in:
parent
46d516e7a3
commit
7fa7ccc033
@ -38,6 +38,7 @@ import qualified Data.ByteString.Lazy as BL
|
|||||||
import Data.Decimal
|
import Data.Decimal
|
||||||
import Data.Maybe
|
import Data.Maybe
|
||||||
import GHC.Generics (Generic)
|
import GHC.Generics (Generic)
|
||||||
|
import System.Time (ClockTime)
|
||||||
|
|
||||||
import Hledger.Data.Types
|
import Hledger.Data.Types
|
||||||
|
|
||||||
@ -75,6 +76,20 @@ instance ToJSON Posting where
|
|||||||
]
|
]
|
||||||
|
|
||||||
instance ToJSON Transaction
|
instance ToJSON Transaction
|
||||||
|
instance ToJSON TransactionModifier
|
||||||
|
instance ToJSON PeriodicTransaction
|
||||||
|
instance ToJSON PriceDirective
|
||||||
|
instance ToJSON DateSpan
|
||||||
|
instance ToJSON Interval
|
||||||
|
instance ToJSON AccountAlias
|
||||||
|
instance ToJSON AccountType
|
||||||
|
instance ToJSONKey AccountType
|
||||||
|
instance ToJSON AccountDeclarationInfo
|
||||||
|
instance ToJSON Commodity
|
||||||
|
instance ToJSON TimeclockCode
|
||||||
|
instance ToJSON TimeclockEntry
|
||||||
|
instance ToJSON ClockTime
|
||||||
|
instance ToJSON Journal
|
||||||
|
|
||||||
instance ToJSON Account where
|
instance ToJSON Account where
|
||||||
toJSON a = object
|
toJSON a = object
|
||||||
@ -94,6 +109,9 @@ instance ToJSON Account where
|
|||||||
,"asubs" .= toJSON ([]::[Account])
|
,"asubs" .= toJSON ([]::[Account])
|
||||||
]
|
]
|
||||||
|
|
||||||
|
deriving instance Generic (Ledger)
|
||||||
|
instance ToJSON Ledger
|
||||||
|
|
||||||
-- From JSON
|
-- From JSON
|
||||||
|
|
||||||
instance FromJSON Status
|
instance FromJSON Status
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user