summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/T18185.hs
blob: 653fa74c918f39efe0056c5cc10e2243c26cca40 (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
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
module T18185 where

import GHC.TypeLits
import Type.Reflection

class iss :|+ is  ~ oss => AddT (iss :: [Symbol]) (is :: Symbol) (oss :: [Symbol]) where
 type iss :|+ is :: [Symbol]

class (CmpSymbol is ish ~ ord, AddT'I ord is ish ist ~ oss) => AddT' ord is ish ist oss where
 type AddT'I ord is ish ist :: [Symbol]

class (CmpSymbol "a" "a" ~ o) => C1 o
class (CmpNat 1 1 ~ o) => C2 o
class ((CmpSymbol "a" "a" :: Ordering) ~ o) => C3 o
class ((CmpNat 1 1 :: Ordering) ~ o) => C4 o

f1 :: TypeRep (CmpSymbol "a" "a")
f1 = typeRep

f2 :: TypeRep (CmpNat 1 1)
f2 = typeRep

f3 :: TypeRep (CmpSymbol "a" "a" :: Ordering)
f3 = typeRep

f4 :: TypeRep (CmpNat 1 1 :: Ordering)
f4 = typeRep