mirror of
https://github.com/simonmichael/hledger.git
synced 2024-11-07 21:15:19 +03:00
GHC 8.0 compatibility
This commit is contained in:
parent
458ecc9c19
commit
64c7eb78f4
@ -713,7 +713,7 @@ Right ("201813","","")
|
||||
|
||||
A 9+ digit number beginning with valid YYYYMMDD gives an error:
|
||||
>>> parsewith (smartdate <* eof) "201801012"
|
||||
Left (TrivialError (SourcePos {sourceName = "", sourceLine = Pos 1, sourceColumn = Pos 9} :| []) (Just (Tokens ('2' :| ""))) (fromList [EndOfInput]))
|
||||
Left (...)
|
||||
|
||||
Big numbers not beginning with a valid YYYYMMDD are parsed as a year:
|
||||
>>> parsewith (smartdate <* eof) "201813012"
|
||||
|
@ -105,7 +105,8 @@ import Data.Time.Calendar
|
||||
import Data.Time.LocalTime
|
||||
import Safe
|
||||
import System.Time (getClockTime)
|
||||
import Text.Megaparsec.Compat
|
||||
import Text.Megaparsec.Compat hiding (skipManyTill)
|
||||
import Control.Applicative.Combinators (skipManyTill)
|
||||
|
||||
import Hledger.Data
|
||||
import Hledger.Utils
|
||||
|
@ -123,6 +123,7 @@ library
|
||||
, mtl-compat
|
||||
, old-time
|
||||
, parsec >=3
|
||||
, parser-combinators
|
||||
, pretty-show >=1.6.4
|
||||
, regex-tdfa
|
||||
, safe >=0.2
|
||||
@ -219,6 +220,7 @@ test-suite doctests
|
||||
, mtl-compat
|
||||
, old-time
|
||||
, parsec >=3
|
||||
, parser-combinators
|
||||
, pretty-show >=1.6.4
|
||||
, regex-tdfa
|
||||
, safe >=0.2
|
||||
@ -317,6 +319,7 @@ test-suite easytests
|
||||
, mtl-compat
|
||||
, old-time
|
||||
, parsec >=3
|
||||
, parser-combinators
|
||||
, pretty-show >=1.6.4
|
||||
, regex-tdfa
|
||||
, safe >=0.2
|
||||
@ -412,6 +415,7 @@ test-suite hunittests
|
||||
, mtl-compat
|
||||
, old-time
|
||||
, parsec >=3
|
||||
, parser-combinators
|
||||
, pretty-show >=1.6.4
|
||||
, regex-tdfa
|
||||
, safe >=0.2
|
||||
|
@ -59,6 +59,7 @@ dependencies:
|
||||
- mtl-compat
|
||||
- old-time
|
||||
- parsec >=3
|
||||
- parser-combinators
|
||||
- pretty-show >=1.6.4
|
||||
- regex-tdfa
|
||||
- safe >=0.2
|
||||
|
@ -29,7 +29,6 @@ module Hledger.Cli.Utils
|
||||
where
|
||||
import Control.Exception as C
|
||||
import Control.Monad
|
||||
import Data.Functor.Compat ((<&>))
|
||||
|
||||
import Data.Hashable (hash)
|
||||
import Data.List
|
||||
@ -82,10 +81,10 @@ withJournalDo opts cmd = do
|
||||
-- - anonymising (--anonymise).
|
||||
journalTransform :: CliOpts -> Journal -> IO Journal
|
||||
journalTransform opts@CliOpts{reportopts_=ropts} =
|
||||
( journalAddForecast opts
|
||||
>=> journalApplyValue ropts)
|
||||
<&> (pivotByOpts opts <$>)
|
||||
<&> (anonymiseByOpts opts <$>)
|
||||
journalAddForecast opts
|
||||
>=> journalApplyValue ropts
|
||||
>=> return . pivotByOpts opts
|
||||
>=> return . anonymiseByOpts opts
|
||||
|
||||
-- | Apply the pivot transformation on a journal, if option is present.
|
||||
pivotByOpts :: CliOpts -> Journal -> Journal
|
||||
|
@ -10,4 +10,4 @@ packages:
|
||||
- hledger-api
|
||||
|
||||
extra-deps:
|
||||
[]
|
||||
- easytest-0.1
|
||||
|
Loading…
Reference in New Issue
Block a user