summaryrefslogtreecommitdiff
path: root/testsuite/tests/th/T13123.hs
blob: d7e1006b9ea7fd3cd747010d5a85ab87f21b6db4 (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
31
32
33
34
35
36
37
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TemplateHaskell #-}
module T13123 where

import GHC.Exts (Constraint)

$([d| idProxy :: forall proxy (a :: k). proxy a -> proxy a
      idProxy x = x
    |])

$([d| id2 :: Show a => a -> a
      id2 x = x
      {-# SPECIALIZE id2 :: forall proxy (a :: k). Show (proxy a)
                         => proxy a -> proxy a #-}
    |])

$([d| wibble :: Maybe Int
      wibble = (undefined :: forall proxy (a :: k). proxy a)
    |])

$([d| class Foo b where
        bar         :: forall proxy (a :: k). proxy a -> b
        default bar :: forall proxy (a :: k). proxy a -> b
        bar = undefined
    |])

$([d| data GADT where
        MkGADT :: forall proxy (a :: k). proxy a -> GADT
    |])

$([d| data Dec13 :: (* -> Constraint) -> * where
        MkDec13 :: c a => a -> Dec13 c
    |])