Fix #16188
[ghc.git] / testsuite / tests / typecheck / should_compile / T16225.hs
1 {-# LANGUAGE AllowAmbiguousTypes #-}
2 {-# LANGUAGE GADTs #-}
3 {-# LANGUAGE TypeFamilies #-}
4 {-# LANGUAGE TypeInType #-}
5 {-# LANGUAGE TypeOperators #-}
6 module T16225 where
7
8 import Data.Kind
9
10 data family Sing :: k -> Type
11 data TyFun :: Type -> Type -> Type
12 type a ~> b = TyFun a b -> Type
13 infixr 0 ~>
14 type family Apply (f :: a ~> b) (x :: a) :: b
15
16 data TyCon1 :: (k1 -> k2) -> (k1 ~> k2)
17 type instance Apply (TyCon1 f) x = f x
18
19 data SomeApply :: (k ~> Type) -> Type where
20 SomeApply :: Apply f a -> SomeApply f
21
22 f :: SomeApply (TyCon1 Sing :: k ~> Type)
23 -> SomeApply (TyCon1 Sing :: k ~> Type)
24 f (SomeApply s)
25 = SomeApply s