summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/typecheck')
-rw-r--r--testsuite/tests/typecheck/should_compile/all.T1
-rw-r--r--testsuite/tests/typecheck/should_compile/tc192.hs48
-rw-r--r--testsuite/tests/typecheck/should_compile/tc261.hs4
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail094.stderr3
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail173.stderr5
5 files changed, 34 insertions, 27 deletions
diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T
index ce6f95e56f..76708bb30b 100644
--- a/testsuite/tests/typecheck/should_compile/all.T
+++ b/testsuite/tests/typecheck/should_compile/all.T
@@ -352,6 +352,7 @@ test('tc257', normal, compile, [''])
test('tc258', normal, compile, [''])
test('tc259', normal, compile, [''])
test('tc260', normal, compile, [''])
+test('tc261', normal, compile, [''])
test('GivenOverlapping', normal, compile, [''])
test('SilentParametersOverlapping', normal, compile, [''])
diff --git a/testsuite/tests/typecheck/should_compile/tc192.hs b/testsuite/tests/typecheck/should_compile/tc192.hs
index 3337954ade..5af64f344d 100644
--- a/testsuite/tests/typecheck/should_compile/tc192.hs
+++ b/testsuite/tests/typecheck/should_compile/tc192.hs
@@ -15,7 +15,7 @@ import Control.Arrow
-- comp1 :: Arrow (-=>) => b-=>c -> c-=>d -> b-=>d
-comp1 :: Arrow (~>) => b~>c -> c~>d -> b~>d
+comp1 :: Arrow to => b `to` c -> c `to` d -> b `to` d
comp1 f g = proc x -> do
b <- f -< x
g -< b
@@ -23,26 +23,26 @@ comp1 f g = proc x -> do
-- arrowp produces
-- comp1 f g = (f >>> g)
-comp :: Arrow (~>) => (b~>c, c~>d)~>(b~>d)
+comp :: Arrow to => (b `to` c, c `to` d) `to` (b `to` d)
comp = arr (uncurry (>>>))
--- app :: Arrow (~>) => (b c, b)~>c
+-- app :: Arrow to => (b c, b) `to` c
type R = Float
type I = Int
-z1,z2 :: Arrow (~>) => I~>(R~>R)
+z1,z2 :: Arrow to => I `to` (R `to` R)
z1 = undefined
z2 = z1
-z3 :: Arrow (~>) => (I,I)~>(R~>R,R~>R)
+z3 :: Arrow to => (I,I) `to` (R `to` R,R `to` R)
z3 = z1 *** z2
-z4 :: Arrow (~>) => (I,I)~>(R~>R)
+z4 :: Arrow to => (I,I) `to` (R `to` R)
z4 = z3 >>> comp
-comp4,comp5 :: Arrow (~>) =>
- b~>(c~>d) -> e~>(d~>f) -> (b,e)~>(c~>f)
+comp4,comp5 :: Arrow to =>
+ b `to` (c `to` d) -> e `to` (d `to` f) -> (b,e) `to` (c `to` f)
comp4 g f = proc (b,e) -> do
g' <- g -< b
@@ -51,7 +51,7 @@ comp4 g f = proc (b,e) -> do
comp5 g f = (g *** f) >>> comp
-lam,lam2 :: Arrow (~>) => (e,b)~>c -> e~>(b~>c)
+lam,lam2 :: Arrow to => (e,b) `to` c -> e `to` (b `to` c)
lam f = arr $ \ e -> arr (pair e) >>> f
@@ -65,7 +65,7 @@ lam2 f = proc e ->
returnA -< c)
-- I desugared with the arrows preprocessor, removed extra parens and
--- renamed "arr" (~>) "pure", (~>) get
+-- renamed "arr" to "pure", to get
--
-- lam f = pure (\ e -> pure (\ b -> (e, b)) >>> f)
@@ -85,27 +85,27 @@ curry4 f = \ e -> f . (pair e)
-comp6 :: Arrow (~>) => b~>(c~>d) -> e~>(d~>f)
- -> b~>(e~>(c~>f))
+comp6 :: Arrow to => b `to` (c `to` d) -> e `to` (d `to` f)
+ -> b `to` (e `to` (c `to` f))
comp6 g f = lam $ comp5 g f
-- What about uncurrying?
--- uncurryA :: Arrow (~>) => b~>(c~>d)
--- -> (b,c)~>d
+-- uncurryA :: Arrow to => b `to` (c `to` d)
+-- -> (b,c) `to` d
-- uncurryA f = proc (b,c) -> do
-- f' <- f -< b
-- returnA -< f' c
-- Why "lam" instead of "curryA" (good name also): so I can use Arrows
--- lambda notation, similar (~>)
+-- lambda notation, similar to
compF g f = \ b e -> g b . f e
--- But I haven't figured out how (~>).
+-- But I haven't figured out how to.
--- comp7 :: Arrow (~>) => b~>(c~>d) -> e~>(d~>f)
--- -> b~>(e~>(c~>f))
+-- comp7 :: Arrow to => b `to` (c `to` d) -> e `to` (d `to` f)
+-- -> b `to` (e `to` (c `to` f))
-- comp7 g f = proc b -> proc e -> do
-- g' <- g -< b
-- f' <- f -< e
@@ -117,29 +117,29 @@ compF g f = \ b e -> g b . f e
-- (| lam (\ b -> undefined) |)
-- Oh! The arrow syntax allows bindings with *infix* operators. And I
--- don't know how (~>) finish comp7.
+-- don't know how to finish comp7.
-- Uncurried forms:
-comp8 :: Arrow (~>) => (b,c)~>d -> (e,d)~>k -> (b,c,e)~>k
+comp8 :: Arrow to => (b,c) `to` d -> (e,d) `to` k -> (b,c,e) `to` k
comp8 g f = proc (b,c,e) -> do
d <- g -< (b,c)
f -< (e,d)
--- This looks like straightforward~>translation. With insertions of
--- curry & uncurry operators, it'd probably be easy (~>) handle curried
+-- This looks like straightforward `to` translation. With insertions of
+-- curry & uncurry operators, it'd probably be easy to handle curried
-- definitions as well.
-- Simpler example, for experimentation
-comp9 :: Arrow (~>) => (c,d)~>e -> b~>d -> (b,c)~>e
+comp9 :: Arrow to => (c,d) `to` e -> b `to` d -> (b,c) `to` e
comp9 g f = proc (b,c) -> do
d <- f -< b
g -< (c,d)
-- Desugared:
-comp9' :: Arrow (~>) => (c,d)~>e -> b~>d -> (b,c)~>e
+comp9' :: Arrow to => (c,d) `to` e -> b `to` d -> (b,c) `to` e
comp9' g f = first f >>> arr (\ (d,c) -> (c,d)) >>> g
diff --git a/testsuite/tests/typecheck/should_compile/tc261.hs b/testsuite/tests/typecheck/should_compile/tc261.hs
new file mode 100644
index 0000000000..3269c7ea82
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/tc261.hs
@@ -0,0 +1,4 @@
+{-# LANGUAGE TypeOperators #-}
+module TcOK where
+
+newtype (f <.> g) a = Compose (f (g a))
diff --git a/testsuite/tests/typecheck/should_fail/tcfail094.stderr b/testsuite/tests/typecheck/should_fail/tcfail094.stderr
index 8cd67b632b..c5dcc172d5 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail094.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail094.stderr
@@ -1,2 +1,3 @@
-tcfail094.hs:7:14: parse error on input `1'
+tcfail094.hs:7:14:
+ Illegal literal in type (use -XDataKinds to enable): 1
diff --git a/testsuite/tests/typecheck/should_fail/tcfail173.stderr b/testsuite/tests/typecheck/should_fail/tcfail173.stderr
index ee8f59b525..4bda7d5c4c 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail173.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail173.stderr
@@ -1,3 +1,4 @@
-tcfail173.hs:5:10:
- Malformed head of type or class declaration: (f <.> g) a
+tcfail173.hs:5:12:
+ Illegal declaration of a type or class operator `<.>'
+ Use -XTypeOperators to declare operators in type and declarations