|
1 | 1 | {-# LANGUAGE AllowAmbiguousTypes #-}
|
2 | 2 | {-# LANGUAGE ConstraintKinds #-}
|
| 3 | +{-# LANGUAGE CPP #-} |
3 | 4 | {-# LANGUAGE DataKinds #-}
|
4 | 5 | {-# LANGUAGE DeriveDataTypeable #-}
|
5 | 6 | {-# LANGUAGE FlexibleContexts #-}
|
@@ -823,7 +824,11 @@ instance (HasContextEntry context (NamedContext name subContext), HasServer subA
|
823 | 824 | -------------------------------------------------------------------------------
|
824 | 825 |
|
825 | 826 | -- Erroring instance for 'HasServer' when a combinator is not fully applied
|
826 |
| -instance TypeError (PartialApplication @(Type -> [Type] -> Constraint) 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 |
827 | 832 | where
|
828 | 833 | type ServerT (arr :> sub) _ = TypeError (PartialApplication (HasServer :: * -> [*] -> Constraint) arr)
|
829 | 834 | route = error "unreachable"
|
@@ -867,7 +872,11 @@ type HasServerArrowTypeError a b =
|
867 | 872 | -- XXX: This omits the @context@ parameter, e.g.:
|
868 | 873 | --
|
869 | 874 | -- "There is no instance for HasServer (Bool :> …)". Do we care ?
|
870 |
| -instance {-# OVERLAPPABLE #-} TypeError (NoInstanceForSub @(Type -> [Type] -> Constraint) 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 |
871 | 880 |
|
872 | 881 | instance {-# OVERLAPPABLE #-} TypeError (NoInstanceFor (HasServer api context)) => HasServer api context
|
873 | 882 |
|
|
0 commit comments