blob: 19bf3d9db39b551d3a3cb0bbb6c08f4c23ceda8b (
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 Data.Kind (Type, Constraint)
$([d| idProxy :: forall k proxy (a :: k). proxy a -> proxy a
idProxy x = x
|])
$([d| id2 :: Show a => a -> a
id2 x = x
{-# SPECIALIZE id2 :: forall k proxy (a :: k). Show (proxy a)
=> proxy a -> proxy a #-}
|])
$([d| wibble :: Maybe Int
wibble = (undefined :: forall k proxy (a :: k). proxy a)
|])
$([d| class Foo b where
bar :: forall k proxy (a :: k). proxy a -> b
default bar :: forall k proxy (a :: k). proxy a -> b
bar = undefined
|])
$([d| data GADT where
MkGADT :: forall k proxy (a :: k). proxy a -> GADT
|])
$([d| data Dec13 :: (Type -> Constraint) -> Type where
MkDec13 :: c a => a -> Dec13 c
|])
|