lookupBindGroupOcc: recommend names in the same namespace (#17593)
[ghc.git] / testsuite / tests / polykinds / T6068.hs
1 {-# OPTIONS_GHC -fno-warn-redundant-constraints #-}
2 {-# LANGUAGE PolyKinds, DataKinds, TypeFamilies, GADTs, MultiParamTypeClasses, KindSignatures,
3 FunctionalDependencies, FlexibleInstances, UndecidableInstances, ExistentialQuantification #-}
4
5 module T6068 where
6
7 import Prelude hiding (Maybe, Nothing)
8 import Data.Kind (Type)
9
10 data Maybe :: Type -> Type where
11 Nothing :: Maybe a
12
13 data family Sing (a :: k)
14
15 data instance Sing (a :: Maybe k) where
16 SNothing :: Sing Nothing
17
18 data KProxy (a :: Type) = KProxy
19 data Existential (p :: KProxy k) =
20 forall (a :: k). Exists (Sing a)
21
22 class HasSingleton a (kp :: KProxy k) | a -> kp where
23 exists :: a -> Existential kp
24
25 class Floop a b | a -> b
26
27 instance Floop a (mp :: KProxy (Maybe ak)) => HasSingleton (Maybe a) mp where
28 exists Nothing = Exists SNothing
29
30 -- instance forall (a ::Type) (mp :: KProxy (Maybe ak)).
31 -- HasSingleton (Maybe ak) (Maybe a) mp where
32 -- exists Nothing = Exists SNothing