Skip to content

Commit

Permalink
Support as far back as GHC 7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
gwils committed Feb 20, 2018
1 parent 59380b6 commit 51ddac0
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 17 deletions.
11 changes: 10 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ before_cache:

matrix:
include:
- compiler: "ghc-7.4.2"
# env: TEST=--disable-tests BENCH=--disable-benchmarks
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.4.2], sources: [hvr-ghc]}}
- compiler: "ghc-7.6.3"
# env: TEST=--disable-tests BENCH=--disable-benchmarks
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.6.3], sources: [hvr-ghc]}}
- compiler: "ghc-7.8.4"
# env: TEST=--disable-tests BENCH=--disable-benchmarks
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.8.4], sources: [hvr-ghc]}}
- compiler: "ghc-7.10.3"
# env: TEST=--disable-tests BENCH=--disable-benchmarks
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.10.3], sources: [hvr-ghc]}}
Expand Down Expand Up @@ -89,7 +98,7 @@ install:
- rm -f cabal.project.freeze
- cabal new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 all
- cabal new-build -w ${HC} --disable-tests --disable-benchmarks --project-file="cabal.project" --dep -j2 all
- rm -rf "."/.ghc.environment.* "."/dist
- rm -rf .ghc.environment.* "."/dist
- DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)

# Here starts the actual work to be performed for the package under test;
Expand Down
9 changes: 1 addition & 8 deletions src/Data/Text1.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import Data.Binary(Binary(put, get))
import Data.Char(Char)
import Data.Data(Data)
import Data.Eq(Eq)
import Data.Foldable(Foldable(toList))
import Data.Foldable(toList)
import Data.Functor(Functor(fmap))
import Data.Int(Int)
import Data.List as List(null)
Expand All @@ -50,8 +50,6 @@ import Prelude(Show(show), Num((+), (-)))
-- >>> import Data.Char
-- >>> import qualified Data.Text as Text
-- >>> import Prelude
-- >>> import Test.QuickCheck
-- >>> instance Arbitrary Text1 where arbitrary = do c <- arbitrary; t <- arbitrary; return (Text1 c (Text.pack t))

data Text1 =
Text1
Expand All @@ -63,9 +61,6 @@ instance Show Text1 where
show (Text1 h t) =
show (Text.cons h t)

-- |
--
-- prop> ((x <> y) <> z) == (x <> (y <> z :: Text1))
instance Semigroup Text1 where
Text1 h1 t1 <> t =
Text1 h1 (Text.append t1 (_Text1 # t))
Expand All @@ -86,7 +81,6 @@ instance Binary Text1 where
-- >>> fmap length1 ("abc" ^? _Text1)
-- Just 3
--
-- prop> length1 t >= 1
length1 ::
Text1
-> Int
Expand All @@ -110,7 +104,6 @@ length1 (Text1 _ t) =
-- >>> fmap (`compareLength1` 5) ("abc" ^? _Text1)
-- Just LT
--
-- prop> compareLength1 t 1 /= LT
compareLength1 ::
Text1
-> Int
Expand Down
19 changes: 11 additions & 8 deletions text1.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ cabal-version: >= 1.10
build-type: Custom
extra-source-files: changelog.md
Warning.hs
tested-with: GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.1
tested-with: GHC == 7.4.2
, GHC == 7.6.3
, GHC == 7.8.4
, GHC == 7.10.3
, GHC == 8.0.2
, GHC == 8.2.2
, GHC == 8.4.1

source-repository head
type: git
Expand All @@ -34,11 +40,11 @@ library
Haskell2010

build-depends:
base >= 4.8 && < 4.11
base >= 4.5 && < 4.11
, semigroups >= 0.8 && < 1
, text >= 1.2 && < 2
, lens >= 4.0 && < 5
, binary >= 0.7 && < 1
, binary >= 0.5 && < 1

ghc-options:
-Wall
Expand All @@ -64,11 +70,8 @@ test-suite doctests

build-depends:
base < 5 && >= 3
, doctest >= 0.9.7
, filepath >= 1.3
, directory >= 1.1
, QuickCheck >= 2.0
, template-haskell >= 2.8
, doctest >= 0.9.7 && < 0.15
, text1

ghc-options:
-Wall
Expand Down

0 comments on commit 51ddac0

Please sign in to comment.