summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/T13879.hs
blob: 8a70565e7a4de417fb009293758d2fdda728460e (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
30
{-# LANGUAGE Haskell2010 #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE DataKinds, PolyKinds #-}
{-# LANGUAGE TypeOperators #-}
module Bug where

import Data.Kind

data family Sing (a :: k)

data HR (a :: j) (b :: k) where
  HRefl :: HR a a

data instance Sing (z :: HR a b) where
  SHRefl :: Sing HRefl

foo :: forall (j :: Type) (k :: Type) (a :: j)
              (b :: k) (r :: HR a b)
              (p :: forall (z :: Type) (y :: z). HR a y -> Type).
          Sing r
       -> App p HRefl
       -> HRApp p r
foo SHRefl pHRefl = pHRefl

type App f x = f x
type HRApp (f :: forall (z :: Type) (y :: z). HR a y -> Type)
           (x :: HR a b) = f x