diff --git a/.travis.yml b/.travis.yml index 5f3e4ef..6c51b2f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,27 +1,20 @@ -language: c +language: haskell sudo: false +git: + depth: 5 + +cache: + directories: + - "$HOME/.cabal/store" + matrix: include: - - env: CABALVER=1.16 GHCVER=7.6.3 - addons: {apt: {packages: [cabal-install-1.16,ghc-7.6.3], sources: [hvr-ghc]}} - - env: CABALVER=1.18 GHCVER=7.8.4 - addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4], sources: [hvr-ghc]}} - - env: CABALVER=1.22 GHCVER=7.10.3 RUN_TESTS=--run-tests - addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3],sources: [hvr-ghc]}} - - env: CABALVER=1.24 GHCVER=8.0.1 RUN_TESTS=--run-tests - addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.1],sources: [hvr-ghc]}} - - env: CABALVER=head GHCVER=head RUN_TESTS=--run-tests - addons: {apt: {packages: [cabal-install-head,ghc-head], sources: [hvr-ghc]}} - - allow_failures: - - env: CABALVER=1.16 GHCVER=7.6.3 # weird spec problems - - env: CABALVER=1.18 GHCVER=7.8.4 # weird spec problems - - env: CABALVER=head GHCVER=head RUN_TESTS=--run-tests - -before_install: - - export PATH=$HOME/.cabal/bin:/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH + - ghc: 8.0.1 + - ghc: 8.2.2 + - ghc: 8.4.4 + - ghc: 8.6.5 install: - cabal update diff --git a/ldap-client.cabal b/ldap-client.cabal index 5b18942..6b69457 100644 --- a/ldap-client.cabal +++ b/ldap-client.cabal @@ -13,10 +13,10 @@ category: Network build-type: Simple cabal-version: >= 1.10 tested-with: - GHC == 7.6.3 - , GHC == 7.8.4 - , GHC == 7.10.1 - , GHC == 8.0.1 + GHC == 8.0.1 + , GHC == 8.2.2 + , GHC == 8.4.4 + , GHC == 8.6.5 extra-source-files: README.markdown CHANGELOG.markdown @@ -57,6 +57,7 @@ library , bytestring , connection >= 0.2 , containers + , fail , network >= 2.6 , semigroups >= 0.16 , stm diff --git a/src/Ldap/Asn1/FromAsn1.hs b/src/Ldap/Asn1/FromAsn1.hs index 74d53fc..4acef2f 100644 --- a/src/Ldap/Asn1/FromAsn1.hs +++ b/src/Ldap/Asn1/FromAsn1.hs @@ -11,6 +11,9 @@ import Control.Applicative (Alternative(..), liftA2, optional) import Control.Applicative (Applicative(..), Alternative(..), liftA2, optional) #endif import Control.Monad (MonadPlus(..), (>=>), guard) +#if __GLASGOW_HASKELL__ >= 86 +import Control.Monad.Fail (MonadFail, fail) +#endif import Data.ASN1.Types (ASN1) import qualified Data.ASN1.Types as Asn1 import Data.Foldable (asum) @@ -416,6 +419,11 @@ instance MonadPlus (Parser s) where Parser ma `mplus` Parser mb = Parser (\s -> ma s `mplus` mb s) +#if __GLASGOW_HASKELL__ >= 86 +instance MonadFail (Parser s) where + fail _ = mzero +#endif + parse :: Parser s a -> s -> Maybe (s, a) parse = unParser diff --git a/src/Ldap/Client/Internal.hs b/src/Ldap/Client/Internal.hs index ead4e93..3d298df 100644 --- a/src/Ldap/Client/Internal.hs +++ b/src/Ldap/Client/Internal.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE NamedFieldPuns #-} module Ldap.Client.Internal @@ -35,7 +36,11 @@ import Data.ByteString (ByteString) import Data.List.NonEmpty (NonEmpty) import Data.Text (Text) import Data.Typeable (Typeable) +#if __GLASGOW_HASKELL__ >= 84 +import Network.Socket (PortNumber) +#else import Network (PortNumber) +#endif import Network.Connection (TLSSettings) import qualified Ldap.Asn1.Type as Type