GHC 7.10 support

This commit is contained in:
Nikita Volkov 2015-03-30 08:06:08 +03:00
parent b478390c00
commit 7482cf2c55
5 changed files with 44 additions and 25 deletions

View File

@ -1,20 +1,22 @@
env:
- lower_bound_dependencies=1
ghc=7.6.1
- lower_bound_dependencies=1
ghc=7.8.1
- ghc=7.6.1
- ghc=7.8.1
- ghc=7.6.1 cabal=1.18 benchmarks=1 tests=1 lower_bound_dependencies=1
- ghc=7.6.1 cabal=1.18 benchmarks=1 tests=1
- ghc=7.8.1 cabal=1.18 benchmarks=1 tests=1
- ghc=7.10.1 cabal=1.22
- ghc=7.10.1 cabal=1.22 benchmarks=1 tests=1
install:
# Set up the Shell to treat the semicolon as &&
- set -o pipefail && set -e
# Install GHC and Cabal
-
-
ghc=${ghc=7.10.1};
cabal=${cabal=1.22};
travis_retry sudo add-apt-repository -y ppa:hvr/ghc;
travis_retry sudo apt-get update;
travis_retry sudo apt-get install cabal-install-1.18 ghc-$ghc;
export PATH=/opt/ghc/$ghc/bin:/opt/cabal/1.18/bin:$PATH;
travis_retry sudo apt-get install cabal-install-$cabal ghc-$ghc;
export PATH=/opt/ghc/$ghc/bin:/opt/cabal/$cabal/bin:$PATH;
# Update the Cabal database
- cabal update
# Switch to the distro:
@ -26,7 +28,7 @@ install:
cd $pkg_name;
# Install the lower bound dependencies
-
if [ $lower_bound_dependencies -eq 1 ];
if [ "$lower_bound_dependencies" = "1" ];
then
constraint_options=(
"--constraint=transformers==0.3.*"
@ -37,15 +39,24 @@ install:
);
fi;
# Install the "haskell-src-exts" implicit dependency
- cabal install -j ${constraint_options[@]} happy
- cabal install happy --reorder-goals --force-reinstalls ${constraint_options[@]}
# Install the library dependencies
- cabal install -j ${constraint_options[@]} --only-dependencies
- cabal install --only-dependencies --reorder-goals --force-reinstalls
${constraint_options[@]}
$([ "$tests" = "1" ] && echo "--enable-tests")
$([ "$benchmarks" = "1" ] && echo "--enable-benchmarks")
# Build the library
- cabal build
# Install the remaining dependencies
- cabal install -j --only-dependencies --enable-tests --enable-benchmarks --force-reinstalls
# Configure and build the remaining stuff
- cabal configure --enable-tests --enable-benchmarks && cabal build
- cabal configure
$([ "$tests" = "1" ] && echo "--enable-tests")
$([ "$benchmarks" = "1" ] && echo "--enable-benchmarks")
-f doctest
- cabal build
script:
- cabal test --show-details=always
- |
if [ "$tests" = "1" ];
then
cabal test --show-details=always;
fi;

View File

@ -1,3 +1,6 @@
# 0.7.3
* GHC 7.10 support
# 0.7.2
* Implement support for free variables by the quasi-quoter

View File

@ -1,7 +1,7 @@
name:
hasql
version:
0.7.2
0.7.3
synopsis:
A minimalistic general high level API for relational databases
description:
@ -99,7 +99,7 @@ library
resource-pool == 0.2.*,
hasql-backend == 0.4.*,
--
template-haskell >= 2.8 && < 2.10,
template-haskell >= 2.8 && < 2.11,
--
attoparsec >= 0.10 && < 0.13,
--
@ -114,7 +114,7 @@ library
transformers-base == 0.4.*,
transformers >= 0.3 && < 0.5,
base-prelude >= 0.1.3 && < 0.2,
base >= 4.5 && < 4.8
base >= 4.6 && < 4.9
test-suite hspec
@ -142,8 +142,7 @@ test-suite hspec
vector,
--
mtl-prelude < 3,
base-prelude,
base
base-prelude
test-suite hspec-postgres
@ -175,8 +174,7 @@ test-suite hspec-postgres
monad-control,
either,
mtl-prelude < 3,
base-prelude,
base
base-prelude
-- Well, it's not a benchmark actually,
@ -200,6 +198,6 @@ benchmark demo
hasql,
hasql-postgres == 0.10.*,
transformers >= 0.3 && < 0.5,
base >= 4.5 && < 4.8
base

View File

@ -33,7 +33,7 @@ return $ flip map [2 .. 24] $ \arity ->
connectionType =
VarT (mkName "c")
constraints =
map (\t -> ClassP ''Bknd.CxValue [connectionType, t]) varTypes
map (\t -> THUtil.classP ''Bknd.CxValue [connectionType, t]) varTypes
head =
AppT (AppT (ConT ''CxRow) connectionType) (foldl AppT (TupleT arity) varTypes)
parseRowDec =

View File

@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
-- |
-- TH utils.
module Hasql.TH where
@ -71,3 +72,9 @@ vectorE cellExps =
(VarE 'Vector.unsafeFreeze)
(VarE vectorVarName)))
classP :: Name -> [Type] -> Pred
#if MIN_VERSION_template_haskell(2,10,0)
classP n tl = foldl AppT (ConT n) tl
#else
classP = ClassP
#endif