diff --git a/servant-server/src/Servant/Server/Internal/Config.hs b/servant-server/src/Servant/Server/Internal/Config.hs index 5c2855d8..c1681cac 100644 --- a/servant-server/src/Servant/Server/Internal/Config.hs +++ b/servant-server/src/Servant/Server/Internal/Config.hs @@ -14,9 +14,9 @@ {-# LANGUAGE PolyKinds #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} -#if !MIN_VERSION_base(4,8,0) -{-# LANGUAGE OverlappingInstances #-} -#endif + +#include "overlapping-compat.h" + module Servant.Server.Internal.Config where import Control.DeepSeq (NFData(rnf)) @@ -61,16 +61,10 @@ infixr 4 .: class HasConfigEntry (cfg :: [*]) (a :: k) (val :: *) | cfg a -> val where getConfigEntry :: proxy a -> Config cfg -> val -instance -#if MIN_VERSION_base(4,8,0) - {-# OVERLAPPABLE #-} -#endif +instance OVERLAPPABLE_ HasConfigEntry xs tag val => HasConfigEntry (notIt ': xs) tag val where getConfigEntry p (ConsConfig _ xs) = getConfigEntry p xs -instance -#if MIN_VERSION_base(4,8,0) - {-# OVERLAPPABLE #-} -#endif +instance OVERLAPPABLE_ HasConfigEntry (ConfigEntry tag val ': xs) tag val where getConfigEntry _ (ConsConfig x _) = unConfigEntry x