GHC 8.0 compatibility

This commit is contained in:
Mykola Orliuk 2018-05-13 17:10:45 +02:00 committed by Simon Michael
parent 458ecc9c19
commit 64c7eb78f4
6 changed files with 13 additions and 8 deletions

View File

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

View File

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

View File

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

View File

@ -59,6 +59,7 @@ dependencies:
- mtl-compat
- old-time
- parsec >=3
- parser-combinators
- pretty-show >=1.6.4
- regex-tdfa
- safe >=0.2

View File

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

View File

@ -10,4 +10,4 @@ packages:
- hledger-api
extra-deps:
[]
- easytest-0.1