From 1ae5fa451f4f554e0d652d55f9312a585188ce13 Mon Sep 17 00:00:00 2001 From: Simon Peyton Jones Date: Thu, 31 Jul 2014 15:49:14 +0100 Subject: Complete work on new OVERLAPPABLE/OVERLAPPING pragmas (Trac #9242) * Deprecate -XOverlappingInstances * Update test suite. Several tests even had entirely unnecessary uses of -XOverlappingInstances * Update user manual with a careful description of the instance resolution story * Fix an outright bug in the handling of duplidate instances in GHCi, which are meant to silently overwrite the earlier duplicate. The logic was right for family instances but was both more complicated, and plain wrong, for class instances. (If you are interested, the bug was that we were eliminating the duplicate from the InstEnv, but not from the [ClsInst] held in tcg_insts.) Test is ghci044a. --- testsuite/tests/generics/Uniplate/GUniplate.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'testsuite/tests/generics') diff --git a/testsuite/tests/generics/Uniplate/GUniplate.hs b/testsuite/tests/generics/Uniplate/GUniplate.hs index 76f387d636..99b0b405a8 100644 --- a/testsuite/tests/generics/Uniplate/GUniplate.hs +++ b/testsuite/tests/generics/Uniplate/GUniplate.hs @@ -4,7 +4,8 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE DefaultSignatures #-} -{-# LANGUAGE IncoherentInstances #-} -- necessary, unfortunately +{- # LANGUAGE IncoherentInstances #-} -- necessary, unfortunately +{-# LANGUAGE OverlappingInstances #-} module GUniplate where @@ -20,7 +21,8 @@ class Uniplate' f b where instance Uniplate' U1 a where children' U1 = [] -instance Uniplate' (K1 i a) a where +instance {-# OVERLAPPING #-} Uniplate' (K1 i a) a where + -- overlaps the (Uniplate' (K1 i a) b) instance children' (K1 a) = [a] instance Uniplate' (K1 i a) b where -- cgit v1.2.1