89e749ce3669a80c7c7c4055670c78c5fb0a2c7c
[ghc.git] / testsuite / tests / polykinds / T7594.hs
1 {-# LANGUAGE FlexibleInstances #-}
2 {-# LANGUAGE UndecidableInstances #-}
3 {-# LANGUAGE MultiParamTypeClasses #-}
4 {-# LANGUAGE KindSignatures #-}
5 {-# LANGUAGE TypeOperators #-}
6 {-# LANGUAGE ConstraintKinds #-}
7 {-# LANGUAGE GADTs #-}
8 {-# LANGUAGE Rank2Types #-}
9 module T7594 where
10
11 import GHC.Prim (Constraint)
12
13 class (c1 t, c2 t) => (:&:) (c1 :: * -> Constraint) (c2 :: * -> Constraint) (t :: *)
14 instance (c1 t, c2 t) => (:&:) c1 c2 t
15
16 data ColD c where
17 ColD :: (c a) => a -> ColD c
18
19 app :: (forall a. (c a) => a -> b) -> ColD c -> b
20 app f (ColD x) = f x
21
22 q :: ColD (Show :&: Real)
23 q = ColD (1.2 :: Double)
24
25 bar = app print q
26
27