@@ -6,8 +6,10 @@
66{-# LANGUAGE FunctionalDependencies #-}
77{-# LANGUAGE GADTs #-}
88{-# LANGUAGE MultiParamTypeClasses #-}
9−{-# LANGUAGE OverloadedStrings #-}
9+#if !MIN_VERSION_base(4,8,0)
1010{-# LANGUAGE OverlappingInstances #-}
11+#endif
12+{-# LANGUAGE OverloadedStrings #-}
1113{-# LANGUAGE PolyKinds #-}
1214{-# LANGUAGE RecordWildCards #-}
1315{-# LANGUAGE StandaloneDeriving #-}
@@ -347,17 +349,33 @@ pathGen = fmap NonEmpty path
347349class GetNth (n :: Nat) a b | n a -> b where
348350 getNth :: Proxy n -> a -> b
349351
350−instance GetNth 0 (x :<|> y) x where
351− getNth _ (x :<|> _) = x
352+instance
353+#if MIN_VERSION_base(4,8,0)
354+ {-# OVERLAPPING #-}
355+#endif
356+ GetNth 0 (x :<|> y) x where
357+ getNth _ (x :<|> _) = x
352358
353−instance (GetNth (n - 1) x y) => GetNth n (a :<|> x) y where
354− getNth _ (_ :<|> x) = getNth (Proxy :: Proxy (n - 1)) x
359+instance
360+#if MIN_VERSION_base(4,8,0)
361+ {-# OVERLAPPING #-}
362+#endif
363+ (GetNth (n - 1) x y) => GetNth n (a :<|> x) y where
364+ getNth _ (_ :<|> x) = getNth (Proxy :: Proxy (n - 1)) x
355365
356366class GetLast a b | a -> b where
357367 getLast :: a -> b
358368
359−instance (GetLast b c) => GetLast (a :<|> b) c where
360− getLast (_ :<|> b) = getLast b
369+instance
370+#if MIN_VERSION_base(4,8,0)
371+ {-# OVERLAPPING #-}
372+#endif
373+ (GetLast b c) => GetLast (a :<|> b) c where
374+ getLast (_ :<|> b) = getLast b
361375
362−instance GetLast a a where
363− getLast a = a
376+instance
377+#if MIN_VERSION_base(4,8,0)
378+ {-# OVERLAPPING #-}
379+#endif
380+ GetLast a a where
381+ getLast a = a