diff --git a/servant-client/test/Servant/ClientSpec.hs b/servant-client/test/Servant/ClientSpec.hs index 4ea5cacf..344f42ef 100644 --- a/servant-client/test/Servant/ClientSpec.hs +++ b/servant-client/test/Servant/ClientSpec.hs @@ -6,8 +6,10 @@ {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE MultiParamTypeClasses #-} -{-# LANGUAGE OverloadedStrings #-} +#if !MIN_VERSION_base(4,8,0) {-# LANGUAGE OverlappingInstances #-} +#endif +{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StandaloneDeriving #-} @@ -347,17 +349,33 @@ pathGen = fmap NonEmpty path class GetNth (n :: Nat) a b | n a -> b where getNth :: Proxy n -> a -> b -instance GetNth 0 (x :<|> y) x where - getNth _ (x :<|> _) = x +instance +#if MIN_VERSION_base(4,8,0) + {-# OVERLAPPING #-} +#endif + GetNth 0 (x :<|> y) x where + getNth _ (x :<|> _) = x -instance (GetNth (n - 1) x y) => GetNth n (a :<|> x) y where - getNth _ (_ :<|> x) = getNth (Proxy :: Proxy (n - 1)) x +instance +#if MIN_VERSION_base(4,8,0) + {-# OVERLAPPING #-} +#endif + (GetNth (n - 1) x y) => GetNth n (a :<|> x) y where + getNth _ (_ :<|> x) = getNth (Proxy :: Proxy (n - 1)) x class GetLast a b | a -> b where getLast :: a -> b -instance (GetLast b c) => GetLast (a :<|> b) c where - getLast (_ :<|> b) = getLast b +instance +#if MIN_VERSION_base(4,8,0) + {-# OVERLAPPING #-} +#endif + (GetLast b c) => GetLast (a :<|> b) c where + getLast (_ :<|> b) = getLast b -instance GetLast a a where - getLast a = a +instance +#if MIN_VERSION_base(4,8,0) + {-# OVERLAPPING #-} +#endif + GetLast a a where + getLast a = a