summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/tc188.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/typecheck/should_compile/tc188.hs')
-rw-r--r--testsuite/tests/typecheck/should_compile/tc188.hs26
1 files changed, 26 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/tc188.hs b/testsuite/tests/typecheck/should_compile/tc188.hs
new file mode 100644
index 0000000000..eaf3690ef1
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/tc188.hs
@@ -0,0 +1,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