tc188.hs 454 Bytes
Newer Older
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
{-# OPTIONS -fglasgow-exts #-}

-- 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