diff --git a/hledger-lib/Hledger/Data/Types.hs b/hledger-lib/Hledger/Data/Types.hs index 224355c21..19e4d4e07 100644 --- a/hledger-lib/Hledger/Data/Types.hs +++ b/hledger-lib/Hledger/Data/Types.hs @@ -464,7 +464,9 @@ data PriceGraph = PriceGraph { -- but those have to be Real for shortest path finding, -- so we'd have to transform them all first. } - deriving (Show) + deriving (Show,Generic) + +instance NFData PriceGraph -- | What kind of value conversion should be done on amounts ? -- UI: --value=cost|end|now|DATE[,COMM] diff --git a/hledger-lib/Hledger/Reports/MultiBalanceReport.hs b/hledger-lib/Hledger/Reports/MultiBalanceReport.hs index 432fa69ce..06e55502f 100644 --- a/hledger-lib/Hledger/Reports/MultiBalanceReport.hs +++ b/hledger-lib/Hledger/Reports/MultiBalanceReport.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE FlexibleInstances, RecordWildCards, ScopedTypeVariables, OverloadedStrings #-} +{-# LANGUAGE FlexibleInstances, RecordWildCards, ScopedTypeVariables, OverloadedStrings, DeriveGeneric #-} {-| Multi-column balance reports, used by the balance command. @@ -20,6 +20,8 @@ module Hledger.Reports.MultiBalanceReport ( ) where +import GHC.Generics (Generic) +import Control.DeepSeq (NFData) import Data.List import Data.Maybe import Data.Ord @@ -69,9 +71,13 @@ newtype MultiBalanceReport = ,[MultiBalanceReportRow] ,MultiBalanceReportTotals ) + deriving (Generic) + type MultiBalanceReportRow = (AccountName, AccountName, Int, [MixedAmount], MixedAmount, MixedAmount) type MultiBalanceReportTotals = ([MixedAmount], MixedAmount, MixedAmount) -- (Totals list, sum of totals, average of totals) +instance NFData MultiBalanceReport + instance Show MultiBalanceReport where -- use pshow (pretty-show's ppShow) to break long lists onto multiple lines -- we add some bogus extra shows here to help it parse the output