Skip to content
Snippets Groups Projects
Commit f3583a3d authored by Ryan Scott's avatar Ryan Scott Committed by Ben Gamari
Browse files

Add {lifted,unlifted}DataConKey to pretendNameIsInScope's list of Names

Fixes #19688.

(cherry picked from commit 1e2e62a4)
parent a42e30bc
No related branches found
No related tags found
No related merge requests found
......@@ -2817,7 +2817,11 @@ interactiveClassKeys = map getUnique interactiveClassNames
* *
************************************************************************
The following names should be considered by GHCi to be in scope always.
GHCi's :info command will usually filter out instances mentioning types whose
names are not in scope. GHCi makes an exception for some commonly used names,
such as Data.Kind.Type, which may not actually be in scope but should be
treated as though they were in scope. The list in the definition of
pretendNameIsInScope below contains these commonly used names.
-}
......@@ -2825,5 +2829,6 @@ pretendNameIsInScope :: Name -> Bool
pretendNameIsInScope n
= any (n `hasKey`)
[ liftedTypeKindTyConKey, unliftedTypeKindTyConKey
, liftedDataConKey, unliftedDataConKey
, tYPETyConKey
, runtimeRepTyConKey, boxedRepDataConKey ]
......@@ -2,6 +2,9 @@ type (->) :: * -> * -> *
type (->) = FUN 'Many :: * -> * -> *
-- Defined in ‘GHC.Types’
infixr -1 ->
instance Applicative ((->) r) -- Defined in ‘GHC.Base’
instance Functor ((->) r) -- Defined in ‘GHC.Base’
instance Monad ((->) r) -- Defined in ‘GHC.Base’
instance Monoid b => Monoid (a -> b) -- Defined in ‘GHC.Base’
instance Semigroup b => Semigroup (a -> b) -- Defined in ‘GHC.Base’
type (~) :: forall k. k -> k -> Constraint
......
......@@ -23,12 +23,37 @@ class Functor f where
(<$) ∷ ∀ a b. a → f b → f a
{-# MINIMAL fmap #-}
-- Defined in ‘GHC.Base’
instance Functor V1 -- Defined in ‘GHC.Generics’
instance Functor (URec Char) -- Defined in ‘GHC.Generics’
instance Functor (URec Double) -- Defined in ‘GHC.Generics’
instance Functor (URec Float) -- Defined in ‘GHC.Generics’
instance Functor (URec Int) -- Defined in ‘GHC.Generics’
instance Functor (URec Word) -- Defined in ‘GHC.Generics’
instance Functor U1 -- Defined in ‘GHC.Generics’
instance ∀ (f ∷ ★ → ★). Functor f ⇒ Functor (Rec1 f)
-- Defined in ‘GHC.Generics’
instance Functor Par1 -- Defined in ‘GHC.Generics’
instance ∀ i (c ∷ Meta) (f ∷ ★ → ★). Functor f ⇒ Functor (M1 i c f)
-- Defined in ‘GHC.Generics’
instance ∀ i c. Functor (K1 i c) -- Defined in ‘GHC.Generics’
instance ∀ (f ∷ ★ → ★) (g ∷ ★ → ★).
(Functor f, Functor g) ⇒
Functor (f :.: g)
-- Defined in ‘GHC.Generics’
instance ∀ (f ∷ ★ → ★) (g ∷ ★ → ★).
(Functor f, Functor g) ⇒
Functor (f :+: g)
-- Defined in ‘GHC.Generics’
instance ∀ (f ∷ ★ → ★) (g ∷ ★ → ★).
(Functor f, Functor g) ⇒
Functor (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’
instance ∀ a b c. Functor ((,,,) a b c) -- Defined in ‘GHC.Base’
instance ∀ a b. Functor ((,,) a b) -- Defined in ‘GHC.Base’
instance ∀ a. Functor ((,) a) -- Defined in ‘GHC.Base’
......
{-# LANGUAGE TypeFamilies #-}
module T19688 where
data family D (a :: k)
data instance D Int = DInt
:load T19688
:info D
type D :: forall k. k -> *
data family D a
-- Defined at T19688.hs:4:1
data instance D Int = DInt -- Defined at T19688.hs:5:15
......@@ -2,5 +2,8 @@ type (->) :: * -> * -> *
type (->) = FUN 'Many :: * -> * -> *
-- Defined in ‘GHC.Types’
infixr -1 ->
instance Applicative ((->) r) -- Defined in ‘GHC.Base’
instance Functor ((->) r) -- Defined in ‘GHC.Base’
instance Monad ((->) r) -- Defined in ‘GHC.Base’
instance Monoid b => Monoid (a -> b) -- Defined in ‘GHC.Base’
instance Semigroup b => Semigroup (a -> b) -- Defined in ‘GHC.Base’
type Sing :: forall k. k -> *
data family Sing a
-- Defined at T8674.hs:4:1
data instance Sing Bool = SBool -- Defined at T8674.hs:6:15
data instance forall k (a :: [k]). Sing a = SNil
-- Defined at T8674.hs:5:15
......@@ -328,3 +328,4 @@ test('T19197', normal, ghci_script, ['T19197.script'])
test('T19158', normal, ghci_script, ['T19158.script'])
test('T19279', normal, ghci_script, ['T19279.script'])
test('T19310', normal, ghci_script, ['T19310.script'])
test('T19688', normal, ghci_script, ['T19688.script'])
......@@ -2,5 +2,8 @@ type (->) :: * -> * -> *
type (->) = FUN 'Many :: * -> * -> *
-- Defined in ‘GHC.Types’
infixr -1 ->
instance Applicative ((->) r) -- Defined in ‘GHC.Base’
instance Functor ((->) r) -- Defined in ‘GHC.Base’
instance Monad ((->) r) -- Defined in ‘GHC.Base’
instance Monoid b => Monoid (a -> b) -- Defined in ‘GHC.Base’
instance Semigroup b => Semigroup (a -> b) -- Defined in ‘GHC.Base’
......@@ -2,5 +2,8 @@ type (->) :: * -> * -> *
type (->) = FUN 'Many :: * -> * -> *
-- Defined in ‘GHC.Types’
infixr -1 ->
instance Applicative ((->) r) -- Defined in ‘GHC.Base’
instance Functor ((->) r) -- Defined in ‘GHC.Base’
instance Monad ((->) r) -- Defined in ‘GHC.Base’
instance Monoid b => Monoid (a -> b) -- Defined in ‘GHC.Base’
instance Semigroup b => Semigroup (a -> b) -- Defined in ‘GHC.Base’
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment