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: A 9+ digit number beginning with valid YYYYMMDD gives an error:
>>> parsewith (smartdate <* eof) "201801012" >>> 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: Big numbers not beginning with a valid YYYYMMDD are parsed as a year:
>>> parsewith (smartdate <* eof) "201813012" >>> parsewith (smartdate <* eof) "201813012"

View File

@ -105,7 +105,8 @@ import Data.Time.Calendar
import Data.Time.LocalTime import Data.Time.LocalTime
import Safe import Safe
import System.Time (getClockTime) import System.Time (getClockTime)
import Text.Megaparsec.Compat import Text.Megaparsec.Compat hiding (skipManyTill)
import Control.Applicative.Combinators (skipManyTill)
import Hledger.Data import Hledger.Data
import Hledger.Utils import Hledger.Utils

View File

@ -123,6 +123,7 @@ library
, mtl-compat , mtl-compat
, old-time , old-time
, parsec >=3 , parsec >=3
, parser-combinators
, pretty-show >=1.6.4 , pretty-show >=1.6.4
, regex-tdfa , regex-tdfa
, safe >=0.2 , safe >=0.2
@ -219,6 +220,7 @@ test-suite doctests
, mtl-compat , mtl-compat
, old-time , old-time
, parsec >=3 , parsec >=3
, parser-combinators
, pretty-show >=1.6.4 , pretty-show >=1.6.4
, regex-tdfa , regex-tdfa
, safe >=0.2 , safe >=0.2
@ -317,6 +319,7 @@ test-suite easytests
, mtl-compat , mtl-compat
, old-time , old-time
, parsec >=3 , parsec >=3
, parser-combinators
, pretty-show >=1.6.4 , pretty-show >=1.6.4
, regex-tdfa , regex-tdfa
, safe >=0.2 , safe >=0.2
@ -412,6 +415,7 @@ test-suite hunittests
, mtl-compat , mtl-compat
, old-time , old-time
, parsec >=3 , parsec >=3
, parser-combinators
, pretty-show >=1.6.4 , pretty-show >=1.6.4
, regex-tdfa , regex-tdfa
, safe >=0.2 , safe >=0.2

View File

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

View File

@ -29,7 +29,6 @@ module Hledger.Cli.Utils
where where
import Control.Exception as C import Control.Exception as C
import Control.Monad import Control.Monad
import Data.Functor.Compat ((<&>))
import Data.Hashable (hash) import Data.Hashable (hash)
import Data.List import Data.List
@ -82,10 +81,10 @@ withJournalDo opts cmd = do
-- - anonymising (--anonymise). -- - anonymising (--anonymise).
journalTransform :: CliOpts -> Journal -> IO Journal journalTransform :: CliOpts -> Journal -> IO Journal
journalTransform opts@CliOpts{reportopts_=ropts} = journalTransform opts@CliOpts{reportopts_=ropts} =
( journalAddForecast opts journalAddForecast opts
>=> journalApplyValue ropts) >=> journalApplyValue ropts
<&> (pivotByOpts opts <$>) >=> return . pivotByOpts opts
<&> (anonymiseByOpts opts <$>) >=> return . anonymiseByOpts opts
-- | Apply the pivot transformation on a journal, if option is present. -- | Apply the pivot transformation on a journal, if option is present.
pivotByOpts :: CliOpts -> Journal -> Journal pivotByOpts :: CliOpts -> Journal -> Journal

View File

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