summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/tc188.hs
blob: eaf3690ef163edbdba848a3d821e34dbd64bddf3 (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
{-# LANGUAGE TypeOperators, MultiParamTypeClasses, LiberalTypeSynonyms #-}

-- Test infix type constructors for type synonyms

module ShouldCompile where

infix 9 :-+-:
type (f :-+-: g) t o1 o2 = Either (f t o1 o2) (g t o1 o2)

data Foo a b c = Foo (a,b,c)

type App f = f Int Bool Int

f :: (Foo :-+-: Foo) Bool Int Bool
f = error "urk"

g :: App (Foo :-+-: Foo) 
g = error "urk"

-------- classes --------

class (Eq a, Eq b) => a :&: b where
   op :: a -> b

h :: (a :&: b) => a -> b
h x = op x