Skip to content

Commit 4cff2c2

Browse files
committed
Expanded dependency version ranges
1 parent e36005a commit 4cff2c2

File tree

4 files changed

+30
-20
lines changed

4 files changed

+30
-20
lines changed

.travis.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,21 @@
1111
# GHCVER. Omit lines with versions you don't need/want testing for.
1212
env:
1313
# - GHCVER=6.12.3
14-
# - GHCVER=7.0.1
14+
- GHCVER=7.0.1 AESONVER=0.6.0.0
1515
# - GHCVER=7.0.2
1616
# - GHCVER=7.0.3
1717
# - GHCVER=7.0.4
1818
# - GHCVER=7.2.1
1919
# - GHCVER=7.2.2
20-
- GHCVER=7.4.1 AESONVER=0.6.1.0
20+
# - GHCVER=7.4.1
2121
# - GHCVER=7.4.2
2222
# - GHCVER=7.6.1
23-
# - GHCVER=7.6.2
24-
- GHCVER=7.6.3 AESONVER=0.7.0.0
23+
- GHCVER=7.6.2 AESONVER=0.7.0.0
24+
- GHCVER=7.6.3 AESONVER=0.8.0.0
2525
# - GHCVER=7.8.1
26-
- HPVER=2013.2.0.0
27-
- HPVER=2012.4.0.0
26+
- HPVER=2014.2.0.0
27+
# - HPVER=2013.2.0.0
28+
# - HPVER=2012.4.0.0
2829
- HPVER=2012.2.0.0
2930
# - HPVER=2011.4.0.0
3031

@@ -34,6 +35,10 @@ before_install:
3435
- case "$HPVER" in
3536
"") ;;
3637

38+
"2014.2.0.0")
39+
export GHCVER=7.8.3 ;
40+
echo "constraints:async==2.0.1.5,attoparsec==0.10.4.0,case-insensitive==1.1.0.3,fgl==5.5.0.1,GLUT==2.5.1.1,GLURaw==1.4.0.1,haskell-src==1.0.1.6,hashable==1.2.2.0,html==1.0.1.2,HTTP==4000.2.10,HUnit==1.2.5.2,mtl==2.1.3.1,network==2.4.2.3,OpenGL==2.9.2.0,OpenGLRaw==1.5.0.0,parallel==3.2.0.4,parsec==3.1.5,primitive==0.5.2.1,QuickCheck==2.6,random==1.0.1.1,regex-base==0.93.2,regex-compat==0.95.1,regex-posix==0.95.2,split==0.2.2,stm==2.4.2,syb==0.4.1,text==1.1.0.0,transformers==0.3.0.0,unordered-containers==0.2.4.0,vector==0.10.9.1,xhtml==3000.2.1,zlib==0.5.4.1" > cabal.config ;;
41+
3742
"2013.2.0.0")
3843
export GHCVER=7.6.3 ;
3944
echo "constraints:async==2.0.1.4,attoparsec==0.10.4.0,case-insensitive==1.0.0.1,cgi==3001.1.7.5,fgl==5.4.2.4,GLUT==2.4.0.0,GLURaw==1.3.0.0,haskell-src==1.0.1.5,hashable==1.1.2.5,html==1.0.1.2,HTTP==4000.2.8,HUnit==1.2.5.2,mtl==2.1.2,network==2.4.1.2,OpenGL==2.8.0.0,OpenGLRaw==1.3.0.0,parallel==3.2.0.3,parsec==3.1.3,QuickCheck==2.6,random==1.0.1.1,regex-base==0.93.2,regex-compat==0.95.1,regex-posix==0.95.2,split==0.2.2,stm==2.4.2,syb==0.4.0,text==0.11.3.1,transformers==0.3.0.0,unordered-containers==0.2.3.0,vector==0.10.0.1,xhtml==3000.2.1,zlib==0.5.4.1" > cabal.config ;;
@@ -61,6 +66,10 @@ before_install:
6166
echo "constraints:aeson=="$AESONVER >> cabal.config;
6267
fi
6368

69+
if [ "$AESONVER" = "0.6.0.0" ]; then
70+
echo "constraints:attoparsec==0.8.6.1,blaze-builder==0.2.1.4,bytestring==0.9.1.8,happstack-server==6.2.4,hashable==1.1.2.0,mtl==1.1.1.0,network==2.3.0.1,test-framework-hunit==0.3.0,text==0.11.1.1,unordered-containers==0.1.3.0,vector==0.7.1,zlib==0.5.2.0" >> cabal.config;
71+
fi
72+
6473
if [[ $HPVER == 2012.* ]]; then
6574
echo "constraints:happstack-server==7.3.0" >> cabal.config;
6675
fi

json-rpc-server.cabal

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ flag demo
3030
library
3131
exposed-modules: Network.JsonRpc.Server
3232
other-modules: Network.JsonRpc.Types
33-
build-depends: base >=4.5 && <4.7,
34-
aeson >=0.6 && <0.8,
33+
build-depends: base >=4.3 && <4.8,
34+
aeson >=0.6 && <0.9,
3535
bytestring >=0.9 && <0.11,
36-
mtl >=2.1 && <2.2,
36+
mtl >=1.1.1 && <2.3,
3737
text >=0.11 && <1.2,
38-
vector >=0.8 && <0.11,
38+
vector >=0.7.1 && <0.11,
3939
unordered-containers >=0.1 && <0.3
4040
hs-source-dirs: src
4141
ghc-options: -Wall
@@ -44,10 +44,10 @@ executable demo
4444
main-is: Demo.hs
4545
hs-source-dirs: demo
4646
if flag (demo)
47-
build-depends: base >=4.5 && <4.7,
47+
build-depends: base >=4.3 && <4.8,
4848
json-rpc-server,
49-
mtl >=2.1 && <2.2,
50-
happstack-server >=7.3 && <7.4
49+
mtl >=1.1.1 && <2.3,
50+
happstack-server >=6.2.4 && <7.4
5151
ghc-options: -Wall
5252
else
5353
buildable: False
@@ -57,15 +57,15 @@ test-suite tests
5757
main-is: TestSuite.hs
5858
other-modules: TestParallelism, Internal
5959
type: exitcode-stdio-1.0
60-
build-depends: base >=4.5 && <4.7,
60+
build-depends: base >=4.3 && <4.8,
6161
json-rpc-server,
6262
HUnit >=1.2 && <1.3,
6363
test-framework >=0.7 && <0.9,
6464
test-framework-hunit >=0.3 && <0.4,
65-
aeson >=0.6 && <0.8,
65+
aeson >=0.6 && <0.9,
6666
bytestring >=0.9 && <0.11,
67-
mtl >=2.1 && <2.2,
67+
mtl >=1.1.1 && <2.3,
6868
text >=0.11 && <1.2,
69-
vector >=0.8 && <0.11,
69+
vector >=0.7.1 && <0.11,
7070
unordered-containers >=0.1 && <0.3
7171
ghc-options: -Wall

src/Network/JsonRpc/Types.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
FlexibleInstances,
44
UndecidableInstances,
55
TypeOperators,
6+
TypeSynonymInstances,
67
OverloadedStrings #-}
78

89
module Network.JsonRpc.Types ( RpcResult
@@ -27,7 +28,7 @@ import Data.Aeson.Types (emptyObject)
2728
import qualified Data.Vector as V
2829
import qualified Data.HashMap.Strict as H
2930
import Control.Applicative ((<$>), (<*>), (<|>), (*>), empty)
30-
import Control.Monad (when)
31+
import Control.Monad (mplus, when)
3132
import Control.Monad.Error (Error, ErrorT, throwError, strMsg, noMsg)
3233
import Prelude hiding (length)
3334

@@ -61,7 +62,7 @@ instance (Monad m, Functor m, A.ToJSON r) => MethodParams (RpcResult m r) () m r
6162
instance (A.FromJSON a, MethodParams f p m r) => MethodParams (a -> f) (a :+: p) m r where
6263
apply f (param :+: ps) args = arg >>= \a -> apply (f a) ps nextArgs
6364
where arg = either (parseArg name) return =<<
64-
(Left <$> lookupValue <|> Right <$> paramDefault param)
65+
(Left <$> lookupValue) `mplus` (Right <$> paramDefault param)
6566
lookupValue = either (lookupArg name) (headArg name) args
6667
nextArgs = tailOrEmpty <$> args
6768
name = paramName param

tests/TestSuite.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,5 +184,5 @@ removeErrMsg :: A.Value -> A.Value
184184
removeErrMsg (A.Object rsp) = A.Object $ H.adjust removeMsg "error" rsp
185185
where removeMsg (A.Object err) = A.Object $ H.insert "message" "" $ H.delete "data" err
186186
removeMsg v = v
187-
removeErrMsg (A.Array rsps) = A.Array $ removeErrMsg <$> rsps
187+
removeErrMsg (A.Array rsps) = A.Array $ removeErrMsg `V.map` rsps
188188
removeErrMsg v = v

0 commit comments

Comments
 (0)