hledger-lib 0.22.1 → 0.22.2
raw patch · 5 files changed
+49/−30 lines, 5 filesdep −data-pprint
Dependencies removed: data-pprint
Files
- CHANGES +7/−0
- Hledger/Data/Dates.hs +2/−2
- Hledger/Data/FormatStrings.hs +3/−3
- Hledger/Utils.hs +24/−16
- hledger-lib.cabal +13/−9
+ CHANGES view
@@ -0,0 +1,7 @@+0.22.2 (2014/4/16)++- display years before 1000 with four digits, not three+- avoid pretty-show to build with GHC < 7.4+- allow text 1.1, drop data-pprint to build with GHC 7.8.x++0.22.1 (2014/1/6) and older: see http://hledger.org/release-notes or doc/CHANGES.md.
Hledger/Data/Dates.hs view
@@ -77,9 +77,8 @@ import Hledger.Data.Types import Hledger.Utils - showDate :: Day -> String-showDate = formatTime defaultTimeLocale "%C%y/%m/%d"+showDate = formatTime defaultTimeLocale "%0C%y/%m/%d" showDateSpan (DateSpan from to) = concat@@ -727,6 +726,7 @@ ,"fixSmartDateStr" ~: do let gives = is . fixSmartDateStr (parsedate "2008/11/26")+ "0000-01-01" `gives` "0000/01/01" "1999-12-02" `gives` "1999/12/02" "1999.12.02" `gives` "1999/12/02" "1999/3/2" `gives` "1999/03/02"
Hledger/Data/FormatStrings.hs view
@@ -67,13 +67,13 @@ c = (satisfy isPrintableButNotPercentage <?> "printable character") <|> try (string "%%" >> return '%') -formatString :: GenParser Char st FormatString-formatString =+formatStr :: GenParser Char st FormatString+formatStr = formatField <|> formatLiteral formatStrings :: GenParser Char st [FormatString]-formatStrings = many formatString+formatStrings = many formatStr testFormat :: FormatString -> String -> String -> Assertion testFormat fs value expected = assertEqual name expected actual
Hledger/Utils.hs view
@@ -21,10 +21,12 @@ ---- all of this one: module Hledger.Utils, Debug.Trace.trace,- module Data.PPrint,+ -- module Data.PPrint, -- module Hledger.Utils.UTF8IOCompat SystemString,fromSystemString,toSystemString,error',userError',+#if __GLASGOW_HASKELL__ >= 704 ppShow+#endif -- the rest need to be done in each module I think ) where@@ -32,11 +34,10 @@ import Control.Monad.Error (MonadIO) import Control.Monad.IO.Class (liftIO) import Data.Char-import Data.Data import Data.List import qualified Data.Map as M import Data.Maybe-import Data.PPrint+-- import Data.PPrint import Data.Time.Clock import Data.Time.LocalTime import Data.Tree@@ -53,13 +54,20 @@ import Text.Printf import Text.Regex.TDFA import Text.RegexPR-import Text.Show.Pretty -- import qualified Data.Map as Map -- -- import Prelude hiding (readFile,writeFile,appendFile,getContents,putStr,putStrLn) -- import Hledger.Utils.UTF8IOCompat (readFile,writeFile,appendFile,getContents,putStr,putStrLn) import Hledger.Utils.UTF8IOCompat (SystemString,fromSystemString,toSystemString,error',userError') +#if __GLASGOW_HASKELL__ >= 704+import Text.Show.Pretty (ppShow)+#else+-- the required pretty-show version requires GHC >= 7.4+ppShow :: Show a => a -> String+ppShow = show+#endif+ -- strings lowercase = map toLower@@ -418,18 +426,18 @@ | debugLevel >= level = \s -> traceWith (((s++": ")++) . ppShow) | otherwise = flip const --- | Print a showable value to the console, with a message, if the--- debug level is at or above the specified level (uses--- unsafePerformIO).--- Values are displayed with pprint. Field names are not shown, but the--- output is compact with smart line wrapping, long data elided,--- and slow calculations timed out.-dbgpprint :: Data a => Int -> String -> a -> a-dbgpprint level msg a- | debugLevel >= level = unsafePerformIO $ do- pprint a >>= putStrLn . ((msg++": \n") ++) . show- return a- | otherwise = a+-- -- | Print a showable value to the console, with a message, if the+-- -- debug level is at or above the specified level (uses+-- -- unsafePerformIO).+-- -- Values are displayed with pprint. Field names are not shown, but the+-- -- output is compact with smart line wrapping, long data elided,+-- -- and slow calculations timed out.+-- dbgpprint :: Data a => Int -> String -> a -> a+-- dbgpprint level msg a+-- | debugLevel >= level = unsafePerformIO $ do+-- pprint a >>= putStrLn . ((msg++": \n") ++) . show+-- return a+-- | otherwise = a -- | Like dbg, then exit the program. Uses unsafePerformIO.
hledger-lib.cabal view
@@ -1,5 +1,5 @@ name: hledger-lib-version: 0.22.1+version: 0.22.2 stability: beta category: Finance synopsis: Core data types, parsers and utilities for the hledger accounting tool.@@ -17,13 +17,15 @@ maintainer: Simon Michael <simon@joyful.com> homepage: http://hledger.org bug-reports: http://hledger.org/bugs-tested-with: GHC==7.4.2, GHC==7.6.3+tested-with: GHC==7.2.2, GHC==7.4.2, GHC==7.6.3, GHC==7.8 cabal-version: >= 1.10 build-type: Simple -- data-dir: data -- data-files: -- extra-tmp-files:-extra-source-files: tests/suite.hs+extra-source-files: + tests/suite.hs+ CHANGES -- README -- sample.ledger -- sample.timelog@@ -31,6 +33,7 @@ library -- should set patchlevel here as in Makefile cpp-options: -DPATCHLEVEL=0+ default-language: Haskell2010 exposed-modules: Hledger Hledger.Data@@ -60,14 +63,13 @@ ,cmdargs >= 0.10 && < 0.11 ,containers ,csv- ,data-pprint >= 0.2.3 && < 0.3+ -- ,data-pprint >= 0.2.3 && < 0.3 ,directory ,filepath ,mtl ,old-locale ,old-time ,parsec- ,pretty-show >= 1.6.4 ,regex-tdfa ,regexpr >= 0.5.1 ,safe >= 0.2@@ -76,7 +78,8 @@ ,transformers >= 0.2 && < 0.4 ,utf8-string >= 0.3.5 && < 0.4 ,HUnit- default-language: Haskell2010+ if impl(ghc >= 7.4)+ build-depends: pretty-show >= 1.6.4 source-repository head type: git@@ -86,12 +89,13 @@ type: exitcode-stdio-1.0 main-is: tests/suite.hs ghc-options: -Wall+ default-language: Haskell2010 build-depends: hledger-lib , base >= 4.3 && < 5 , cmdargs , containers , csv- , data-pprint >= 0.2.3 && < 0.3+ -- , data-pprint >= 0.2.3 && < 0.3 , directory , filepath , HUnit@@ -99,7 +103,6 @@ , old-locale , old-time , parsec- , pretty-show >= 1.6.4 , regex-tdfa , regexpr , safe@@ -108,7 +111,8 @@ , test-framework-hunit , time , transformers- default-language: Haskell2010+ if impl(ghc >= 7.4)+ build-depends: pretty-show >= 1.6.4 -- cf http://www.haskell.org/cabal/release/cabal-latest/doc/users-guide/authors.html