Embrace -XTypeInType, add -XStarIsType
[ghc.git] / testsuite / tests / dependent / should_compile / T11966.hs
1 {-# LANGUAGE TypeFamilies #-}
2 {-# LANGUAGE DataKinds #-}
3 {-# LANGUAGE KindSignatures #-}
4 {-# LANGUAGE PolyKinds #-}
5 {-# LANGUAGE RankNTypes #-}
6 {-# LANGUAGE TypeOperators #-}
7
8 module T11966 where
9
10 import Data.Kind (Type)
11 import GHC.TypeLits (Symbol)
12
13 -- Simplification
14 type family Col (f :: k -> j) (x :: k) :: Type
15
16 -- Base types
17 data PGBaseType = PGInteger | PGText
18
19 -- Transformations
20 data Column t = Column Symbol t
21 newtype Nullable t = Nullable t
22 newtype HasDefault t = HasDefault t
23
24 -- Interpretations
25 data Expr k
26
27 data Record (f :: forall k. k -> Type) =
28 Record {rX :: Col f ('Column "x" 'PGInteger)
29 ,rY :: Col f ('Column "y" ('Nullable 'PGInteger))
30 ,rZ :: Col f ('HasDefault 'PGText)}
31
32 x :: Record Expr
33 x = undefined