Skip to content

Commit a2e8653

Browse files
Support template-haskell and tests on GHC < 8.8 (#56)
We can effortlessly support GHC 8.0+ instead of GHC 8.8+ for both building and testing, so let's do that. GHC's before 8.8 (base-4.13) don't export `MonadFail` to Prelude. Relax the bounds on `template-haskell` to support GHC 8.0+ Tighten the bounds on `containers` and `ansi-terminal` to exclude unsupported versions. Drop bounds specification in the test suite for dependencies shared with the library; the library already constrains these dependencies and it reduces maintenance burden.
1 parent bdc4c67 commit a2e8653

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

System/Console/Docopt/Public.hs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
{-# LANGUAGE CPP #-}
2+
13
module System.Console.Docopt.Public
24
(
35
-- * Command line arguments parsers
@@ -42,6 +44,10 @@ module System.Console.Docopt.Public
4244

4345
import System.Exit
4446

47+
#if !MIN_VERSION_base(4,13,0)
48+
import Control.Monad.Fail (MonadFail)
49+
#endif
50+
4551
import Data.Map as M hiding (null)
4652
import Data.Maybe (fromMaybe)
4753
import System.Console.Docopt.Types

docopt.cabal

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ library
4545

4646
build-depends: base >= 4.9 && < 5.0,
4747
parsec >= 3.1.14 && < 3.2,
48-
containers >= 0.6.2 && < 0.7
48+
containers >= 0.6.2 && < 0.6.6
4949

5050
ghc-options: -Wall
5151
-fno-warn-unused-binds
@@ -57,7 +57,7 @@ library
5757
exposed-modules: System.Console.Docopt
5858
other-modules: System.Console.Docopt.QQ
5959
System.Console.Docopt.QQ.Instances
60-
build-depends: template-haskell >= 2.15.0 && < 2.18
60+
build-depends: template-haskell >= 2.11.0 && < 2.18
6161

6262
default-language: Haskell2010
6363

@@ -74,17 +74,16 @@ test-suite tests
7474
-fno-warn-orphans
7575

7676
build-depends: base,
77-
parsec >= 3.1.14 && < 3.2,
78-
containers >= 0.6.2 && < 0.7,
77+
parsec,
78+
containers,
7979
docopt,
8080
HUnit,
8181
split,
82-
ansi-terminal,
82+
ansi-terminal >= 0.4,
8383
aeson,
8484
bytestring,
8585
text,
86-
template-haskell >= 2.15.0 && < 2.18
87-
86+
template-haskell >= 2.11.0 && < 2.18
8887

8988
other-modules: System.Console.Docopt
9089
System.Console.Docopt.ApplicativeParsec

0 commit comments

Comments
 (0)