summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/indexed-types/should_compile/T10340.hs17
-rw-r--r--testsuite/tests/indexed-types/should_compile/all.T1
-rw-r--r--testsuite/tests/indexed-types/should_fail/ExtraTcsUntch.stderr16
-rw-r--r--testsuite/tests/indexed-types/should_fail/T4093a.hs92
-rw-r--r--testsuite/tests/indexed-types/should_fail/T4093a.stderr18
-rw-r--r--testsuite/tests/indexed-types/should_fail/T4254.stderr4
-rw-r--r--testsuite/tests/indexed-types/should_fail/T7729.stderr4
-rw-r--r--testsuite/tests/indexed-types/should_fail/T9662.stderr72
-rw-r--r--testsuite/tests/module/mod71.stderr14
-rw-r--r--testsuite/tests/typecheck/should_compile/FD3.hs39
-rw-r--r--testsuite/tests/typecheck/should_compile/FD3.stderr19
-rw-r--r--testsuite/tests/typecheck/should_compile/Improvement.hs17
-rw-r--r--testsuite/tests/typecheck/should_compile/T10009.hs62
-rw-r--r--testsuite/tests/typecheck/should_compile/all.T2
-rw-r--r--testsuite/tests/typecheck/should_fail/FDsFromGivens.hs21
-rw-r--r--testsuite/tests/typecheck/should_fail/FDsFromGivens.stderr31
-rw-r--r--testsuite/tests/typecheck/should_fail/FDsFromGivens2.hs14
-rw-r--r--testsuite/tests/typecheck/should_fail/FDsFromGivens2.stderr14
-rw-r--r--testsuite/tests/typecheck/should_fail/T1899.stderr26
-rw-r--r--testsuite/tests/typecheck/should_fail/T5246.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/T5570.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/T5689.stderr26
-rw-r--r--testsuite/tests/typecheck/should_fail/T5691.hs2
-rw-r--r--testsuite/tests/typecheck/should_fail/T5691.stderr46
-rw-r--r--testsuite/tests/typecheck/should_fail/T5978.stderr8
-rw-r--r--testsuite/tests/typecheck/should_fail/T7368.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/T7368a.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/T7453.stderr90
-rw-r--r--testsuite/tests/typecheck/should_fail/T7696.stderr18
-rw-r--r--testsuite/tests/typecheck/should_fail/T8142.stderr26
-rw-r--r--testsuite/tests/typecheck/should_fail/T8262.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/T8603.stderr51
-rw-r--r--testsuite/tests/typecheck/should_fail/T9612.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/all.T1
-rw-r--r--testsuite/tests/typecheck/should_fail/mc25.stderr4
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail090.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail122.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail123.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail143.stderr6
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail159.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail200.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail201.stderr4
42 files changed, 441 insertions, 346 deletions
diff --git a/testsuite/tests/indexed-types/should_compile/T10340.hs b/testsuite/tests/indexed-types/should_compile/T10340.hs
new file mode 100644
index 0000000000..c35c7150ce
--- /dev/null
+++ b/testsuite/tests/indexed-types/should_compile/T10340.hs
@@ -0,0 +1,17 @@
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE FlexibleInstances #-}
+
+module T10340 where
+
+import GHC.Exts (Any)
+
+class MonadState s m where
+ get :: m s
+
+newtype State s a = State (s -> (s, a))
+
+instance MonadState s (State s) where
+ get = State $ \s -> (s, s)
+
+foo :: State Any Any
+foo = get
diff --git a/testsuite/tests/indexed-types/should_compile/all.T b/testsuite/tests/indexed-types/should_compile/all.T
index 67309249d4..1cd1ea261a 100644
--- a/testsuite/tests/indexed-types/should_compile/all.T
+++ b/testsuite/tests/indexed-types/should_compile/all.T
@@ -253,4 +253,5 @@ test('T9090', normal, compile, [''])
test('T10020', normal, compile, [''])
test('T10079', normal, compile, [''])
test('T10139', normal, compile, [''])
+test('T10340', normal, compile, [''])
diff --git a/testsuite/tests/indexed-types/should_fail/ExtraTcsUntch.stderr b/testsuite/tests/indexed-types/should_fail/ExtraTcsUntch.stderr
index 13f9911e6c..b551f39d4c 100644
--- a/testsuite/tests/indexed-types/should_fail/ExtraTcsUntch.stderr
+++ b/testsuite/tests/indexed-types/should_fail/ExtraTcsUntch.stderr
@@ -1,16 +1,18 @@
-ExtraTcsUntch.hs:23:18:
- Couldn't match expected type ‘F Int’ with actual type ‘[t]’
+ExtraTcsUntch.hs:23:18: error:
+ Couldn't match expected type ‘F Int’ with actual type ‘[[t]]’
Relevant bindings include
- x :: t (bound at ExtraTcsUntch.hs:21:3)
- f :: t -> ((), ((), ())) (bound at ExtraTcsUntch.hs:21:1)
+ x :: [t] (bound at ExtraTcsUntch.hs:21:3)
+ f :: [t] -> ((), ((), ())) (bound at ExtraTcsUntch.hs:21:1)
In the first argument of ‘h’, namely ‘[x]’
In the expression: h [x]
In an equation for ‘g1’: g1 _ = h [x]
-ExtraTcsUntch.hs:25:38:
- Couldn't match expected type ‘F Int’ with actual type ‘[[t0]]’
- The type variable ‘t0’ is ambiguous
+ExtraTcsUntch.hs:25:38: error:
+ Couldn't match expected type ‘F Int’ with actual type ‘[[t]]’
+ Relevant bindings include
+ x :: [t] (bound at ExtraTcsUntch.hs:21:3)
+ f :: [t] -> ((), ((), ())) (bound at ExtraTcsUntch.hs:21:1)
In the first argument of ‘h’, namely ‘[[undefined]]’
In the expression: h [[undefined]]
In the expression: (h [[undefined]], op x [y])
diff --git a/testsuite/tests/indexed-types/should_fail/T4093a.hs b/testsuite/tests/indexed-types/should_fail/T4093a.hs
index 8bc26d69d3..fc611684d4 100644
--- a/testsuite/tests/indexed-types/should_fail/T4093a.hs
+++ b/testsuite/tests/indexed-types/should_fail/T4093a.hs
@@ -1,45 +1,47 @@
-{-# LANGUAGE TypeFamilies #-}
-module T4093a where
-
-type family Foo x
-type instance Foo () = Maybe ()
-
-hang :: (Foo e ~ Maybe e) => Foo e
-hang = Just ()
-
-
-{- Ambiguity check
-
- [G] Foo e ~ Maybe e
- [W] Foo e ~ Foo e0
- [W] Foo e0 ~ Maybe e0
----
- [G] Foo e ~ fsk
- [G] fsk ~ Maybe e
-
- [W] Foo e ~ fmv1
- [W] Foo e0 ~ fmv2
- [W] fmv1 ~ fmv2
- [W] fmv2 ~ Maybe e0
-
----> fmv1 := fsk
- [G] Foo e ~ fsk
- [G] fsk ~ Maybe e
-
- [W] Foo e0 ~ fmv2
- [W] fsk ~ fmv2
- [W] fmv2 ~ Maybe e0
-
---->
- [G] Foo e ~ fsk
- [G] fsk ~ Maybe e
-
- [W] Foo e0 ~ fmv2
- [W] fmv2 ~ Maybe e
- [W] fmv2 ~ Maybe e0
-
-Now the question is whether we get a derived equality e ~ e0. Currently
-we don't, but we easily could. But then we'd need to be careful not to
-report insoluble Int ~ Bool if we had
- F a ~ Int, F a ~ Bool
--} \ No newline at end of file
+{-# LANGUAGE TypeFamilies #-}
+module T4093a where
+
+type family Foo x
+type instance Foo () = Maybe ()
+
+hang :: (Foo e ~ Maybe e) => Foo e
+hang = Just ()
+
+-- Type is not ambiguous; should get a complaint
+-- for (e ~ ()) arising from the Just ()
+
+{- Ambiguity check
+
+ [G] Foo e ~ Maybe e
+ [W] Foo e ~ Foo e0
+ [W] Foo e0 ~ Maybe e0
+---
+ [G] Foo e ~ fsk
+ [G] fsk ~ Maybe e
+
+ [W] Foo e ~ fmv1
+ [W] Foo e0 ~ fmv2
+ [W] fmv1 ~ fmv2
+ [W] fmv2 ~ Maybe e0
+
+---> fmv1 := fsk
+ [G] Foo e ~ fsk
+ [G] fsk ~ Maybe e
+
+ [W] Foo e0 ~ fmv2
+ [W] fsk ~ fmv2
+ [W] fmv2 ~ Maybe e0
+
+--->
+ [G] Foo e ~ fsk
+ [G] fsk ~ Maybe e
+
+ [W] Foo e0 ~ fmv2
+ [W] fmv2 ~ Maybe e
+ [W] fmv2 ~ Maybe e0
+
+Now the question is whether we get a derived equality e ~ e0. Currently
+we don't, but we easily could. But then we'd need to be careful not to
+report insoluble Int ~ Bool if we had
+ F a ~ Int, F a ~ Bool
+-}
diff --git a/testsuite/tests/indexed-types/should_fail/T4093a.stderr b/testsuite/tests/indexed-types/should_fail/T4093a.stderr
index 0228a88edf..b1810d3096 100644
--- a/testsuite/tests/indexed-types/should_fail/T4093a.stderr
+++ b/testsuite/tests/indexed-types/should_fail/T4093a.stderr
@@ -1,14 +1,14 @@
-T4093a.hs:7:9:
- Could not deduce: Foo e0 ~ Maybe e
+T4093a.hs:8:8: error:
+ Could not deduce: e ~ ()
from the context: Foo e ~ Maybe e
bound by the type signature for: hang :: (Foo e ~ Maybe e) => Foo e
at T4093a.hs:7:9-34
- The type variable ‘e0’ is ambiguous
+ ‘e’ is a rigid type variable bound by
+ the type signature for: hang :: (Foo e ~ Maybe e) => Foo e
+ at T4093a.hs:7:9
Expected type: Foo e
- Actual type: Foo e0
- In the ambiguity check for the type signature for ‘hang’:
- hang :: forall e. (Foo e ~ Maybe e) => Foo e
- To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
- In the type signature for ‘hang’:
- hang :: (Foo e ~ Maybe e) => Foo e
+ Actual type: Maybe ()
+ Relevant bindings include hang :: Foo e (bound at T4093a.hs:8:1)
+ In the expression: Just ()
+ In an equation for ‘hang’: hang = Just ()
diff --git a/testsuite/tests/indexed-types/should_fail/T4254.stderr b/testsuite/tests/indexed-types/should_fail/T4254.stderr
index e69de29bb2..e22fd380ef 100644
--- a/testsuite/tests/indexed-types/should_fail/T4254.stderr
+++ b/testsuite/tests/indexed-types/should_fail/T4254.stderr
@@ -0,0 +1,4 @@
+
+T4254.hs:18:10: warning:
+ Redundant constraint: FD a b
+ In the type signature for: fails :: (a ~ Int, FD a b) => a -> Bool
diff --git a/testsuite/tests/indexed-types/should_fail/T7729.stderr b/testsuite/tests/indexed-types/should_fail/T7729.stderr
index 053d54e264..7be5d5764c 100644
--- a/testsuite/tests/indexed-types/should_fail/T7729.stderr
+++ b/testsuite/tests/indexed-types/should_fail/T7729.stderr
@@ -1,6 +1,6 @@
-T7729.hs:36:14:
- Couldn't match type ‘t0 (BasePrimMonad m)’ with ‘BasePrimMonad m’
+T7729.hs:36:14: error:
+ Couldn't match type ‘BasePrimMonad m’ with ‘t0 (BasePrimMonad m)’
The type variable ‘t0’ is ambiguous
Expected type: t0 (BasePrimMonad m) a -> Rand m a
Actual type: BasePrimMonad (Rand m) a -> Rand m a
diff --git a/testsuite/tests/indexed-types/should_fail/T9662.stderr b/testsuite/tests/indexed-types/should_fail/T9662.stderr
index 3093abb1a7..e37e4e907d 100644
--- a/testsuite/tests/indexed-types/should_fail/T9662.stderr
+++ b/testsuite/tests/indexed-types/should_fail/T9662.stderr
@@ -1,25 +1,25 @@
-T9662.hs:49:7:
- Couldn't match type ‘k’ with ‘n’
+T9662.hs:47:8: error:
+ Couldn't match type ‘k’ with ‘Int’
‘k’ is a rigid type variable bound by
the type signature for:
test :: Shape (((sh :. k) :. m) :. n)
-> Shape (((sh :. m) :. n) :. k)
at T9662.hs:44:9
- ‘n’ is a rigid type variable bound by
- the type signature for:
- test :: Shape (((sh :. k) :. m) :. n)
- -> Shape (((sh :. m) :. n) :. k)
- at T9662.hs:44:9
- Expected type: Exp (((sh :. m) :. n) :. k)
- -> Exp (((sh :. k) :. m) :. n)
- Actual type: Exp (((sh :. k) :. m) :. n)
- -> Exp (((sh :. k) :. m) :. n)
+ Expected type: Exp (((sh :. k) :. m) :. n)
+ -> Exp (((sh :. m) :. n) :. k)
+ Actual type: Exp
+ (Tuple (((Atom a0 :. Atom Int) :. Atom Int) :. Atom Int))
+ -> Exp
+ (Plain (((Unlifted (Atom a0) :. Exp Int) :. Exp Int) :. Exp Int))
Relevant bindings include
test :: Shape (((sh :. k) :. m) :. n)
-> Shape (((sh :. m) :. n) :. k)
(bound at T9662.hs:45:1)
- In the second argument of ‘backpermute’, namely ‘id’
+ In the first argument of ‘backpermute’, namely
+ ‘(modify
+ (atom :. atom :. atom :. atom)
+ (\ (sh :. k :. m :. n) -> (sh :. m :. n :. k)))’
In the expression:
backpermute
(modify
@@ -27,27 +27,27 @@ T9662.hs:49:7:
(\ (sh :. k :. m :. n) -> (sh :. m :. n :. k)))
id
-T9662.hs:49:7:
- Couldn't match type ‘m’ with ‘k’
+T9662.hs:47:8: error:
+ Couldn't match type ‘m’ with ‘Int’
‘m’ is a rigid type variable bound by
the type signature for:
test :: Shape (((sh :. k) :. m) :. n)
-> Shape (((sh :. m) :. n) :. k)
at T9662.hs:44:9
- ‘k’ is a rigid type variable bound by
- the type signature for:
- test :: Shape (((sh :. k) :. m) :. n)
- -> Shape (((sh :. m) :. n) :. k)
- at T9662.hs:44:9
- Expected type: Exp (((sh :. m) :. n) :. k)
- -> Exp (((sh :. k) :. m) :. n)
- Actual type: Exp (((sh :. k) :. m) :. n)
- -> Exp (((sh :. k) :. m) :. n)
+ Expected type: Exp (((sh :. k) :. m) :. n)
+ -> Exp (((sh :. m) :. n) :. k)
+ Actual type: Exp
+ (Tuple (((Atom a0 :. Atom Int) :. Atom Int) :. Atom Int))
+ -> Exp
+ (Plain (((Unlifted (Atom a0) :. Exp Int) :. Exp Int) :. Exp Int))
Relevant bindings include
test :: Shape (((sh :. k) :. m) :. n)
-> Shape (((sh :. m) :. n) :. k)
(bound at T9662.hs:45:1)
- In the second argument of ‘backpermute’, namely ‘id’
+ In the first argument of ‘backpermute’, namely
+ ‘(modify
+ (atom :. atom :. atom :. atom)
+ (\ (sh :. k :. m :. n) -> (sh :. m :. n :. k)))’
In the expression:
backpermute
(modify
@@ -55,27 +55,27 @@ T9662.hs:49:7:
(\ (sh :. k :. m :. n) -> (sh :. m :. n :. k)))
id
-T9662.hs:49:7:
- Couldn't match type ‘n’ with ‘m’
+T9662.hs:47:8: error:
+ Couldn't match type ‘n’ with ‘Int’
‘n’ is a rigid type variable bound by
the type signature for:
test :: Shape (((sh :. k) :. m) :. n)
-> Shape (((sh :. m) :. n) :. k)
at T9662.hs:44:9
- ‘m’ is a rigid type variable bound by
- the type signature for:
- test :: Shape (((sh :. k) :. m) :. n)
- -> Shape (((sh :. m) :. n) :. k)
- at T9662.hs:44:9
- Expected type: Exp (((sh :. m) :. n) :. k)
- -> Exp (((sh :. k) :. m) :. n)
- Actual type: Exp (((sh :. k) :. m) :. n)
- -> Exp (((sh :. k) :. m) :. n)
+ Expected type: Exp (((sh :. k) :. m) :. n)
+ -> Exp (((sh :. m) :. n) :. k)
+ Actual type: Exp
+ (Tuple (((Atom a0 :. Atom Int) :. Atom Int) :. Atom Int))
+ -> Exp
+ (Plain (((Unlifted (Atom a0) :. Exp Int) :. Exp Int) :. Exp Int))
Relevant bindings include
test :: Shape (((sh :. k) :. m) :. n)
-> Shape (((sh :. m) :. n) :. k)
(bound at T9662.hs:45:1)
- In the second argument of ‘backpermute’, namely ‘id’
+ In the first argument of ‘backpermute’, namely
+ ‘(modify
+ (atom :. atom :. atom :. atom)
+ (\ (sh :. k :. m :. n) -> (sh :. m :. n :. k)))’
In the expression:
backpermute
(modify
diff --git a/testsuite/tests/module/mod71.stderr b/testsuite/tests/module/mod71.stderr
index 12962aa473..53d697e133 100644
--- a/testsuite/tests/module/mod71.stderr
+++ b/testsuite/tests/module/mod71.stderr
@@ -1,20 +1,12 @@
-mod71.hs:4:9:
+mod71.hs:4:9: error:
Found hole ‘_’ with type: t1
Where: ‘t1’ is a rigid type variable bound by
- the inferred type of f :: (t1 -> a -> t) -> t at mod71.hs:4:1
+ the inferred type of f :: Num a => (t1 -> a -> t) -> t
+ at mod71.hs:4:1
Relevant bindings include
x :: t1 -> a -> t (bound at mod71.hs:4:3)
f :: (t1 -> a -> t) -> t (bound at mod71.hs:4:1)
In the first argument of ‘x’, namely ‘_’
In the expression: x _ 1
In an equation for ‘f’: f x = x _ 1
-
-mod71.hs:4:11:
- No instance for (Num a) arising from the literal ‘1’
- Possible fix:
- add (Num a) to the context of
- the inferred type of f :: (t1 -> a -> t) -> t
- In the second argument of ‘x’, namely ‘1’
- In the expression: x _ 1
- In an equation for ‘f’: f x = x _ 1
diff --git a/testsuite/tests/typecheck/should_compile/FD3.hs b/testsuite/tests/typecheck/should_compile/FD3.hs
index 333c0c31dd..a2f7d003a7 100644
--- a/testsuite/tests/typecheck/should_compile/FD3.hs
+++ b/testsuite/tests/typecheck/should_compile/FD3.hs
@@ -1,15 +1,24 @@
-{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances #-}
-
--- Trac #1795
-
-module ShouldCompile where
-
-data A a = A
-
-class MkA a b | a -> b where
- mkA :: a -> A b
-
-instance MkA a a where
-
-translate :: (String, a) -> A a
-translate a = mkA a
+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances #-}
+
+-- Trac #1795
+
+module ShouldCompile where
+
+data A a = A
+
+class MkA a b | a -> b where
+ mkA :: a -> A b
+
+instance MkA a a where
+
+translate :: (String, a) -> A a
+translate a = mkA a
+
+{- From the call to mkA
+
+[W] MkA alpha beta
+[W] alpha ~ (String,a)
+[W] A beta ~ A a
+
+==> beta:=a, alpha:=(String,a)
+-}
diff --git a/testsuite/tests/typecheck/should_compile/FD3.stderr b/testsuite/tests/typecheck/should_compile/FD3.stderr
index 3bed15a490..179fda19e6 100644
--- a/testsuite/tests/typecheck/should_compile/FD3.stderr
+++ b/testsuite/tests/typecheck/should_compile/FD3.stderr
@@ -1,14 +1,5 @@
-
-FD3.hs:15:15:
- Couldn't match type ‘a’ with ‘(String, a)’
- ‘a’ is a rigid type variable bound by
- the type signature for: translate :: (String, a) -> A a
- at FD3.hs:14:14
- arising from a functional dependency between:
- constraint ‘MkA (String, a) a’ arising from a use of ‘mkA’
- instance ‘MkA a1 a1’ at FD3.hs:12:10-16
- Relevant bindings include
- a :: (String, a) (bound at FD3.hs:15:11)
- translate :: (String, a) -> A a (bound at FD3.hs:15:1)
- In the expression: mkA a
- In an equation for ‘translate’: translate a = mkA a
+
+FD3.hs:15:15: error:
+ No instance for (MkA (String, a) a) arising from a use of ‘mkA’
+ In the expression: mkA a
+ In an equation for ‘translate’: translate a = mkA a
diff --git a/testsuite/tests/typecheck/should_compile/Improvement.hs b/testsuite/tests/typecheck/should_compile/Improvement.hs
new file mode 100644
index 0000000000..fba84ffdec
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/Improvement.hs
@@ -0,0 +1,17 @@
+{-# LANGUAGE TypeFamilies, FlexibleContexts, MultiParamTypeClasses, FlexibleInstances #-}
+{-# OPTIONS_GHC -fno-warn-redundant-constraints #-}
+module Foo where
+
+type family F a
+type instance F Int = Bool
+
+class C a b where
+
+instance (b~Int) => C Bool b
+
+blug :: C (F a) a => a -> F a
+blug = error "Urk"
+
+foo :: Bool
+foo = blug undefined
+
diff --git a/testsuite/tests/typecheck/should_compile/T10009.hs b/testsuite/tests/typecheck/should_compile/T10009.hs
new file mode 100644
index 0000000000..aae8a4c364
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T10009.hs
@@ -0,0 +1,62 @@
+{-# LANGUAGE TypeFamilies, ScopedTypeVariables #-}
+{-# OPTIONS_GHC -fno-warn-redundant-constraints #-}
+module T10009 where
+
+
+type family F a
+type family UnF a
+
+f :: (UnF (F b) ~ b) => F b -> ()
+f = error "urk"
+
+g :: forall a. (UnF (F a) ~ a) => a -> ()
+g _ = f (undefined :: F a)
+
+
+{- ---------------
+[G] UnF (F a) ~ a
+
+[W] UnF (F beta) ~ beta
+[W] F a ~ F beta
+
+-------------------
+[G] g1: F a ~ fsk1 fsk1 := F a
+[G] g2: UnF fsk1 ~ fsk2 fsk2 := UnF fsk1
+[G] g3: fsk2 ~ a
+
+[W] w1: F beta ~ fmv1
+[W] w2: UnF fmv1 ~ fmv2
+[W] w3: fmv2 ~ beta
+[W] w5: fsk1 ~ fmv1 -- From F a ~ F beta
+ -- using flat-cache
+
+---- No progress in solving -----
+-- Unflatten:
+
+[W] w3: UnF (F beta) ~ beta
+[W] w5: fsk1 ~ F beta
+
+--- Improvement
+
+[D] F beta ~ fmv1
+[D] UnF fmv1 ~ fmv2 -- (A)
+[D] fmv2 ~ beta
+[D] fmv1 ~ fsk1 -- (B) From F a ~ F beta
+ -- NB: put fmv on left
+
+--> rewrite (A) with (B), and metch with g2
+
+[D] F beta ~ fmv1
+[D] fmv2 ~ fsk2 -- (C)
+[D] fmv2 ~ beta -- (D)
+[D] fmv1 ~ fsk1
+
+--> rewrite (D) with (C) and re-orient
+
+[D] F beta ~ fmv1
+[D] fmv2 ~ fsk2
+[D] beta ~ fsk2 -- (E)
+[D] fmv1 ~ fsk1
+
+-- Now we can unify beta!
+-}
diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T
index a151274a4d..72fe255680 100644
--- a/testsuite/tests/typecheck/should_compile/all.T
+++ b/testsuite/tests/typecheck/should_compile/all.T
@@ -451,3 +451,5 @@ test('T10195', normal, compile, [''])
test('T10109', normal, compile, [''])
test('TcCustomSolverSuper', normal, compile, [''])
test('T10335', normal, compile, [''])
+test('Improvement', normal, compile, [''])
+test('T10009', normal, compile, [''])
diff --git a/testsuite/tests/typecheck/should_fail/FDsFromGivens.hs b/testsuite/tests/typecheck/should_fail/FDsFromGivens.hs
index 923dfa1bd9..591c3bcca9 100644
--- a/testsuite/tests/typecheck/should_fail/FDsFromGivens.hs
+++ b/testsuite/tests/typecheck/should_fail/FDsFromGivens.hs
@@ -1,24 +1,11 @@
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleContexts, GADTs #-}
-module FDsFromGivens where
+module FDsFromGivens where
-class C a b | a -> b where
+class C a b | a -> b where
cop :: a -> b -> ()
-
-data KCC where
- KCC :: C Char Char => () -> KCC
-
-
-{- Failing, as it righteously should!
-g1 :: (C Char [a], C Char Bool) => a -> ()
+{- Failing, as it righteously should! It's inaccessible code -}
+g1 :: (C Char [a], C Char Bool) => a -> ()
g1 x = ()
--}
-
-f :: C Char [a] => a -> a
-f = undefined
-
-bar (KCC _) = f
-
- \ No newline at end of file
diff --git a/testsuite/tests/typecheck/should_fail/FDsFromGivens.stderr b/testsuite/tests/typecheck/should_fail/FDsFromGivens.stderr
index 52e8d8a4eb..a2a9928181 100644
--- a/testsuite/tests/typecheck/should_fail/FDsFromGivens.stderr
+++ b/testsuite/tests/typecheck/should_fail/FDsFromGivens.stderr
@@ -1,14 +1,17 @@
-
-FDsFromGivens.hs:21:15:
- Couldn't match type ‘Char’ with ‘[a]’
- arising from a functional dependency between constraints:
- ‘C Char [a]’ arising from a use of ‘f’ at FDsFromGivens.hs:21:15
- ‘C Char Char’
- arising from a pattern with constructor:
- KCC :: C Char Char => () -> KCC,
- in an equation for ‘bar’
- at FDsFromGivens.hs:21:6-10
- Relevant bindings include
- bar :: KCC -> a -> a (bound at FDsFromGivens.hs:21:1)
- In the expression: f
- In an equation for ‘bar’: bar (KCC _) = f
+
+FDsFromGivens.hs:9:7: error:
+ Couldn't match type ‘[a]’ with ‘Bool’
+ arising from a functional dependency between constraints:
+ ‘C Char Bool’
+ arising from the type signature for:
+ g1 :: (C Char [a], C Char Bool) => a -> ()
+ at FDsFromGivens.hs:9:7-42
+ ‘C Char [a]’
+ arising from the type signature for:
+ g1 :: (C Char [a], C Char Bool) => a -> ()
+ at FDsFromGivens.hs:9:7-42
+ In the ambiguity check for the type signature for ‘g1’:
+ g1 :: forall a. (C Char [a], C Char Bool) => a -> ()
+ To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
+ In the type signature for ‘g1’:
+ g1 :: (C Char [a], C Char Bool) => a -> ()
diff --git a/testsuite/tests/typecheck/should_fail/FDsFromGivens2.hs b/testsuite/tests/typecheck/should_fail/FDsFromGivens2.hs
new file mode 100644
index 0000000000..83b6e32ccf
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/FDsFromGivens2.hs
@@ -0,0 +1,14 @@
+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleContexts, GADTs #-}
+
+module FDsFromGivens2 where
+
+class C a b | a -> b where
+ cop :: a -> b -> ()
+
+data KCC where
+ KCC :: C Char Char => () -> KCC
+
+f :: C Char [a] => a -> a
+f = undefined
+
+bar (KCC _) = f
diff --git a/testsuite/tests/typecheck/should_fail/FDsFromGivens2.stderr b/testsuite/tests/typecheck/should_fail/FDsFromGivens2.stderr
new file mode 100644
index 0000000000..a738c7ffa4
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/FDsFromGivens2.stderr
@@ -0,0 +1,14 @@
+
+FDsFromGivens2.hs:14:15: error:
+ Couldn't match type ‘Char’ with ‘[a]’
+ arising from a functional dependency between constraints:
+ ‘C Char [a]’ arising from a use of ‘f’ at FDsFromGivens2.hs:14:15
+ ‘C Char Char’
+ arising from a pattern with constructor:
+ KCC :: C Char Char => () -> KCC,
+ in an equation for ‘bar’
+ at FDsFromGivens2.hs:14:6-10
+ Relevant bindings include
+ bar :: KCC -> a -> a (bound at FDsFromGivens2.hs:14:1)
+ In the expression: f
+ In an equation for ‘bar’: bar (KCC _) = f
diff --git a/testsuite/tests/typecheck/should_fail/T1899.stderr b/testsuite/tests/typecheck/should_fail/T1899.stderr
index 37e7b23d73..1702afcafc 100644
--- a/testsuite/tests/typecheck/should_fail/T1899.stderr
+++ b/testsuite/tests/typecheck/should_fail/T1899.stderr
@@ -1,13 +1,13 @@
-
-T1899.hs:14:36:
- Couldn't match type ‘a’ with ‘Proposition a1’
- ‘a’ is a rigid type variable bound by
- the type signature for: transRHS :: [a] -> Int -> Constraint a
- at T1899.hs:9:14
- Expected type: [Proposition a1]
- Actual type: [a]
- Relevant bindings include
- varSet :: [a] (bound at T1899.hs:10:11)
- transRHS :: [a] -> Int -> Constraint a (bound at T1899.hs:10:2)
- In the first argument of ‘Auxiliary’, namely ‘varSet’
- In the first argument of ‘Prop’, namely ‘(Auxiliary varSet)’
+
+T1899.hs:14:36: error:
+ Couldn't match type ‘a’ with ‘Proposition a0’
+ ‘a’ is a rigid type variable bound by
+ the type signature for: transRHS :: [a] -> Int -> Constraint a
+ at T1899.hs:9:14
+ Expected type: [Proposition a0]
+ Actual type: [a]
+ Relevant bindings include
+ varSet :: [a] (bound at T1899.hs:10:11)
+ transRHS :: [a] -> Int -> Constraint a (bound at T1899.hs:10:2)
+ In the first argument of ‘Auxiliary’, namely ‘varSet’
+ In the first argument of ‘Prop’, namely ‘(Auxiliary varSet)’
diff --git a/testsuite/tests/typecheck/should_fail/T5246.stderr b/testsuite/tests/typecheck/should_fail/T5246.stderr
index 454c2b73b3..54d340cc5e 100644
--- a/testsuite/tests/typecheck/should_fail/T5246.stderr
+++ b/testsuite/tests/typecheck/should_fail/T5246.stderr
@@ -1,5 +1,5 @@
-T5246.hs:11:10:
+T5246.hs:11:10: error:
Couldn't match type ‘[Char]’ with ‘Int’
arising from a functional dependency between constraints:
‘?x::Int’ arising from a use of ‘foo’ at T5246.hs:11:10-12
diff --git a/testsuite/tests/typecheck/should_fail/T5570.stderr b/testsuite/tests/typecheck/should_fail/T5570.stderr
index 15d5c8a19e..45cdfd5679 100644
--- a/testsuite/tests/typecheck/should_fail/T5570.stderr
+++ b/testsuite/tests/typecheck/should_fail/T5570.stderr
@@ -1,5 +1,5 @@
-T5570.hs:7:16:
+T5570.hs:7:16: error:
Couldn't match kind ‘*’ with ‘#’
When matching types
r0 :: *
diff --git a/testsuite/tests/typecheck/should_fail/T5689.stderr b/testsuite/tests/typecheck/should_fail/T5689.stderr
index 211ec522a1..f8294f4705 100644
--- a/testsuite/tests/typecheck/should_fail/T5689.stderr
+++ b/testsuite/tests/typecheck/should_fail/T5689.stderr
@@ -1,32 +1,8 @@
-T5689.hs:10:36:
+T5689.hs:10:36: error:
Couldn't match expected type ‘Bool’ with actual type ‘t’
Relevant bindings include
v :: t (bound at T5689.hs:10:28)
r :: IORef (t -> t) (bound at T5689.hs:7:14)
In the expression: v
In the expression: if v then False else True
-
-T5689.hs:10:43:
- Couldn't match expected type ‘t’ with actual type ‘Bool’
- Relevant bindings include
- v :: t (bound at T5689.hs:10:28)
- r :: IORef (t -> t) (bound at T5689.hs:7:14)
- In the expression: False
- In the expression: if v then False else True
-
-T5689.hs:10:54:
- Couldn't match expected type ‘t’ with actual type ‘Bool’
- Relevant bindings include
- v :: t (bound at T5689.hs:10:28)
- r :: IORef (t -> t) (bound at T5689.hs:7:14)
- In the expression: True
- In the expression: if v then False else True
-
-T5689.hs:14:23:
- Couldn't match expected type ‘t’ with actual type ‘Bool’
- Relevant bindings include
- c :: t -> t (bound at T5689.hs:12:13)
- r :: IORef (t -> t) (bound at T5689.hs:7:14)
- In the first argument of ‘c’, namely ‘True’
- In the second argument of ‘($)’, namely ‘c True’
diff --git a/testsuite/tests/typecheck/should_fail/T5691.hs b/testsuite/tests/typecheck/should_fail/T5691.hs
index 49fc776eac..88cd3d7565 100644
--- a/testsuite/tests/typecheck/should_fail/T5691.hs
+++ b/testsuite/tests/typecheck/should_fail/T5691.hs
@@ -12,7 +12,7 @@ class Test p where
instance Test PrintRuleInterp where
test (f :: p a) =
- MkPRI $ printRule_ f
+ MkPRI $ printRule_ f
newtype RecDecParser a = MkRD {
diff --git a/testsuite/tests/typecheck/should_fail/T5691.stderr b/testsuite/tests/typecheck/should_fail/T5691.stderr
index b5bf71d959..132df4dacf 100644
--- a/testsuite/tests/typecheck/should_fail/T5691.stderr
+++ b/testsuite/tests/typecheck/should_fail/T5691.stderr
@@ -1,27 +1,19 @@
-
-T5691.hs:14:9:
- Couldn't match type ‘p’ with ‘PrintRuleInterp’
- Expected type: p a
- Actual type: PrintRuleInterp a
- When checking that the pattern signature: p a
- fits the type of its context: PrintRuleInterp a
- In the pattern: f :: p a
- In an equation for ‘test’: test (f :: p a) = MkPRI $ printRule_ f
-
-T5691.hs:15:24:
- Couldn't match type ‘p’ with ‘PrintRuleInterp’
- Expected type: PrintRuleInterp a
- Actual type: p a
- Relevant bindings include f :: p a (bound at T5691.hs:14:9)
- In the first argument of ‘printRule_’, namely ‘f’
- In the second argument of ‘($)’, namely ‘printRule_ f’
-
-T5691.hs:24:10:
- No instance for (Alternative RecDecParser)
- arising from the superclasses of an instance declaration
- In the instance declaration for ‘MonadPlus RecDecParser’
-
-T5691.hs:24:10:
- No instance for (Monad RecDecParser)
- arising from the superclasses of an instance declaration
- In the instance declaration for ‘MonadPlus RecDecParser’
+
+T5691.hs:14:9: error:
+ Couldn't match type ‘p’ with ‘PrintRuleInterp’
+ Expected type: p a
+ Actual type: PrintRuleInterp a
+ When checking that the pattern signature: p a
+ fits the type of its context: PrintRuleInterp a
+ In the pattern: f :: p a
+ In an equation for ‘test’: test (f :: p a) = MkPRI $ printRule_ f
+
+T5691.hs:24:10: error:
+ No instance for (Alternative RecDecParser)
+ arising from the superclasses of an instance declaration
+ In the instance declaration for ‘MonadPlus RecDecParser’
+
+T5691.hs:24:10: error:
+ No instance for (Monad RecDecParser)
+ arising from the superclasses of an instance declaration
+ In the instance declaration for ‘MonadPlus RecDecParser’
diff --git a/testsuite/tests/typecheck/should_fail/T5978.stderr b/testsuite/tests/typecheck/should_fail/T5978.stderr
index 263e68ba2d..9fae4e28fe 100644
--- a/testsuite/tests/typecheck/should_fail/T5978.stderr
+++ b/testsuite/tests/typecheck/should_fail/T5978.stderr
@@ -1,8 +1,8 @@
-T5978.hs:22:11:
- Couldn't match type ‘Bool’ with ‘Char’
+T5978.hs:22:11: error:
+ Couldn't match type ‘Char’ with ‘Bool’
arising from a functional dependency between:
- constraint ‘C Double Char’ arising from a use of ‘polyBar’
- instance ‘C Double Bool’ at T5978.hs:8:10-22
+ constraint ‘C Float Bool’ arising from a use of ‘polyBar’
+ instance ‘C Float Char’ at T5978.hs:7:10-21
In the expression: polyBar id monoFoo
In an equation for ‘monoBar’: monoBar = polyBar id monoFoo
diff --git a/testsuite/tests/typecheck/should_fail/T7368.stderr b/testsuite/tests/typecheck/should_fail/T7368.stderr
index 2a022645d8..c6c11e81b7 100644
--- a/testsuite/tests/typecheck/should_fail/T7368.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7368.stderr
@@ -1,5 +1,5 @@
-T7368.hs:3:10:
+T7368.hs:3:10: error:
Couldn't match kind ‘* -> *’ with ‘*’
When matching types
c0 :: (* -> *) -> *
diff --git a/testsuite/tests/typecheck/should_fail/T7368a.stderr b/testsuite/tests/typecheck/should_fail/T7368a.stderr
index 79396df9d7..7ee59e129e 100644
--- a/testsuite/tests/typecheck/should_fail/T7368a.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7368a.stderr
@@ -1,5 +1,5 @@
-T7368a.hs:8:6:
+T7368a.hs:8:6: error:
Couldn't match kind ‘*’ with ‘* -> *’
When matching types
f :: * -> *
diff --git a/testsuite/tests/typecheck/should_fail/T7453.stderr b/testsuite/tests/typecheck/should_fail/T7453.stderr
index 2b891773c4..0a0f73d47e 100644
--- a/testsuite/tests/typecheck/should_fail/T7453.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7453.stderr
@@ -1,45 +1,45 @@
-
-T7453.hs:10:30:
- Couldn't match expected type ‘t1’ with actual type ‘t’
- because type variable ‘t1’ would escape its scope
- This (rigid, skolem) type variable is bound by
- the type signature for: z :: Id t1
- at T7453.hs:8:16-19
- Relevant bindings include
- aux :: Id t1 (bound at T7453.hs:10:21)
- z :: Id t1 (bound at T7453.hs:9:11)
- v :: t (bound at T7453.hs:7:7)
- cast1 :: t -> a (bound at T7453.hs:7:1)
- In the first argument of ‘Id’, namely ‘v’
- In the expression: Id v
-
-T7453.hs:16:33:
- Couldn't match expected type ‘t2’ with actual type ‘t’
- because type variable ‘t2’ would escape its scope
- This (rigid, skolem) type variable is bound by
- the type signature for: z :: () -> t2
- at T7453.hs:14:16-22
- Relevant bindings include
- aux :: b -> t2 (bound at T7453.hs:16:21)
- z :: () -> t2 (bound at T7453.hs:15:11)
- v :: t (bound at T7453.hs:13:7)
- cast2 :: t -> t1 (bound at T7453.hs:13:1)
- In the first argument of ‘const’, namely ‘v’
- In the expression: const v
-
-T7453.hs:21:15:
- Couldn't match expected type ‘t1’ with actual type ‘a’
- because type variable ‘t1’ would escape its scope
- This (rigid, skolem) type variable is bound by
- the type signature for: z :: t1
- at T7453.hs:20:16
- Relevant bindings include
- aux :: forall b. b -> a (bound at T7453.hs:22:21)
- z :: t1 (bound at T7453.hs:21:11)
- v :: a (bound at T7453.hs:19:7)
- cast3 :: a -> t (bound at T7453.hs:19:1)
- In the expression: v
- In an equation for ‘z’:
- z = v
- where
- aux = const v
+
+T7453.hs:10:30: error:
+ Couldn't match expected type ‘t1’ with actual type ‘t’
+ because type variable ‘t1’ would escape its scope
+ This (rigid, skolem) type variable is bound by
+ the type signature for: z :: Id t1
+ at T7453.hs:8:16-19
+ Relevant bindings include
+ aux :: Id t1 (bound at T7453.hs:10:21)
+ z :: Id t1 (bound at T7453.hs:9:11)
+ v :: t (bound at T7453.hs:7:7)
+ cast1 :: t -> a (bound at T7453.hs:7:1)
+ In the first argument of ‘Id’, namely ‘v’
+ In the expression: Id v
+
+T7453.hs:16:33: error:
+ Couldn't match expected type ‘t2’ with actual type ‘t’
+ because type variable ‘t2’ would escape its scope
+ This (rigid, skolem) type variable is bound by
+ the type signature for: z :: () -> t2
+ at T7453.hs:14:16-22
+ Relevant bindings include
+ aux :: b -> t2 (bound at T7453.hs:16:21)
+ z :: () -> t2 (bound at T7453.hs:15:11)
+ v :: t (bound at T7453.hs:13:7)
+ cast2 :: t -> t1 (bound at T7453.hs:13:1)
+ In the first argument of ‘const’, namely ‘v’
+ In the expression: const v
+
+T7453.hs:21:15: error:
+ Couldn't match expected type ‘t2’ with actual type ‘t’
+ because type variable ‘t2’ would escape its scope
+ This (rigid, skolem) type variable is bound by
+ the type signature for: z :: t2
+ at T7453.hs:20:16
+ Relevant bindings include
+ aux :: forall b. b -> t2 (bound at T7453.hs:22:21)
+ z :: t2 (bound at T7453.hs:21:11)
+ v :: t (bound at T7453.hs:19:7)
+ cast3 :: t -> t1 (bound at T7453.hs:19:1)
+ In the expression: v
+ In an equation for ‘z’:
+ z = v
+ where
+ aux = const v
diff --git a/testsuite/tests/typecheck/should_fail/T7696.stderr b/testsuite/tests/typecheck/should_fail/T7696.stderr
index 65dfb79d2b..1fc2e43755 100644
--- a/testsuite/tests/typecheck/should_fail/T7696.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7696.stderr
@@ -1,7 +1,11 @@
-
-T7696.hs:7:6:
- Couldn't match type ‘m0 a0’ with ‘()’
- Expected type: ((), w ())
- Actual type: (m0 a0, t0 m0)
- In the expression: f1
- In an equation for ‘f2’: f2 = f1
+
+T7696.hs:7:6: error:
+ Couldn't match kind ‘* -> *’ with ‘*’
+ When matching types
+ t0 :: (* -> *) -> *
+ w :: * -> *
+ Expected type: ((), w ())
+ Actual type: (m0 a0, t0 m0)
+ Relevant bindings include f2 :: ((), w ()) (bound at T7696.hs:7:1)
+ In the expression: f1
+ In an equation for ‘f2’: f2 = f1
diff --git a/testsuite/tests/typecheck/should_fail/T8142.stderr b/testsuite/tests/typecheck/should_fail/T8142.stderr
index a084f7afcc..43a3a46be0 100644
--- a/testsuite/tests/typecheck/should_fail/T8142.stderr
+++ b/testsuite/tests/typecheck/should_fail/T8142.stderr
@@ -1,10 +1,24 @@
-T8142.hs:6:57:
- Couldn't match type ‘Nu ((,) t0)’ with ‘g0 (Nu ((,) t0))’
- The type variables ‘t0’, ‘g0’ are ambiguous
- Expected type: Nu ((,) t0) -> (t0, g0 (Nu ((,) t0)))
- Actual type: Nu ((,) t0) -> (t0, Nu ((,) t0))
+T8142.hs:6:18: error:
+ Couldn't match type ‘Nu g0’ with ‘Nu g’
+ NB: ‘Nu’ is a type function, and may not be injective
+ The type variable ‘g0’ is ambiguous
+ Expected type: Nu ((,) t) -> Nu g
+ Actual type: Nu ((,) t0) -> Nu g0
+ When checking that ‘h’ has the inferred type
+ h :: forall t (g :: * -> *). Nu ((,) t) -> Nu g
+ Probable cause: the inferred type is ambiguous
+ In an equation for ‘tracer’:
+ tracer
+ = h
+ where
+ h = (\ (_, b) -> ((outI . fmap h) b)) . out
+
+T8142.hs:6:57: error:
+ Couldn't match type ‘Nu ((,) t)’ with ‘g (Nu ((,) t))’
+ Expected type: Nu ((,) t) -> (t, g (Nu ((,) t)))
+ Actual type: Nu ((,) t) -> (t, Nu ((,) t))
Relevant bindings include
- h :: Nu ((,) t0) -> Nu g0 (bound at T8142.hs:6:18)
+ h :: Nu ((,) t) -> Nu g (bound at T8142.hs:6:18)
In the second argument of ‘(.)’, namely ‘out’
In the expression: (\ (_, b) -> ((outI . fmap h) b)) . out
diff --git a/testsuite/tests/typecheck/should_fail/T8262.stderr b/testsuite/tests/typecheck/should_fail/T8262.stderr
index cfaf5adafa..5d77a6cb4a 100644
--- a/testsuite/tests/typecheck/should_fail/T8262.stderr
+++ b/testsuite/tests/typecheck/should_fail/T8262.stderr
@@ -1,5 +1,5 @@
-T8262.hs:5:15:
+T8262.hs:5:15: error:
Couldn't match kind ‘*’ with ‘#’
When matching types
a :: *
diff --git a/testsuite/tests/typecheck/should_fail/T8603.stderr b/testsuite/tests/typecheck/should_fail/T8603.stderr
index 8e39968aac..2aaf55b3ff 100644
--- a/testsuite/tests/typecheck/should_fail/T8603.stderr
+++ b/testsuite/tests/typecheck/should_fail/T8603.stderr
@@ -1,30 +1,21 @@
-
-T8603.hs:13:10:
- No instance for (Applicative RV)
- arising from the superclasses of an instance declaration
- In the instance declaration for ‘Monad RV’
-
-T8603.hs:29:17:
- Couldn't match kind ‘* -> *’ with ‘*’
- When matching types
- t1 :: (* -> *) -> * -> *
- (->) :: * -> * -> *
- Expected type: [Integer] -> StateT s RV t0
- Actual type: t1 ((->) [a0]) (StateT s RV t0)
- The function ‘lift’ is applied to two arguments,
- but its type ‘([a0] -> StateT s RV t0)
- -> t1 ((->) [a0]) (StateT s RV t0)’
- has only one
- In a stmt of a 'do' block: prize <- lift uniform [1, 2, 3]
- In the expression:
- do { prize <- lift uniform [1, 2, ....];
- return False }
-
-T8603.hs:29:22:
- Couldn't match type ‘RV a0’ with ‘StateT s RV t0’
- Expected type: [a0] -> StateT s RV t0
- Actual type: [a0] -> RV a0
- Relevant bindings include
- testRVState1 :: RVState s Bool (bound at T8603.hs:28:1)
- In the first argument of ‘lift’, namely ‘uniform’
- In a stmt of a 'do' block: prize <- lift uniform [1, 2, 3]
+
+T8603.hs:13:10: error:
+ No instance for (Applicative RV)
+ arising from the superclasses of an instance declaration
+ In the instance declaration for ‘Monad RV’
+
+T8603.hs:29:17: error:
+ Couldn't match kind ‘* -> *’ with ‘*’
+ When matching types
+ t1 :: (* -> *) -> * -> *
+ (->) :: * -> * -> *
+ Expected type: [Integer] -> StateT s RV t0
+ Actual type: t1 ((->) [a0]) (StateT s RV t0)
+ The function ‘lift’ is applied to two arguments,
+ but its type ‘([a0] -> StateT s RV t0)
+ -> t1 ((->) [a0]) (StateT s RV t0)’
+ has only one
+ In a stmt of a 'do' block: prize <- lift uniform [1, 2, 3]
+ In the expression:
+ do { prize <- lift uniform [1, 2, ....];
+ return False }
diff --git a/testsuite/tests/typecheck/should_fail/T9612.stderr b/testsuite/tests/typecheck/should_fail/T9612.stderr
index 823fee112c..bffceb0baa 100644
--- a/testsuite/tests/typecheck/should_fail/T9612.stderr
+++ b/testsuite/tests/typecheck/should_fail/T9612.stderr
@@ -1,5 +1,5 @@
-T9612.hs:16:9:
+T9612.hs:16:9: error:
Couldn't match type ‘[(Int, a)]’ with ‘(Int, a)’
arising from a functional dependency between:
constraint ‘MonadWriter (Int, a) (WriterT [(Int, a)] Identity)’
diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T
index 110f29f465..faca0791a4 100644
--- a/testsuite/tests/typecheck/should_fail/all.T
+++ b/testsuite/tests/typecheck/should_fail/all.T
@@ -278,6 +278,7 @@ test('T6022', normal, compile_fail, [''])
test('T5853', normal, compile_fail, [''])
test('T6078', normal, compile_fail, [''])
test('FDsFromGivens', normal, compile_fail, [''])
+test('FDsFromGivens2', normal, compile_fail, [''])
test('T7019', normal, compile_fail,[''])
test('T7019a', normal, compile_fail,[''])
test('T5978', normal, compile_fail, [''])
diff --git a/testsuite/tests/typecheck/should_fail/mc25.stderr b/testsuite/tests/typecheck/should_fail/mc25.stderr
index 83fe1301d6..ec88439e89 100644
--- a/testsuite/tests/typecheck/should_fail/mc25.stderr
+++ b/testsuite/tests/typecheck/should_fail/mc25.stderr
@@ -1,5 +1,5 @@
-mc25.hs:9:10:
+mc25.hs:9:10: error:
No instance for (Functor t1) arising from a use of ‘fmap’
Possible fix:
add (Functor t1) to the context of
@@ -9,7 +9,7 @@ mc25.hs:9:10:
In a stmt of a monad comprehension: then group by x using take
In the expression: [x | x <- [1 .. 10], then group by x using take]
-mc25.hs:9:46:
+mc25.hs:9:46: error:
Couldn't match type ‘a -> t’ with ‘Int’
Expected type: (a -> t) -> [a] -> [t1 a]
Actual type: Int -> [t1 a] -> [t1 a]
diff --git a/testsuite/tests/typecheck/should_fail/tcfail090.stderr b/testsuite/tests/typecheck/should_fail/tcfail090.stderr
index 37f96659cc..6c6f97d932 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail090.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail090.stderr
@@ -1,5 +1,5 @@
-tcfail090.hs:11:9:
+tcfail090.hs:11:9: error:
Couldn't match kind ‘*’ with ‘#’
When matching types
a0 :: *
diff --git a/testsuite/tests/typecheck/should_fail/tcfail122.stderr b/testsuite/tests/typecheck/should_fail/tcfail122.stderr
index 6ad75f49ca..fdd444d1fc 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail122.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail122.stderr
@@ -1,5 +1,5 @@
-tcfail122.hs:8:9:
+tcfail122.hs:8:9: error:
Couldn't match kind ‘* -> *’ with ‘*’
When matching types
c0 :: (* -> *) -> *
diff --git a/testsuite/tests/typecheck/should_fail/tcfail123.stderr b/testsuite/tests/typecheck/should_fail/tcfail123.stderr
index 9f5cc09bdf..396d63c9f8 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail123.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail123.stderr
@@ -1,5 +1,5 @@
-tcfail123.hs:11:9:
+tcfail123.hs:11:9: error:
Couldn't match kind ‘*’ with ‘#’
When matching types
t0 :: *
diff --git a/testsuite/tests/typecheck/should_fail/tcfail143.stderr b/testsuite/tests/typecheck/should_fail/tcfail143.stderr
index b36d7a8b37..7c26762a66 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail143.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail143.stderr
@@ -1,8 +1,8 @@
-tcfail143.hs:29:9:
- Couldn't match type ‘S Z’ with ‘Z’
+tcfail143.hs:29:9: error:
+ Couldn't match type ‘Z’ with ‘S Z’
arising from a functional dependency between:
constraint ‘MinMax (S Z) Z Z Z’ arising from a use of ‘extend’
- instance ‘MinMax a Z Z a’ at tcfail143.hs:11:10-23
+ instance ‘MinMax Z b Z b’ at tcfail143.hs:12:10-23
In the expression: n1 `extend` n0
In an equation for ‘t2’: t2 = n1 `extend` n0
diff --git a/testsuite/tests/typecheck/should_fail/tcfail159.stderr b/testsuite/tests/typecheck/should_fail/tcfail159.stderr
index a8ae57b510..48c4ceb406 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail159.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail159.stderr
@@ -1,5 +1,5 @@
-tcfail159.hs:9:11:
+tcfail159.hs:9:11: error:
Couldn't match kind ‘*’ with ‘#’
When matching types
t0 :: *
diff --git a/testsuite/tests/typecheck/should_fail/tcfail200.stderr b/testsuite/tests/typecheck/should_fail/tcfail200.stderr
index 473ff9ebd7..e5bb82267e 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail200.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail200.stderr
@@ -1,5 +1,5 @@
-tcfail200.hs:5:15:
+tcfail200.hs:5:15: error:
Couldn't match kind ‘*’ with ‘#’
When matching types
t1 :: *
diff --git a/testsuite/tests/typecheck/should_fail/tcfail201.stderr b/testsuite/tests/typecheck/should_fail/tcfail201.stderr
index a69906452c..f548f0e72c 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail201.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail201.stderr
@@ -1,6 +1,6 @@
-tcfail201.hs:17:58:
- Couldn't match expected type ‘a’ with actual type ‘HsDoc id0’
+tcfail201.hs:17:58: error:
+ Couldn't match expected type ‘a’ with actual type ‘HsDoc t0’
‘a’ is a rigid type variable bound by
the type signature for:
gfoldl' :: (forall a1 b. c (a1 -> b) -> a1 -> c b)