summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Feuer <David.Feuer@gmail.com>2020-12-30 11:08:11 -0500
committerBen Gamari <ben@smart-cactus.org>2021-01-11 10:26:51 -0500
commit6b590b6496946dbcd6ae8b9c953f4e5e09859307 (patch)
tree0f74415af7d2c82481789ab371a51b5da4e074c1
parent5370876c0021afb59b7464c3de944087b0241448 (diff)
downloadhaskell-6b590b6496946dbcd6ae8b9c953f4e5e09859307.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 alloc increases 1.0%; Ben Gamari suspects this is just from having more instances around. Metric Increase: T12545 (cherry picked from commit 372a92d831151977944df488ba2770768edc45d9)
-rw-r--r--libraries/base/Control/Monad/Fix.hs6
-rw-r--r--libraries/base/Data/Data.hs4
-rw-r--r--libraries/base/Data/Foldable.hs4
-rw-r--r--libraries/base/Data/Functor/Classes.hs20
-rw-r--r--libraries/base/Data/Traversable.hs4
-rw-r--r--libraries/base/GHC/Base.hs38
-rw-r--r--libraries/base/GHC/Generics.hs7
-rw-r--r--libraries/base/GHC/Read.hs4
-rw-r--r--libraries/base/GHC/Show.hs4
-rw-r--r--libraries/base/changelog.md9
-rw-r--r--testsuite/tests/annotations/should_fail/annfail10.stderr4
-rw-r--r--testsuite/tests/ghci.debugger/scripts/break006.stderr4
-rw-r--r--testsuite/tests/ghci.debugger/scripts/print019.stderr2
-rw-r--r--testsuite/tests/ghci/scripts/T12550.stdout1
-rw-r--r--testsuite/tests/indexed-types/should_fail/T12522a.stderr2
-rw-r--r--testsuite/tests/overloadedlists/should_fail/overloadedlistsfail01.stderr2
-rw-r--r--testsuite/tests/partial-sigs/should_compile/T10403.stderr2
-rw-r--r--testsuite/tests/polykinds/T13393.stderr2
-rw-r--r--testsuite/tests/typecheck/should_compile/T14273.stderr4
-rw-r--r--testsuite/tests/typecheck/should_compile/holes2.stderr2
-rw-r--r--testsuite/tests/typecheck/should_compile/valid_hole_fits.stderr3
-rw-r--r--testsuite/tests/typecheck/should_fail/T10971b.stderr8
-rw-r--r--testsuite/tests/typecheck/should_fail/T12921.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/T13292.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/T14884.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail133.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail181.stderr2
27 files changed, 123 insertions, 23 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/Data/Data.hs b/libraries/base/Data/Data.hs
index a8dfa61115..a639001bd0 100644
--- a/libraries/base/Data/Data.hs
+++ b/libraries/base/Data/Data.hs
@@ -128,6 +128,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
@@ -1185,6 +1186,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 98dd072a91..4b50be3fb9 100644
--- a/libraries/base/Data/Foldable.hs
+++ b/libraries/base/Data/Foldable.hs
@@ -66,6 +66,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(..) )
infix 4 `elem`, `notElem`
@@ -649,6 +650,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 e719c8ffe8..0639a2b719 100644
--- a/libraries/base/Data/Functor/Classes.hs
+++ b/libraries/base/Data/Functor/Classes.hs
@@ -71,6 +71,7 @@ import Data.Proxy (Proxy(Proxy))
import Data.List.NonEmpty (NonEmpty(..))
import Data.Ord (Down(Down))
+import GHC.Tuple (Solo (..))
import GHC.Read (expectP, list, paren)
import Text.ParserCombinators.ReadPrec (ReadPrec, readPrec_to_S, readS_to_Prec)
@@ -499,14 +500,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
@@ -514,6 +530,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 7d37be003a..6dab1648e0 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 (..))
-- | Functors representing data structures that can be traversed from
-- left to right.
@@ -262,6 +263,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 e344f842df..4af6a2bd73 100644
--- a/libraries/base/GHC/Base.hs
+++ b/libraries/base/GHC/Base.hs
@@ -120,7 +120,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'
@@ -348,6 +348,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')
@@ -422,6 +431,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:
@@ -435,6 +458,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)
@@ -966,6 +993,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 c175d9ee7b..b4bcbc367e 100644
--- a/libraries/base/GHC/Generics.hs
+++ b/libraries/base/GHC/Generics.hs
@@ -745,6 +745,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(..) )
@@ -1419,6 +1420,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)
@@ -1464,6 +1468,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 3703496b97..b62159fd9e 100644
--- a/libraries/base/changelog.md
+++ b/libraries/base/changelog.md
@@ -1,7 +1,14 @@
# Changelog for [`base` package](http://hackage.haskell.org/package/base)
## 4.15.0.0 *TBA*
- * TODO
+
+ * Add `Functor`, `Applicative`, `Monad`, `MonadFix`, `Foldable`, `Traversable`,
+ `Eq`, `Ord`, `Show`, `Read`, `Eq1`, `Ord1`, `Show1`, `Read1`, `Generic`,
+ `Generic1`, and `Data` instances for `GHC.Tuple.Solo`.
+
+ * `openFile` now calls the `open` system call with an `interruptible` FFI
+ call, ensuring that the call can be interrupted with `SIGINT` on POSIX
+ systems.
* Add `hGetContents'`, `getContents'`, and `readFile'` in `System.IO`:
Strict IO variants of `hGetContents`, `getContents`, and `readFile`.
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 a3117d02c2..cc59f0e387 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/partial-sigs/should_compile/T10403.stderr b/testsuite/tests/partial-sigs/should_compile/T10403.stderr
index e59a28a99d..631fdc3955 100644
--- a/testsuite/tests/partial-sigs/should_compile/T10403.stderr
+++ b/testsuite/tests/partial-sigs/should_compile/T10403.stderr
@@ -32,7 +32,7 @@ T10403.hs:22:15: warning: [-Wdeferred-type-errors (in -Wdefault)]
instance Functor IO -- Defined in ‘GHC.Base’
instance Functor (B t) -- Defined at T10403.hs:10:10
instance Functor I -- Defined at T10403.hs:6:10
- ...plus five others
+ ...plus six others
...plus two instances involving out-of-scope types
(use -fprint-potential-instances to see them all)
• In the second argument of ‘(.)’, namely ‘fmap (const ())’
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 116a18f42f..db7540035b 100644
--- a/testsuite/tests/typecheck/should_compile/valid_hole_fits.stderr
+++ b/testsuite/tests/typecheck/should_compile/valid_hole_fits.stderr
@@ -145,6 +145,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 e1738891a7..b0520d5489 100644
--- a/testsuite/tests/typecheck/should_fail/T14884.stderr
+++ b/testsuite/tests/typecheck/should_fail/T14884.stderr
@@ -41,7 +41,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/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