summaryrefslogtreecommitdiff
path: root/testsuite/tests/rep-poly/T21650_a.hs
blob: 2c3e6aacb49d283e4f490de80d3464059fab2bd6 (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
{-# LANGUAGE DataKinds, DatatypeContexts, MagicHash, UnliftedNewtypes, TypeFamilies #-}

module T21650_a where

import Data.Kind
import GHC.Exts

type R :: Type -> RuntimeRep
type family R a where
  R Float  = FloatRep
  R Double = DoubleRep

type F :: forall (a :: Type) -> TYPE (R a)
type family F a where
  F Float  = Float#
  F Double = Double#

type C :: Type -> Constraint
class C a where {}

type N :: forall (a :: Type) -> TYPE (R a)
newtype C a => N a = MkN (F a)

foo1 :: C Float => F Float -> N Float
foo1 = MkN

foo2 :: C Double => () -> F Double -> N Double
foo2 _ = MkN