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:
|
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"
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -10,4 +10,4 @@ packages:
|
|||||||
- hledger-api
|
- hledger-api
|
||||||
|
|
||||||
extra-deps:
|
extra-deps:
|
||||||
[]
|
- easytest-0.1
|
||||||
|
Loading…
Reference in New Issue
Block a user