summaryrefslogtreecommitdiff
path: root/testsuite/tests/dependent/should_compile/T15666.hs
blob: 022c3a0aeee108d9537ac9695629ffca1feeb692 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{-# LANGUAGE
  NoImplicitPrelude,
  TypeInType, PolyKinds, DataKinds,
  ScopedTypeVariables,
  TypeFamilies,
  UndecidableInstances
#-}

module T15666 where

import Data.Kind(Type)

data PolyType k (t :: k)

type Wrap (t :: k) = PolyType k t
type Unwrap pt = (GetType pt :: GetKind pt)

type family GetKind (pt :: Type) :: Type where
  GetKind (PolyType k t) = k

type family GetType (pt :: Type) :: k where
  GetType (PolyType k t) = t

data Composite :: a -> b -> Type

type family RecursiveWrap expr where
  RecursiveWrap (Composite a b) =
    Wrap (Composite (Unwrap (RecursiveWrap a)) (Unwrap (RecursiveWrap b)))
  RecursiveWrap x = Wrap x