diff options
author | Ben Gamari <ben@smart-cactus.org> | 2021-01-25 10:22:29 -0500 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-01-27 17:39:49 -0500 |
commit | 5d6009a88156ad42b387383e41a7e0707c7f06a4 (patch) | |
tree | d2384dfb0328e4b6f31fc886e2b1732cfd31f157 | |
parent | 93ae0e2a95ff57b587d673aa8946ee710012b37e (diff) | |
download | haskell-5d6009a88156ad42b387383e41a7e0707c7f06a4.tar.gz |
Add instances for GHC.Tuple.Solo
The `Applicative` instance is the most important one (for
array/vector/sequence indexing purposes), but it deserves
all the usual ones.
T12545 does silly 1% wibbles both ways, it seems, maybe depending
on architecture.
Metric Increase:
T12545
Metric Decrease:
T12545
28 files changed, 125 insertions, 22 deletions
diff --git a/libraries/base/Control/Monad/Fix.hs b/libraries/base/Control/Monad/Fix.hs index 96133777be..b54ee66531 100644 --- a/libraries/base/Control/Monad/Fix.hs +++ b/libraries/base/Control/Monad/Fix.hs @@ -33,6 +33,7 @@ import Data.Ord ( Down(..) ) import GHC.Base ( Monad, NonEmpty(..), errorWithoutStackTrace, (.) ) import GHC.Generics import GHC.List ( head, tail ) +import GHC.Tuple (Solo (..)) import Control.Monad.ST.Imp import System.IO @@ -63,6 +64,11 @@ class (Monad m) => MonadFix m where -- Instances of MonadFix for Prelude monads +-- | @since 4.15 +instance MonadFix Solo where + mfix f = let a = f (unSolo a) in a + where unSolo (Solo x) = x + -- | @since 2.01 instance MonadFix Maybe where mfix f = let a = f (unJust a) in a diff --git a/libraries/base/Control/Monad/Zip.hs b/libraries/base/Control/Monad/Zip.hs index dc192bfc81..36ebeb9985 100644 --- a/libraries/base/Control/Monad/Zip.hs +++ b/libraries/base/Control/Monad/Zip.hs @@ -25,6 +25,7 @@ import Data.Ord ( Down(..) ) import Data.Proxy import qualified Data.List.NonEmpty as NE import GHC.Generics +import GHC.Tuple (Solo (..)) -- | Instances should satisfy the laws: -- @@ -71,6 +72,11 @@ instance MonadZip Identity where mzipWith = liftM2 munzip (Identity (a, b)) = (Identity a, Identity b) +-- | @since 4.15.0.0 +instance MonadZip Solo where + mzipWith = liftM2 + munzip (Solo (a, b)) = (Solo a, Solo b) + -- | @since 4.8.0.0 instance MonadZip Dual where -- Cannot use coerce, it's unsafe diff --git a/libraries/base/Data/Data.hs b/libraries/base/Data/Data.hs index 0d4ef944a1..d3a51aa720 100644 --- a/libraries/base/Data/Data.hs +++ b/libraries/base/Data/Data.hs @@ -129,6 +129,7 @@ import GHC.List import GHC.Num import GHC.Read import GHC.Show +import GHC.Tuple (Solo (..)) import Text.Read( reads ) -- Imports for the instances @@ -1191,6 +1192,9 @@ deriving instance (Data a, Data b) => Data (Either a b) -- | @since 4.0.0.0 deriving instance Data () +-- | @since 4.15 +deriving instance Data a => Data (Solo a) + -- | @since 4.0.0.0 deriving instance (Data a, Data b) => Data (a,b) diff --git a/libraries/base/Data/Foldable.hs b/libraries/base/Data/Foldable.hs index 82fcd874b0..cc7fcefe05 100644 --- a/libraries/base/Data/Foldable.hs +++ b/libraries/base/Data/Foldable.hs @@ -114,6 +114,7 @@ import GHC.Arr ( Array(..), elems, numElements, foldl1Elems, foldr1Elems) import GHC.Base hiding ( foldr ) import GHC.Generics +import GHC.Tuple (Solo (..)) import GHC.Num ( Num(..) ) -- $setup @@ -747,6 +748,9 @@ instance Foldable (Either a) where null = isLeft +-- | @since 4.15 +deriving instance Foldable Solo + -- | @since 4.7.0.0 instance Foldable ((,) a) where foldMap f (_, y) = f y diff --git a/libraries/base/Data/Functor/Classes.hs b/libraries/base/Data/Functor/Classes.hs index 965bcdafd8..6a0d008982 100644 --- a/libraries/base/Data/Functor/Classes.hs +++ b/libraries/base/Data/Functor/Classes.hs @@ -72,6 +72,7 @@ import Data.List.NonEmpty (NonEmpty(..)) import Data.Ord (Down(Down)) import Data.Complex (Complex((:+))) +import GHC.Tuple (Solo (..)) import GHC.Read (expectP, list, paren) import Text.ParserCombinators.ReadPrec (ReadPrec, readPrec_to_S, readS_to_Prec) @@ -506,14 +507,29 @@ instance Show2 (,) where liftShowsPrec2 sp1 _ sp2 _ _ (x, y) = showChar '(' . sp1 0 x . showChar ',' . sp2 0 y . showChar ')' +-- | @since 4.15 +instance Eq1 Solo where + liftEq eq (Solo a) (Solo b) = a `eq` b + -- | @since 4.9.0.0 instance (Eq a) => Eq1 ((,) a) where liftEq = liftEq2 (==) +-- | @since 4.15 +instance Ord1 Solo where + liftCompare cmp (Solo a) (Solo b) = cmp a b + -- | @since 4.9.0.0 instance (Ord a) => Ord1 ((,) a) where liftCompare = liftCompare2 compare +-- | @since 4.15 +instance Read1 Solo where + liftReadPrec rp _ = readData (readUnaryWith rp "Solo" Solo) + + liftReadListPrec = liftReadListPrecDefault + liftReadList = liftReadListDefault + -- | @since 4.9.0.0 instance (Read a) => Read1 ((,) a) where liftReadPrec = liftReadPrec2 readPrec readListPrec @@ -521,6 +537,10 @@ instance (Read a) => Read1 ((,) a) where liftReadListPrec = liftReadListPrecDefault liftReadList = liftReadListDefault +-- | @since 4.15 +instance Show1 Solo where + liftShowsPrec sp _ d (Solo x) = showsUnaryWith sp "Solo" d x + -- | @since 4.9.0.0 instance (Show a) => Show1 ((,) a) where liftShowsPrec = liftShowsPrec2 showsPrec showList diff --git a/libraries/base/Data/Traversable.hs b/libraries/base/Data/Traversable.hs index 35f2c066b8..d18b0ed98d 100644 --- a/libraries/base/Data/Traversable.hs +++ b/libraries/base/Data/Traversable.hs @@ -78,6 +78,7 @@ import GHC.Base ( Applicative(..), Monad(..), Monoid, Maybe(..), NonEmpty(..), ($), (.), id, flip ) import GHC.Generics import qualified GHC.List as List ( foldr ) +import GHC.Tuple (Solo (..)) -- $setup -- >>> import Prelude @@ -271,6 +272,9 @@ instance Traversable (Either a) where traverse _ (Left x) = pure (Left x) traverse f (Right y) = Right <$> f y +-- | @since 4.15 +deriving instance Traversable Solo + -- | @since 4.7.0.0 instance Traversable ((,) a) where traverse f (x, y) = (,) x <$> f y diff --git a/libraries/base/GHC/Base.hs b/libraries/base/GHC/Base.hs index d1fe839cfe..d21226c7c4 100644 --- a/libraries/base/GHC/Base.hs +++ b/libraries/base/GHC/Base.hs @@ -118,7 +118,7 @@ import GHC.Err import GHC.Maybe import {-# SOURCE #-} GHC.IO (mkUserError, mplusIO) -import GHC.Tuple () -- Note [Depend on GHC.Tuple] +import GHC.Tuple (Solo (..)) -- Note [Depend on GHC.Tuple] import GHC.Num.Integer () -- Note [Depend on GHC.Num.Integer] -- for 'class Semigroup' @@ -349,6 +349,15 @@ instance Monoid () where mempty = () mconcat _ = () +-- | @since 4.15 +instance Semigroup a => Semigroup (Solo a) where + Solo a <> Solo b = Solo (a <> b) + stimes n (Solo a) = Solo (stimes n a) + +-- | @since 4.15 +instance Monoid a => Monoid (Solo a) where + mempty = Solo mempty + -- | @since 4.9.0.0 instance (Semigroup a, Semigroup b) => Semigroup (a, b) where (a,b) <> (a',b') = (a<>a',b<>b') @@ -423,6 +432,20 @@ instance Semigroup a => Semigroup (Maybe a) where instance Semigroup a => Monoid (Maybe a) where mempty = Nothing +-- | @since 4.15 +instance Applicative Solo where + pure = Solo + + -- Note: we really want to match strictly here. This lets us write, + -- for example, + -- + -- forceSpine :: Foldable f => f a -> () + -- forceSpine xs + -- | Solo r <- traverse_ Solo xs + -- = r + Solo f <*> Solo x = Solo (f x) + liftA2 f (Solo x) (Solo y) = Solo (f x y) + -- | For tuples, the 'Monoid' constraint on @a@ determines -- how the first values merge. -- For example, 'String's concatenate: @@ -436,6 +459,10 @@ instance Monoid a => Applicative ((,) a) where (u, f) <*> (v, x) = (u <> v, f x) liftA2 f (u, x) (v, y) = (u <> v, f x y) +-- | @since 4.15 +instance Monad Solo where + Solo x >>= f = f x + -- | @since 4.9.0.0 instance Monoid a => Monad ((,) a) where (u, a) >>= k = case k a of (v, b) -> (u <> v, b) @@ -982,6 +1009,15 @@ instance Applicative ((->) r) where instance Monad ((->) r) where f >>= k = \ r -> k (f r) r +-- | @since 4.15 +instance Functor Solo where + fmap f (Solo a) = Solo (f a) + + -- Being strict in the `Solo` argument here seems most consistent + -- with the concept behind `Solo`: always strict in the wrapper and lazy + -- in the contents. + x <$ Solo _ = Solo x + -- | @since 2.01 instance Functor ((,) a) where fmap f (x,y) = (x, f y) diff --git a/libraries/base/GHC/Generics.hs b/libraries/base/GHC/Generics.hs index 09d8fe1bfe..a407d3e771 100644 --- a/libraries/base/GHC/Generics.hs +++ b/libraries/base/GHC/Generics.hs @@ -743,6 +743,7 @@ import GHC.Enum ( Bounded, Enum ) import GHC.Read ( Read(..) ) import GHC.Show ( Show(..), showString ) import GHC.Stack.Types ( SrcLoc(..) ) +import GHC.Tuple (Solo (..)) import GHC.Unicode ( GeneralCategory(..) ) import GHC.Fingerprint.Type ( Fingerprint(..) ) @@ -1417,6 +1418,9 @@ deriving instance Generic (Proxy t) -- | @since 4.6.0.0 deriving instance Generic () +-- | @since 4.15 +deriving instance Generic (Solo a) + -- | @since 4.6.0.0 deriving instance Generic ((,) a b) @@ -1462,6 +1466,9 @@ deriving instance Generic1 (Either a) -- | @since 4.6.0.0 deriving instance Generic1 Proxy +-- | @since 4.15 +deriving instance Generic1 Solo + -- | @since 4.6.0.0 deriving instance Generic1 ((,) a) diff --git a/libraries/base/GHC/Read.hs b/libraries/base/GHC/Read.hs index 1057300c28..7f698ec498 100644 --- a/libraries/base/GHC/Read.hs +++ b/libraries/base/GHC/Read.hs @@ -73,6 +73,7 @@ import GHC.Base import GHC.Arr import GHC.Word import GHC.List (filter) +import GHC.Tuple (Solo (..)) -- | @'readParen' 'True' p@ parses what @p@ parses, but surrounded with @@ -667,6 +668,9 @@ instance Read () where readListPrec = readListPrecDefault readList = readListDefault +-- | @since 4.15 +deriving instance Read a => Read (Solo a) + -- | @since 2.01 instance (Read a, Read b) => Read (a,b) where readPrec = wrap_tup read_tup2 diff --git a/libraries/base/GHC/Show.hs b/libraries/base/GHC/Show.hs index 3de7aca723..97d6ad31c7 100644 --- a/libraries/base/GHC/Show.hs +++ b/libraries/base/GHC/Show.hs @@ -53,6 +53,7 @@ import GHC.Base import GHC.List ((!!), foldr1, break) import GHC.Num import GHC.Stack.Types +import GHC.Tuple (Solo (..)) -- | The @shows@ functions return a function that prepends the @@ -167,6 +168,9 @@ appPrec1 = I# 11# -- appPrec + 1 -- | @since 2.01 deriving instance Show () +-- | @since 4.15 +deriving instance Show a => Show (Solo a) + -- | @since 2.01 instance Show a => Show [a] where {-# SPECIALISE instance Show [String] #-} diff --git a/libraries/base/changelog.md b/libraries/base/changelog.md index 0525eefc2e..7ba14bf36b 100644 --- a/libraries/base/changelog.md +++ b/libraries/base/changelog.md @@ -11,6 +11,10 @@ * Add `Semigroup` and `Monoid` instances for `Data.Functor.Product` and `Data.Functor.Compose`. + * Add `Functor`, `Applicative`, `Monad`, `MonadFix`, `Foldable`, `Traversable`, + `Eq`, `Ord`, `Show`, `Read`, `Eq1`, `Ord1`, `Show1`, `Read1`, `Generic`, + `Generic1`, and `Data` instances for `GHC.Tuple.Solo`. + * Add `Eq1`, `Read1` and `Show1` instance for `Complex`; add `Eq1/2`, `Ord1/2`, `Show1/2` and `Read1/2` instances for 3 and 4-tuples. diff --git a/testsuite/tests/annotations/should_fail/annfail10.stderr b/testsuite/tests/annotations/should_fail/annfail10.stderr index 66394e52d3..fe0ff42a3e 100644 --- a/testsuite/tests/annotations/should_fail/annfail10.stderr +++ b/testsuite/tests/annotations/should_fail/annfail10.stderr @@ -10,8 +10,8 @@ annfail10.hs:9:1: error: instance Data.Data.Data Ordering -- Defined in ‘Data.Data’ instance Data.Data.Data a => Data.Data.Data (Maybe a) -- Defined in ‘Data.Data’ - ...plus 15 others - ...plus 47 instances involving out-of-scope types + ...plus 16 others + ...plus 50 instances involving out-of-scope types (use -fprint-potential-instances to see them all) • In the annotation: {-# ANN f 1 #-} diff --git a/testsuite/tests/ghci.debugger/scripts/break006.stderr b/testsuite/tests/ghci.debugger/scripts/break006.stderr index 037a834eec..1b97299d92 100644 --- a/testsuite/tests/ghci.debugger/scripts/break006.stderr +++ b/testsuite/tests/ghci.debugger/scripts/break006.stderr @@ -8,7 +8,7 @@ instance Show Ordering -- Defined in ‘GHC.Show’ instance Show a => Show (Maybe a) -- Defined in ‘GHC.Show’ instance Show Integer -- Defined in ‘GHC.Show’ - ...plus 22 others + ...plus 23 others ...plus 12 instances involving out-of-scope types (use -fprint-potential-instances to see them all) • In a stmt of an interactive GHCi command: print it @@ -22,7 +22,7 @@ instance Show Ordering -- Defined in ‘GHC.Show’ instance Show a => Show (Maybe a) -- Defined in ‘GHC.Show’ instance Show Integer -- Defined in ‘GHC.Show’ - ...plus 22 others + ...plus 23 others ...plus 12 instances involving out-of-scope types (use -fprint-potential-instances to see them all) • In a stmt of an interactive GHCi command: print it diff --git a/testsuite/tests/ghci.debugger/scripts/print019.stderr b/testsuite/tests/ghci.debugger/scripts/print019.stderr index 189fc91eab..bac95541f4 100644 --- a/testsuite/tests/ghci.debugger/scripts/print019.stderr +++ b/testsuite/tests/ghci.debugger/scripts/print019.stderr @@ -8,7 +8,7 @@ instance Show Ordering -- Defined in ‘GHC.Show’ instance Show TyCon -- Defined in ‘GHC.Show’ instance Show a => Show (List1 a) -- Defined at Test.hs:11:12 - ...plus 29 others + ...plus 30 others ...plus 13 instances involving out-of-scope types (use -fprint-potential-instances to see them all) • In a stmt of an interactive GHCi command: print it diff --git a/testsuite/tests/ghci/scripts/T12550.stdout b/testsuite/tests/ghci/scripts/T12550.stdout index fb0bf4c697..05baf3e900 100644 --- a/testsuite/tests/ghci/scripts/T12550.stdout +++ b/testsuite/tests/ghci/scripts/T12550.stdout @@ -50,6 +50,7 @@ instance ∀ (f ∷ ★ → ★) (g ∷ ★ → ★). -- Defined in ‘GHC.Generics’ instance ∀ a. Functor (Either a) -- Defined in ‘Data.Either’ instance Functor [] -- Defined in ‘GHC.Base’ +instance Functor Solo -- Defined in ‘GHC.Base’ instance Functor Maybe -- Defined in ‘GHC.Base’ instance Functor IO -- Defined in ‘GHC.Base’ instance ∀ r. Functor ((->) r) -- Defined in ‘GHC.Base’ diff --git a/testsuite/tests/indexed-types/should_fail/T12522a.stderr b/testsuite/tests/indexed-types/should_fail/T12522a.stderr index 9112a03314..a91c31c764 100644 --- a/testsuite/tests/indexed-types/should_fail/T12522a.stderr +++ b/testsuite/tests/indexed-types/should_fail/T12522a.stderr @@ -10,7 +10,7 @@ T12522a.hs:23:26: error: instance Show Ordering -- Defined in ‘GHC.Show’ instance Show a => Show (Maybe a) -- Defined in ‘GHC.Show’ instance Show Integer -- Defined in ‘GHC.Show’ - ...plus 22 others + ...plus 23 others ...plus 12 instances involving out-of-scope types (use -fprint-potential-instances to see them all) • In the first argument of ‘(++)’, namely ‘show n’ diff --git a/testsuite/tests/overloadedlists/should_fail/overloadedlistsfail01.stderr b/testsuite/tests/overloadedlists/should_fail/overloadedlistsfail01.stderr index e7b8f6d252..6e759d7f2a 100644 --- a/testsuite/tests/overloadedlists/should_fail/overloadedlistsfail01.stderr +++ b/testsuite/tests/overloadedlists/should_fail/overloadedlistsfail01.stderr @@ -7,7 +7,7 @@ overloadedlistsfail01.hs:5:8: error: instance Show Ordering -- Defined in ‘GHC.Show’ instance Show a => Show (Maybe a) -- Defined in ‘GHC.Show’ instance Show Integer -- Defined in ‘GHC.Show’ - ...plus 22 others + ...plus 23 others ...plus 14 instances involving out-of-scope types (use -fprint-potential-instances to see them all) • In the expression: print [1] diff --git a/testsuite/tests/polykinds/T13393.stderr b/testsuite/tests/polykinds/T13393.stderr index beea4732eb..a06aecff70 100644 --- a/testsuite/tests/polykinds/T13393.stderr +++ b/testsuite/tests/polykinds/T13393.stderr @@ -7,7 +7,7 @@ T13393.hs:61:3: error: instance Traversable (Either a) -- Defined in ‘Data.Traversable’ instance Traversable Identity -- Defined in ‘Data.Traversable’ instance Traversable Maybe -- Defined in ‘Data.Traversable’ - ...plus two others + ...plus three others ...plus 28 instances involving out-of-scope types (use -fprint-potential-instances to see them all) • In a stmt of a 'do' block: diff --git a/testsuite/tests/typecheck/should_compile/T14273.stderr b/testsuite/tests/typecheck/should_compile/T14273.stderr index 5761deac10..daff685704 100644 --- a/testsuite/tests/typecheck/should_compile/T14273.stderr +++ b/testsuite/tests/typecheck/should_compile/T14273.stderr @@ -11,7 +11,7 @@ T14273.hs:7:27: warning: [-Wdeferred-type-errors (in -Wdefault)] -- Defined in ‘Data.Either’ instance Show Ordering -- Defined in ‘GHC.Show’ instance Show a => Show (Maybe a) -- Defined in ‘GHC.Show’ - ...plus 23 others + ...plus 24 others ...plus 70 instances involving out-of-scope types (use -fprint-potential-instances to see them all) • In the first argument of ‘Just’, namely ‘(show _a)’ @@ -65,7 +65,7 @@ T14273.hs:13:10: warning: [-Wdeferred-type-errors (in -Wdefault)] -- Defined in ‘Data.Either’ instance Show Ordering -- Defined in ‘GHC.Show’ instance Show a => Show (Maybe a) -- Defined in ‘GHC.Show’ - ...plus 23 others + ...plus 24 others ...plus 70 instances involving out-of-scope types (use -fprint-potential-instances to see them all) • In the expression: show (_h ++ []) diff --git a/testsuite/tests/typecheck/should_compile/holes2.stderr b/testsuite/tests/typecheck/should_compile/holes2.stderr index 6a39bceeb0..1e30e87882 100644 --- a/testsuite/tests/typecheck/should_compile/holes2.stderr +++ b/testsuite/tests/typecheck/should_compile/holes2.stderr @@ -8,7 +8,7 @@ holes2.hs:3:5: warning: [-Wdeferred-type-errors (in -Wdefault)] -- Defined in ‘Data.Either’ instance Show Ordering -- Defined in ‘GHC.Show’ instance Show a => Show (Maybe a) -- Defined in ‘GHC.Show’ - ...plus 23 others + ...plus 24 others ...plus 70 instances involving out-of-scope types (use -fprint-potential-instances to see them all) • In the expression: show _ diff --git a/testsuite/tests/typecheck/should_compile/valid_hole_fits.stderr b/testsuite/tests/typecheck/should_compile/valid_hole_fits.stderr index 5830ecb7d7..bc12dfa2ba 100644 --- a/testsuite/tests/typecheck/should_compile/valid_hole_fits.stderr +++ b/testsuite/tests/typecheck/should_compile/valid_hole_fits.stderr @@ -146,6 +146,9 @@ valid_hole_fits.hs:34:11: warning: [-Wtyped-holes (in -Wdefault)] with Just @Bool (imported from ‘Data.Maybe’ at valid_hole_fits.hs:5:1-17 (and originally defined in ‘GHC.Maybe’)) + Solo :: forall a. a -> Solo a + with Solo @Bool + (bound at <wired into compiler>) id :: forall a. a -> a with id @Bool (imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40 diff --git a/testsuite/tests/typecheck/should_fail/T10971b.stderr b/testsuite/tests/typecheck/should_fail/T10971b.stderr index 3ac8c4400b..0947ab1b6f 100644 --- a/testsuite/tests/typecheck/should_fail/T10971b.stderr +++ b/testsuite/tests/typecheck/should_fail/T10971b.stderr @@ -10,7 +10,7 @@ T10971b.hs:4:11: error: instance Foldable (Either a) -- Defined in ‘Data.Foldable’ instance Foldable Maybe -- Defined in ‘Data.Foldable’ instance Foldable ((,) a) -- Defined in ‘Data.Foldable’ - ...plus one other + ...plus two others ...plus 29 instances involving out-of-scope types (use -fprint-potential-instances to see them all) • In the expression: length x @@ -28,7 +28,7 @@ T10971b.hs:5:13: error: instance Traversable (Either a) -- Defined in ‘Data.Traversable’ instance Traversable Maybe -- Defined in ‘Data.Traversable’ instance Traversable ((,) a) -- Defined in ‘Data.Traversable’ - ...plus one other + ...plus two others ...plus 29 instances involving out-of-scope types (use -fprint-potential-instances to see them all) • In the expression: fmapDefault f x @@ -46,7 +46,7 @@ T10971b.hs:6:14: error: instance Traversable (Either a) -- Defined in ‘Data.Traversable’ instance Traversable Maybe -- Defined in ‘Data.Traversable’ instance Traversable ((,) a) -- Defined in ‘Data.Traversable’ - ...plus one other + ...plus two others ...plus 29 instances involving out-of-scope types (use -fprint-potential-instances to see them all) • In the expression: fmapDefault f x @@ -64,7 +64,7 @@ T10971b.hs:6:31: error: instance Foldable (Either a) -- Defined in ‘Data.Foldable’ instance Foldable Maybe -- Defined in ‘Data.Foldable’ instance Foldable ((,) a) -- Defined in ‘Data.Foldable’ - ...plus one other + ...plus two others ...plus 29 instances involving out-of-scope types (use -fprint-potential-instances to see them all) • In the expression: length x diff --git a/testsuite/tests/typecheck/should_fail/T12921.stderr b/testsuite/tests/typecheck/should_fail/T12921.stderr index 4caa9ebe51..7dd612348d 100644 --- a/testsuite/tests/typecheck/should_fail/T12921.stderr +++ b/testsuite/tests/typecheck/should_fail/T12921.stderr @@ -10,7 +10,7 @@ T12921.hs:4:1: error: instance Data.Data.Data Ordering -- Defined in ‘Data.Data’ instance Data.Data.Data a => Data.Data.Data (Maybe a) -- Defined in ‘Data.Data’ - ...plus 15 others + ...plus 16 others ...plus 50 instances involving out-of-scope types (use -fprint-potential-instances to see them all) • In the annotation: diff --git a/testsuite/tests/typecheck/should_fail/T13292.stderr b/testsuite/tests/typecheck/should_fail/T13292.stderr index 217c5d4a39..7607505d0e 100644 --- a/testsuite/tests/typecheck/should_fail/T13292.stderr +++ b/testsuite/tests/typecheck/should_fail/T13292.stderr @@ -9,7 +9,7 @@ T13292a.hs:4:12: warning: [-Wdeferred-type-errors (in -Wdefault)] instance Monad IO -- Defined in ‘GHC.Base’ instance Monad Maybe -- Defined in ‘GHC.Base’ instance Monoid a => Monad ((,) a) -- Defined in ‘GHC.Base’ - ...plus three others + ...plus four others ...plus two instances involving out-of-scope types (use -fprint-potential-instances to see them all) • In the expression: return () diff --git a/testsuite/tests/typecheck/should_fail/T14884.stderr b/testsuite/tests/typecheck/should_fail/T14884.stderr index c901811f6f..6c2c78c0dc 100644 --- a/testsuite/tests/typecheck/should_fail/T14884.stderr +++ b/testsuite/tests/typecheck/should_fail/T14884.stderr @@ -40,7 +40,7 @@ T14884.hs:4:7: error: -- Defined in ‘Data.Either’ instance Show Ordering -- Defined in ‘GHC.Show’ instance Show a => Show (Maybe a) -- Defined in ‘GHC.Show’ - ...plus 23 others + ...plus 24 others ...plus 67 instances involving out-of-scope types (use -fprint-potential-instances to see them all) • In the first argument of ‘_’, namely ‘print’ diff --git a/testsuite/tests/typecheck/should_fail/TyAppPat_PatternBindingExistential.stderr b/testsuite/tests/typecheck/should_fail/TyAppPat_PatternBindingExistential.stderr index 86f983241b..a05806e7be 100644 --- a/testsuite/tests/typecheck/should_fail/TyAppPat_PatternBindingExistential.stderr +++ b/testsuite/tests/typecheck/should_fail/TyAppPat_PatternBindingExistential.stderr @@ -24,7 +24,7 @@ TyAppPat_PatternBindingExistential.hs:13:3: error: instance Show Ordering -- Defined in ‘GHC.Show’ instance Show a => Show (Maybe a) -- Defined in ‘GHC.Show’ instance Show Integer -- Defined in ‘GHC.Show’ - ...plus 22 others + ...plus 23 others ...plus 12 instances involving out-of-scope types (use -fprint-potential-instances to see them all) • In a stmt of a 'do' block: print (x :: a) diff --git a/testsuite/tests/typecheck/should_fail/tcfail133.stderr b/testsuite/tests/typecheck/should_fail/tcfail133.stderr index c3fc429bc4..a88a27e858 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail133.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail133.stderr @@ -11,7 +11,7 @@ tcfail133.hs:68:7: error: instance (Number a, Digit b, Show a, Show b) => Show (a :@ b) -- Defined at tcfail133.hs:11:54 instance Show One -- Defined at tcfail133.hs:9:28 - ...plus 25 others + ...plus 26 others ...plus 12 instances involving out-of-scope types (use -fprint-potential-instances to see them all) • In the first argument of ‘($)’, namely ‘show’ diff --git a/testsuite/tests/typecheck/should_fail/tcfail181.stderr b/testsuite/tests/typecheck/should_fail/tcfail181.stderr index 8a8263e8b4..c21214a689 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail181.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail181.stderr @@ -10,7 +10,7 @@ tcfail181.hs:17:9: error: instance Monad IO -- Defined in ‘GHC.Base’ instance Monad Maybe -- Defined in ‘GHC.Base’ instance Monoid a => Monad ((,) a) -- Defined in ‘GHC.Base’ - ...plus three others + ...plus four others ...plus two instances involving out-of-scope types (use -fprint-potential-instances to see them all) • In the expression: foo |