require data-pprint as a debugging aid and make some types compatible with it

This commit is contained in:
Simon Michael 2013-09-21 13:36:43 -07:00
parent a3900c80b2
commit 671bb6c4a2
3 changed files with 8 additions and 5 deletions

View File

@ -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

View File

@ -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

View File

@ -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