From 8bc05387786944869eb6e0f1dfcbd012f7346dcf Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Thu, 27 Oct 2016 07:19:26 -0700 Subject: [PATCH] allow megaparsec 5.0 or 5.1 for stackage compatibility --- hledger-lib/Hledger/Utils/Debug.hs | 10 ++++++---- hledger-lib/hledger-lib.cabal | 6 +++--- hledger-lib/package.yaml | 2 +- hledger-ui/hledger-ui.cabal | 2 +- hledger-ui/package.yaml | 2 +- hledger-web/hledger-web.cabal | 2 +- hledger-web/package.yaml | 2 +- hledger/hledger.cabal | 2 +- hledger/package.yaml | 2 +- 9 files changed, 16 insertions(+), 14 deletions(-) diff --git a/hledger-lib/Hledger/Utils/Debug.hs b/hledger-lib/Hledger/Utils/Debug.hs index 2ac21bcc4..13be45e87 100644 --- a/hledger-lib/Hledger/Utils/Debug.hs +++ b/hledger-lib/Hledger/Utils/Debug.hs @@ -81,9 +81,11 @@ debugLevel = case snd $ break (=="--debug") args of args = unsafePerformIO getArgs -- | Convenience aliases for tracePrettyAt. --- Pretty-print a message and the showable value to the console, then return it. -dbg :: Show a => String -> a -> a -dbg = tracePrettyAt 0 + +-- Always pretty-print a message and the showable value to the console, then return it. +-- ("dbg" without the 0 clashes with megaparsec 5.1). +dbg0 :: Show a => String -> a -> a +dbg0 = tracePrettyAt 0 -- | Pretty-print a message and the showable value to the console when the debug level is >= 1, then return it. Uses unsafePerformIO. dbg1 :: Show a => String -> a -> a @@ -212,7 +214,7 @@ dbgppshow level -- | Like dbg, then exit the program. Uses unsafePerformIO. dbgExit :: Show a => String -> a -> a -dbgExit msg = const (unsafePerformIO exitFailure) . dbg msg +dbgExit msg = const (unsafePerformIO exitFailure) . dbg0 msg -- | Print a message and parsec debug info (parse position and next -- input) to the console when the debug level is at or above diff --git a/hledger-lib/hledger-lib.cabal b/hledger-lib/hledger-lib.cabal index 773a1d7b1..c8e9582da 100644 --- a/hledger-lib/hledger-lib.cabal +++ b/hledger-lib/hledger-lib.cabal @@ -68,7 +68,7 @@ library , deepseq , directory , filepath - , megaparsec >=5 && < 5.1 + , megaparsec >=5.0 && < 5.2 , mtl , mtl-compat , old-time @@ -158,7 +158,7 @@ test-suite doctests , deepseq , directory , filepath - , megaparsec >=5 && < 5.1 + , megaparsec >=5.0 && < 5.2 , mtl , mtl-compat , old-time @@ -198,7 +198,7 @@ test-suite hunittests , deepseq , directory , filepath - , megaparsec >=5 && < 5.1 + , megaparsec >=5.0 && < 5.2 , mtl , mtl-compat , old-time diff --git a/hledger-lib/package.yaml b/hledger-lib/package.yaml index 5e26de51b..72cf32c0b 100644 --- a/hledger-lib/package.yaml +++ b/hledger-lib/package.yaml @@ -52,7 +52,7 @@ dependencies: - deepseq - directory - filepath -- megaparsec >=5 && < 5.1 +- megaparsec >=5.0 && < 5.2 - mtl - mtl-compat - old-time diff --git a/hledger-ui/hledger-ui.cabal b/hledger-ui/hledger-ui.cabal index a045a105e..2a52b4871 100644 --- a/hledger-ui/hledger-ui.cabal +++ b/hledger-ui/hledger-ui.cabal @@ -69,7 +69,7 @@ executable hledger-ui , HUnit , microlens >= 0.4 && < 0.5 , microlens-platform >= 0.2.3.1 && < 0.4 - , megaparsec >= 5 + , megaparsec >=5.0 && < 5.2 , pretty-show >=1.6.4 , process >= 1.2 , safe >= 0.2 diff --git a/hledger-ui/package.yaml b/hledger-ui/package.yaml index 4b5a1ae5b..0e4d368a2 100644 --- a/hledger-ui/package.yaml +++ b/hledger-ui/package.yaml @@ -60,7 +60,7 @@ executables: - HUnit - microlens >= 0.4 && < 0.5 - microlens-platform >= 0.2.3.1 && < 0.4 - - megaparsec >= 5 + - megaparsec >=5.0 && < 5.2 - pretty-show >=1.6.4 - process >= 1.2 - safe >= 0.2 diff --git a/hledger-web/hledger-web.cabal b/hledger-web/hledger-web.cabal index 1d84b9ab2..164af60cc 100644 --- a/hledger-web/hledger-web.cabal +++ b/hledger-web/hledger-web.cabal @@ -159,7 +159,7 @@ library , yesod-form , yesod-static , json - , megaparsec >=5 && < 5.1 + , megaparsec >=5.0 && < 5.2 , mtl if (flag(dev)) || (flag(library-only)) cpp-options: -DDEVELOPMENT diff --git a/hledger-web/package.yaml b/hledger-web/package.yaml index 001f34453..75e407771 100644 --- a/hledger-web/package.yaml +++ b/hledger-web/package.yaml @@ -119,7 +119,7 @@ library: - Settings.Development - Settings.StaticFiles dependencies: - - megaparsec >=5 && < 5.1 + - megaparsec >=5.0 && < 5.2 - mtl when: - condition: (flag(dev)) || (flag(library-only)) diff --git a/hledger/hledger.cabal b/hledger/hledger.cabal index 81419d10a..e75b0206a 100644 --- a/hledger/hledger.cabal +++ b/hledger/hledger.cabal @@ -104,7 +104,7 @@ library , mtl , mtl-compat , old-time - , megaparsec >=5 && < 5.1 + , megaparsec >=5.0 && < 5.2 , regex-tdfa , safe >=0.2 , split >=0.1 && <0.3 diff --git a/hledger/package.yaml b/hledger/package.yaml index 120c6b8c6..3d4d819cb 100644 --- a/hledger/package.yaml +++ b/hledger/package.yaml @@ -117,7 +117,7 @@ library: - mtl - mtl-compat - old-time - - megaparsec >=5 && < 5.1 + - megaparsec >=5.0 && < 5.2 - regex-tdfa - safe >=0.2 - split >=0.1 && <0.3