0262a0aed3d547234dfff7496d0e85b492f8bd50
[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 TypeInType #-}
7 {-# LANGUAGE TypeOperators #-}
8
9 module T11966 where
10
11 import Data.Kind (Type)
12 import GHC.TypeLits (Symbol)
13
14 -- Simplification
15 type family Col (f :: k -> j) (x :: k) :: Type
16
17 -- Base types
18 data PGBaseType = PGInteger | PGText
19
20 -- Transformations
21 data Column t = Column Symbol t
22 newtype Nullable t = Nullable t
23 newtype HasDefault t = HasDefault t
24
25 -- Interpretations
26 data Expr k
27
28 data Record (f :: forall k. k -> Type) =
29 Record {rX :: Col f ('Column "x" 'PGInteger)
30 ,rY :: Col f ('Column "y" ('Nullable 'PGInteger))
31 ,rZ :: Col f ('HasDefault 'PGText)}
32
33 x :: Record Expr
34 x = undefined