Add OVERLAPPING pragma to instances in ClientSpec
This commit is contained in:
parent
7529d7f776
commit
a08e644333
1 changed files with 27 additions and 9 deletions
|
@ -6,8 +6,10 @@
|
||||||
{-# LANGUAGE FunctionalDependencies #-}
|
{-# LANGUAGE FunctionalDependencies #-}
|
||||||
{-# LANGUAGE GADTs #-}
|
{-# LANGUAGE GADTs #-}
|
||||||
{-# LANGUAGE MultiParamTypeClasses #-}
|
{-# LANGUAGE MultiParamTypeClasses #-}
|
||||||
{-# LANGUAGE OverloadedStrings #-}
|
#if !MIN_VERSION_base(4,8,0)
|
||||||
{-# LANGUAGE OverlappingInstances #-}
|
{-# LANGUAGE OverlappingInstances #-}
|
||||||
|
#endif
|
||||||
|
{-# LANGUAGE OverloadedStrings #-}
|
||||||
{-# LANGUAGE PolyKinds #-}
|
{-# LANGUAGE PolyKinds #-}
|
||||||
{-# LANGUAGE RecordWildCards #-}
|
{-# LANGUAGE RecordWildCards #-}
|
||||||
{-# LANGUAGE StandaloneDeriving #-}
|
{-# LANGUAGE StandaloneDeriving #-}
|
||||||
|
@ -347,17 +349,33 @@ pathGen = fmap NonEmpty path
|
||||||
class GetNth (n :: Nat) a b | n a -> b where
|
class GetNth (n :: Nat) a b | n a -> b where
|
||||||
getNth :: Proxy n -> a -> b
|
getNth :: Proxy n -> a -> b
|
||||||
|
|
||||||
instance GetNth 0 (x :<|> y) x where
|
instance
|
||||||
getNth _ (x :<|> _) = x
|
#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
|
instance
|
||||||
getNth _ (_ :<|> x) = getNth (Proxy :: Proxy (n - 1)) x
|
#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
|
class GetLast a b | a -> b where
|
||||||
getLast :: a -> b
|
getLast :: a -> b
|
||||||
|
|
||||||
instance (GetLast b c) => GetLast (a :<|> b) c where
|
instance
|
||||||
getLast (_ :<|> b) = getLast b
|
#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
|
instance
|
||||||
getLast a = a
|
#if MIN_VERSION_base(4,8,0)
|
||||||
|
{-# OVERLAPPING #-}
|
||||||
|
#endif
|
||||||
|
GetLast a a where
|
||||||
|
getLast a = a
|
||||||
|
|
Loading…
Reference in a new issue