From 671bb6c4a254ad98f387266486a792150b0115dc Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Sat, 21 Sep 2013 13:36:43 -0700 Subject: [PATCH] require data-pprint as a debugging aid and make some types compatible with it --- hledger-lib/Hledger/Data/Types.hs | 6 +++--- hledger-lib/Hledger/Reports.hs | 4 ++-- hledger/hledger.cabal | 3 +++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/hledger-lib/Hledger/Data/Types.hs b/hledger-lib/Hledger/Data/Types.hs index 9f046c8f0..b2404b466 100644 --- a/hledger-lib/Hledger/Data/Types.hs +++ b/hledger-lib/Hledger/Data/Types.hs @@ -20,10 +20,10 @@ For more detailed documentation on each type, see the corresponding modules. module Hledger.Data.Types where import Control.Monad.Error (ErrorT) +import Data.Data import qualified Data.Map as M import Data.Time.Calendar import Data.Time.LocalTime -import Data.Typeable import System.Time (ClockTime) @@ -31,13 +31,13 @@ type SmartDate = (String,String,String) data WhichDate = PrimaryDate | SecondaryDate deriving (Eq,Show) -data DateSpan = DateSpan (Maybe Day) (Maybe Day) deriving (Eq,Show,Ord) +data DateSpan = DateSpan (Maybe Day) (Maybe Day) deriving (Eq,Show,Ord,Data,Typeable) data Interval = NoInterval | Days Int | Weeks Int | Months Int | Quarters Int | Years Int | DayOfMonth Int | DayOfWeek Int -- WeekOfYear Int | MonthOfYear Int | QuarterOfYear Int - deriving (Eq,Show,Ord) + deriving (Eq,Show,Ord,Data,Typeable) type AccountName = String diff --git a/hledger-lib/Hledger/Reports.hs b/hledger-lib/Hledger/Reports.hs index a1ee7f619..b56a8b6ea 100644 --- a/hledger-lib/Hledger/Reports.hs +++ b/hledger-lib/Hledger/Reports.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE RecordWildCards, DeriveDataTypeable #-} {-| Generate several common kinds of report from a journal, as \"*Report\" - @@ -99,7 +99,7 @@ data ReportOpts = ReportOpts { ,related_ :: Bool ,average_ :: Bool ,query_ :: String -- all arguments, as a string - } deriving (Show) + } deriving (Show, Data, Typeable) type DisplayExp = String type FormatStr = String diff --git a/hledger/hledger.cabal b/hledger/hledger.cabal index a55c4fcf5..6f33f84f4 100644 --- a/hledger/hledger.cabal +++ b/hledger/hledger.cabal @@ -67,6 +67,7 @@ library -- ,cabal-file-th ,containers ,cmdargs >= 0.10 && < 0.11 + ,data-pprint >= 0.2.2 && < 0.3 ,directory ,filepath ,haskeline >= 0.6 && <= 0.8 @@ -121,6 +122,7 @@ executable hledger ,base >= 4.3 && < 5 ,containers ,cmdargs >= 0.10 && < 0.11 + ,data-pprint >= 0.2.2 && < 0.3 ,directory ,filepath ,haskeline >= 0.6 && <= 0.8 @@ -149,6 +151,7 @@ test-suite tests , cmdargs , containers , csv + , data-pprint >= 0.2.2 && < 0.3 , directory , filepath , haskeline