servant-server: Fix build on GHC 9.2.1

The issue is similar to the one in #1513:

```
src/Servant/Server/Internal.hs:824:10: error:
    • Uninferrable type variable k0 in
      type family equation right-hand side: (TypeError ...)
    • In the type instance declaration for ‘ServerT’
      In the instance declaration for
        ‘HasServer ((arr :: a -> b) :> sub) context’
    |
824 |     type ServerT (arr :> sub) _ = TypeError (PartialApplication HasServer arr)
    |
```

This fix is similar to the one in #1514.
This commit is contained in:
Renzo Carbonara 2022-02-04 14:34:12 +02:00
parent a8f1a7603f
commit 61d0d14b5c

View file

@ -41,7 +41,7 @@ import qualified Data.ByteString as B
import qualified Data.ByteString.Builder as BB import qualified Data.ByteString.Builder as BB
import qualified Data.ByteString.Char8 as BC8 import qualified Data.ByteString.Char8 as BC8
import qualified Data.ByteString.Lazy as BL import qualified Data.ByteString.Lazy as BL
import Data.Constraint (Dict(..)) import Data.Constraint (Constraint, Dict(..))
import Data.Either import Data.Either
(partitionEithers) (partitionEithers)
import Data.Maybe import Data.Maybe
@ -821,7 +821,7 @@ instance (HasContextEntry context (NamedContext name subContext), HasServer subA
-- Erroring instance for 'HasServer' when a combinator is not fully applied -- Erroring instance for 'HasServer' when a combinator is not fully applied
instance TypeError (PartialApplication HasServer arr) => HasServer ((arr :: a -> b) :> sub) context instance TypeError (PartialApplication HasServer arr) => HasServer ((arr :: a -> b) :> sub) context
where where
type ServerT (arr :> sub) _ = TypeError (PartialApplication HasServer arr) type ServerT (arr :> sub) _ = TypeError (PartialApplication (HasServer :: * -> [*] -> Constraint) arr)
route = error "unreachable" route = error "unreachable"
hoistServerWithContext _ _ _ _ = error "unreachable" hoistServerWithContext _ _ _ _ = error "unreachable"