Fix #14729 by making the normaliser homogeneous
[ghc.git] / testsuite / tests / typecheck / should_compile / T15549b.hs
1 {-# LANGUAGE GADTs #-}
2 {-# LANGUAGE ScopedTypeVariables #-}
3 {-# LANGUAGE TypeFamilies #-}
4 {-# LANGUAGE PolyKinds #-}
5 {-# LANGUAGE DataKinds #-}
6
7 module T15549b where
8
9 import Data.Kind (Type)
10
11 newtype Identity a = Identity a
12 newtype Par1 a = Par1 a
13
14 data family Sing :: forall k. k -> Type
15 data instance Sing :: forall k. k -> Type
16
17 type family Rep1 (f :: Type -> Type) :: Type -> Type
18 type instance Rep1 Identity = Par1
19
20 type family From1 (z :: f a) :: Rep1 f a
21 type instance From1 ('Identity x) = 'Par1 x
22
23 und :: a
24 und = und
25
26 f :: forall (a :: Type) (x :: Identity a). Sing x
27 f = g
28 where g :: forall (a :: Type) (f :: Type -> Type) (x :: f a). Sing x
29 g = seq (und :: Sing (From1 x)) und