From e5c5602a97160a6a6304a24947e33e47c9155460 Mon Sep 17 00:00:00 2001 From: Sean Chalmers Date: Mon, 4 Feb 2019 11:05:02 +1000 Subject: [PATCH] Fix type errors, try to maintain backwards compat. generics-sop >= 0.4 will only build with GHC >8, I'm not sure how important that constraint is to this package but I've tried to preserve with some CPP guards to use the correct constraints. --- test/URI/ByteString/Arbitrary.hs | 19 ++++++++++++++++++- uri-bytestring.cabal | 4 ++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/test/URI/ByteString/Arbitrary.hs b/test/URI/ByteString/Arbitrary.hs index 8147255..68a0ca8 100644 --- a/test/URI/ByteString/Arbitrary.hs +++ b/test/URI/ByteString/Arbitrary.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} @@ -11,7 +12,10 @@ module URI.ByteString.Arbitrary where import Control.Applicative import Data.Proxy (Proxy (..)) import qualified Generics.SOP as SOP +#if MIN_VERSION_generics_sop(0,4,0) +#else import qualified Generics.SOP.Constraint as SOP +#endif import qualified Generics.SOP.GGP as SOP import GHC.Generics (Generic) import Test.QuickCheck @@ -29,15 +33,28 @@ sopArbitrary :: ( SOP.SListI (SOP.GCode b) , Generic b , SOP.GTo b +#if MIN_VERSION_generics_sop(0,4,0) + , SOP.All SOP.SListI (SOP.GCode b) + , SOP.All (SOP.All Arbitrary) (SOP.GCode b) +#else , SOP.AllF SOP.SListI (SOP.GCode b) , SOP.AllF (SOP.All Arbitrary) (SOP.GCode b) +#endif ) => Gen b sopArbitrary = fmap SOP.gto sopArbitrary' sopArbitrary' - :: (SOP.SListI xs, SOP.AllF (SOP.All Arbitrary) xs, SOP.AllF SOP.SListI xs) + :: ( SOP.SListI xs +#if MIN_VERSION_generics_sop(0,4,0) + , SOP.All SOP.SListI xs + , SOP.All (SOP.All Arbitrary) xs +#else + , SOP.AllF SOP.SListI xs + , SOP.AllF (SOP.All Arbitrary) xs +#endif + ) => Gen (SOP.SOP SOP.I xs) sopArbitrary' = oneof (map SOP.hsequence $ SOP.apInjs_POP $ SOP.hcpure p arbitrary) where diff --git a/uri-bytestring.cabal b/uri-bytestring.cabal index 8adce7f..f30f818 100644 --- a/uri-bytestring.cabal +++ b/uri-bytestring.cabal @@ -1,5 +1,5 @@ name: uri-bytestring -version: 0.3.2.1 +version: 0.3.2.2 synopsis: Haskell URI parsing as ByteStrings description: uri-bytestring aims to be an RFC3986 compliant URI parser that uses efficient ByteStrings for parsing and representing the URI data. license: BSD3 @@ -89,7 +89,7 @@ test-suite test , semigroups , transformers , containers - , generics-sop >= 0.2 + , generics-sop >= 0.3 && < 0.5 default-language: Haskell2010 if flag(lib-Werror)