@@ -1,5 +1,6 @@
11{-# LANGUAGE AllowAmbiguousTypes #-}
22{-# LANGUAGE ConstraintKinds #-}
3+{-# LANGUAGE CPP #-}
34{-# LANGUAGE DataKinds #-}
45{-# LANGUAGE DeriveDataTypeable #-}
56{-# LANGUAGE FlexibleContexts #-}
@@ -94,6 +95,8 @@ import Servant.API.TypeErrors
9495import Web.HttpApiData
9596 (FromHttpApiData, parseHeader, parseQueryParam, parseUrlPiece,
9697 parseUrlPieces)
98+import Data.Kind
99+ (Type)
97100
98101import Servant.Server.Internal.BasicAuth
99102import Servant.Server.Internal.Context
@@ -821,7 +824,11 @@ instance (HasContextEntry context (NamedContext name subContext), HasServer subA
821824-------------------------------------------------------------------------------
822825
823826-- Erroring instance for 'HasServer' when a combinator is not fully applied
824−instance TypeError (PartialApplication HasServer arr) => HasServer ((arr :: a -> b) :> sub) context
827+instance TypeError (PartialApplication
828+#if __GLASGOW_HASKELL__ >= 904
829+ @(Type -> [Type] -> Constraint)
830+#endif
831+ HasServer arr) => HasServer ((arr :: a -> b) :> sub) context
825832 where
826833 type ServerT (arr :> sub) _ = TypeError (PartialApplication (HasServer :: * -> [*] -> Constraint) arr)
827834 route = error "unreachable"
@@ -865,7 +872,11 @@ type HasServerArrowTypeError a b =
865872-- XXX: This omits the @context@ parameter, e.g.:
866873--
867874-- "There is no instance for HasServer (Bool :> …)". Do we care ?
868−instance {-# OVERLAPPABLE #-} TypeError (NoInstanceForSub HasServer ty) => HasServer (ty :> sub) context
875+instance {-# OVERLAPPABLE #-} TypeError (NoInstanceForSub
876+#if __GLASGOW_HASKELL__ >= 904
877+ @(Type -> [Type] -> Constraint)
878+#endif
879+ HasServer ty) => HasServer (ty :> sub) context
869880
870881instance {-# OVERLAPPABLE #-} TypeError (NoInstanceFor (HasServer api context)) => HasServer api context
871882