Commit 42a4a859 authored by Simon Peyton Jones's avatar Simon Peyton Jones

Follow error message changes with new typechecker

parent be72302b
......@@ -5,4 +5,7 @@ T3621.hs:21:22:
the instance declaration at T3621.hs:21:22
`state' is a rigid type variable bound by
the instance declaration at T3621.hs:21:22
arising from the 'deriving' clause of a data type declaration
Alternatively, use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (MonadState state (WrappedState s))
T3651.hs:11:11:
Couldn't match type `()' with `Bool'
Inaccessible code in
a pattern with constructor `U', in an equation for `unsafe1'
Couldn't match type `()' with `Bool'
In the pattern: U
In an equation for `unsafe1': unsafe1 B U = ()
T3651.hs:14:11:
Couldn't match type `()' with `Bool'
Inaccessible code in
a pattern with constructor `U', in an equation for `unsafe2'
Couldn't match type `()' with `Bool'
In the pattern: U
In an equation for `unsafe2': unsafe2 B U = ()
T3651.hs:17:11:
Couldn't match type `()' with `Bool'
Inaccessible code in
a pattern with constructor `U', in an equation for `unsafe3'
Couldn't match type `()' with `Bool'
In the pattern: U
In an equation for `unsafe3': unsafe3 B U = True
Simple14.hs:17:12:
Couldn't match type `z' with `n'
`z' is untouchable
inside the constraints (Maybe m ~ Maybe n)
bound at the polymorphic type `x ~ y => EQ_ z z'
`n' is a rigid type variable bound by
the type signature for `foo' at Simple14.hs:16:17
because z is untouchable
inside the constraints (Maybe m ~ Maybe n)
bound at the polymorphic type `x ~ y => EQ_ z z'
Expected type: z
Actual type: m
In the second argument of `eqE', namely `(eqI :: EQ_ m n)'
In the first argument of `ntI', namely `(`eqE` (eqI :: EQ_ m n))'
In the expression: ntI (`eqE` (eqI :: EQ_ m n))
GADTwrong1.hs:12:19:
Couldn't match type `a1' with `b'
Could not deduce (a1 ~ b) from the context (() ~ Const a1)
`a1' is a rigid type variable bound by
a pattern with constructor T :: forall a. a -> T (Const a)
at GADTwrong1.hs:12:12
......
......@@ -2,13 +2,72 @@
module Class4 where
class (Eq (Depend s))=> Bug s where
class (Eq (Depend s)) => Bug s where
type Depend s
trans :: Depend s -> Depend s
instance Bug Int where
type Depend Int = ()
trans = (+1)
check :: (Bug s) => Depend s -> Bool
check d = d == trans d
\ No newline at end of file
check d = d == trans d
{-
Given: (Bug s, Eq (Depend s))
= (Bug s, Eq fsk, Depend s ~ fsk)
Wanted: (Eq alpha, (invocation of == at alpha)
Depend s ~ alpha (first arg of ==)
Depend sigma ~ alpha (second arg of ==)
Bug sigma, (invocation of trans at sigma)
Depend sigma ~ Depend s (first arg of trans)
{der}Eq (Depend sigma) (superclass of Bug sigma)
==>
Wanted: (Eq alpha, (invocation of == at alpha)
Depend s ~ alpha (first arg of ==)
Depend sigma ~ alpha (second arg of ==)
Bug sigma, (invocation of trans at sigma)
{der}Eq (Depend sigma) (superclass of Bug sigma)
==>
Wanted: (Eq alpha, (invocation of == at alpha)
Depend s ~ alpha (first arg of ==)
Depend sigma ~ alpha (second arg of ==)
Bug sigma, (invocation of trans at sigma)
{der}Eq uf_ahj
Depend sigma ~ uf_ahj
==> uf := alpha
Wanted: (Eq alpha, (invocation of == at alpha)
Depend s ~ alpha (first arg of ==)
Depend sigma ~ alpha (second arg of ==)
Bug sigma, (invocation of trans at sigma)
{der}Eq alpha)
==> discharge Eq alpha from {der}
Wanted: (Depend s ~ alpha (first arg of ==)
Depend sigma ~ alpha (second arg of ==)
Bug sigma, (invocation of trans at sigma)
{der}Eq alpha)
==> use given Depend s ~ fsk
Wanted: (alpha ~ fsk
Depend sigma ~ alpha (second arg of ==)
Bug sigma, (invocation of trans at sigma)
{der}Eq alpha)
==> alpha := fsk
Wanted: ({given}alpha ~ fsk
Depend sigma ~ alpha (second arg of ==)
Bug sigma, (invocation of trans at sigma)
{der}Eq fsk)
==> discharde {der} Eq fsk
Wanted: ({given}uf ~ fsk
Depend sigma ~ uf (second arg of ==)
Bug sigma, (invocation of trans at sigma)
-}
......@@ -10,6 +10,7 @@ T1900.hs:11:12:
T1900.hs:14:16:
Could not deduce (Depend s ~ Depend s1) from the context (Bug s1)
NB: `Depend' is a type function, and may not be injective
arising from a use of `trans'
In the second argument of `(==)', namely `trans d'
In the expression: d == trans d
In an equation for `check': check d = d == trans d
T2627b.hs:20:14:
Couldn't match type `a' with `Dual (Dual a)'
because a is untouchable
inside the constraints (b ~ W a3 b2)
bound at a pattern with constructor
Wr :: forall a b. a -> Comm b -> Comm (W a b)
In the pattern: Wr a r
T2627b.hs:20:24:
Occurs check: cannot construct the infinite type: b = Dual (Dual b)
In the expression: conn undefined undefined
In an equation for `conn':
conn (Rd k) (Wr a r) = conn undefined undefined
T3330c.hs:23:21:
Could not deduce (f2 ~ Der f2) from the context (f1 ~ (f2 :+: g))
`f2' is a rigid type variable bound by
a pattern with constructor
RSum :: forall (f :: * -> *) (g :: * -> *).
R f -> R g -> R (f :+: g)
at T3330c.hs:23:8
Expected type: Der f1 x
Actual type: (:+:) f (Der g) x
In the pattern: Inl df
In an equation for `plug'':
plug' (RSum rf rg) (Inl df) x = Inl (plug rf df x)
T3330c.hs:23:43:
Occurs check: cannot construct the infinite type:
f = f x
Expected type: Der ((->) x) (f x)
Actual type: R f
Couldn't match type `f' with `f x'
`f' is a rigid type variable bound by
a pattern with constructor
RSum :: forall (f :: * -> *) (g :: * -> *).
R f -> R g -> R (f :+: g)
at T3330c.hs:23:8
Expected type: Der ((->) x) (f x)
Actual type: R f
In the first argument of `plug', namely `rf'
In the first argument of `Inl', namely `(plug rf df x)'
In the expression: Inl (plug rf df x)
......@@ -3,5 +3,7 @@ T4093a.hs:8:8:
Could not deduce (e ~ ()) from the context (Foo e ~ Maybe e)
`e' is a rigid type variable bound by
the type signature for `hang' at T4093a.hs:7:14
Expected type: Foo e
Actual type: Maybe ()
In the expression: Just ()
In an equation for `hang': hang = Just ()
......@@ -5,6 +5,8 @@ T4093b.hs:31:13:
EitherCO x (A C C n) (A C O n) ~ A C x n)
`e' is a rigid type variable bound by
the type signature for `blockToNodeList' at T4093b.hs:20:12
Expected type: EitherCO e (A C O n) (A O O n)
Actual type: (MaybeC C (n C O), MaybeC O (n O C))
In the expression: (JustC n, NothingC)
In an equation for `f': f n _ = (JustC n, NothingC)
In an equation for `blockToNodeList':
......
T4099.hs:11:14:
Couldn't match type `T b' with `T a'
Couldn't match type `T a' with `T b'
NB: `T' is a type function, and may not be injective
In the first argument of `foo', namely `x'
In the expression: foo x
......
T4179.hs:26:16:
Could not deduce (DoC (x (A2 (FCon x) -> A3 (FCon x))))
from the context (Functor x, DoC (FCon x))
arising from a use of `op'
Possible fix:
add (DoC (x (A2 (FCon x) -> A3 (FCon x)))) to the context of
the type signature for `fCon'
or add an instance declaration for
(DoC (x (A2 (FCon x) -> A3 (FCon x))))
In the first argument of `foldDoC', namely `op'
In the expression: foldDoC op
In an equation for `fCon': fCon = foldDoC op
T4179.hs:26:16:
Could not deduce (A2 (x (A2 (FCon x) -> A3 (FCon x)))
~
......@@ -24,17 +37,3 @@ T4179.hs:26:16:
In the first argument of `foldDoC', namely `op'
In the expression: foldDoC op
In an equation for `fCon': fCon = foldDoC op
T4179.hs:26:16:
Could not deduce (DoC (x (A2 (FCon x) -> A3 (FCon x))))
from the context (Functor x, DoC (FCon x))
arising from a use of `op'
Possible fix:
add (DoC (x (A2 (FCon x) -> A3 (FCon x)))) to the context of
the type signature for `fCon'
or add an instance declaration for
(DoC (x (A2 (FCon x) -> A3 (FCon x))))
In the first argument of `foldDoC', namely `op'
In the expression: foldDoC op
In an equation for `fCon': fCon = foldDoC op
......@@ -3,5 +3,9 @@ T4254.hs:19:10:
Could not deduce (b ~ Bool) from the context (a ~ Int, FD a b)
`b' is a rigid type variable bound by
the type signature for `fails' at T4254.hs:18:19
When using functional dependencies to combine
FD Int Bool, arising from a use of `op' at T4254.hs:19:10-11
FD Int b,
arising from the type signature for `fails' at T4254.hs:19:1-11
In the expression: op
In an equation for `fails': fails = op
T4272.hs:11:26:
Occurs check: cannot construct the infinite type:
a = TermFamily a a
Expected type: TermFamily a (TermFamily a a)
Actual type: TermFamily a a
Couldn't match type `a' with `TermFamily a a'
`a' is a rigid type variable bound by
the type signature for `laws' at T4272.hs:10:16
Expected type: TermFamily a (TermFamily a a)
Actual type: TermFamily a a
In the first argument of `terms', namely
`(undefined :: TermFamily a a)'
In the second argument of `prune', namely
......
......@@ -4,9 +4,33 @@ readFail003.hs:4:27:
t = (t, [a], [a1])
In the expression: a
In a pattern binding:
~(a, b, c)
| nullity b = a
| nullity c = a
| otherwise = a
where
nullity = null
~(a, b, c)
| nullity b = a
| nullity c = a
| otherwise = a
where
nullity = null
readFail003.hs:5:27:
Occurs check: cannot construct the infinite type:
t = (t, [a], [a1])
In the expression: a
In a pattern binding:
~(a, b, c)
| nullity b = a
| nullity c = a
| otherwise = a
where
nullity = null
readFail003.hs:6:27:
Occurs check: cannot construct the infinite type:
t = (t, [a], [a1])
In the expression: a
In a pattern binding:
~(a, b, c)
| nullity b = a
| nullity c = a
| otherwise = a
where
nullity = null
FD3.hs:15:15:
Occurs check: cannot construct the infinite type:
a = (String, a)
Couldn't match type `a' with `(String, a)'
`a' is a rigid type variable bound by
the type signature for `translate' at FD3.hs:14:23
When using functional dependencies to combine
MkA a a,
arising from the dependency `a -> b'
in the instance declaration at FD3.hs:12:10
MkA (String, a) a, arising from a use of `mkA' at FD3.hs:15:15-17
In the expression: mkA a
In an equation for `translate': translate a = mkA a
FD3.hs:15:15:
No instance for (MkA (String, a1) a1)
arising from a use of `mkA'
Possible fix: add an instance declaration for (MkA (String, a1) a1)
In the expression: mkA a
In an equation for `translate': translate a = mkA a
......@@ -10,7 +10,7 @@ T2494.hs:15:14:
In the expression: foo f (foo g x)
T2494.hs:15:30:
Could not deduce (b ~ a) from the context (Monad m)
Couldn't match type `b' with `a'
`b' is a rigid type variable bound by
the type signature for `g' at T2494.hs:14:46
`a' is a rigid type variable bound by
......
......@@ -5,4 +5,22 @@
module T2714 where
f :: ((a -> b) -> b) -> (forall c. c -> a)
f = fmap
f = ffmap
ffmap :: Functor f => (p->q) -> f p -> f q
ffmap = error "urk"
{-
a ~ f q
c ~ f p
(p->q) ~ (a->b) -> b
=>
a ~ f q
c ~ f p
p ~ a->b
q ~ b
=>
a ~ f b
c ~ f (a->b)
-}
\ No newline at end of file
......@@ -3,12 +3,5 @@ T2714.hs:8:5:
Couldn't match type `a' with `f b'
`a' is a rigid type variable bound by
the type signature for `f' at T2714.hs:7:8
In the expression: fmap
In an equation for `f': f = fmap
T2714.hs:8:5:
Couldn't match type `c' with `f (f b -> b)'
`c' is a rigid type variable bound by
the type signature for `f' at T2714.hs:7:33
In the expression: fmap
In an equation for `f': f = fmap
In the expression: ffmap
In an equation for `f': f = ffmap
tcfail014.hs:5:33:
Occurs check: cannot construct the infinite type: t = t -> t1
Occurs check: cannot construct the infinite type: t1 = t1 -> t
In the first argument of `z', namely `z'
In the expression: z z
In an equation for `h': h z = z z
tcfail122.hs:8:9:
Kind incompatibility when matching types:
d :: * -> *
b :: *
In the expression:
undefined :: forall c :: ((* -> *) -> *) d :: (* -> *). c d
In the expression:
[undefined :: forall a b. a b,
undefined :: forall c :: ((* -> *) -> *) d :: (* -> *). c d]
In an equation for `foo':
foo
= [undefined :: forall a b. a b,
undefined :: forall c :: ((* -> *) -> *) d :: (* -> *). c d]
tcfail122.hs:8:9:
Kind incompatibility when matching types:
c :: (* -> *) -> *
......
......@@ -6,3 +6,11 @@ tcfail123.hs:11:10:
In the first argument of `f', namely `3#'
In the expression: f 3#
In the expression: (f 3#, f 4.3#, f True)
tcfail123.hs:11:16:
Kind incompatibility when matching types:
t1 :: *
GHC.Prim.Float# :: #
In the first argument of `f', namely `4.3#'
In the expression: f 4.3#
In the expression: (f 3#, f 4.3#, f True)
......@@ -7,10 +7,11 @@ data Z = Z
data S a = S a
class MinMax a b c d | a b -> c d, a c d -> b, b c d -> a
instance MinMax Z Z Z Z
instance MinMax a Z Z a -- L1: wrongly flagged as error src.
instance MinMax Z b Z b
instance MinMax Z Z Z Z -- (a)
instance MinMax a Z Z a -- (b) -- L1: wrongly flagged as error src.
instance MinMax Z b Z b -- (c)
instance MinMax a b c d => MinMax (S a) (S b) (S c) (S d)
-- (d)
class Extend a b where extend :: a -> b -> b
instance Extend Z b where Z `extend` b = b
......@@ -33,6 +34,16 @@ t2 = n1 `extend` n0 -- L3: uncommenting just this line produces
-- error message rightly pointing at L2 and L3.
{- n0 :: Z; n1 :: S Z
Call of extend gives wanted: Extend (S Z) Z
Use instance => MinMax (S Z) Z gamma Z
FD on (b) => gamma ~ Z, Z ~ S Z
=> MinMax (S Z) Z Z Z
FD on (a), 3rd fundep => Z ~ S Z
(b) again (sadly) Z ~ S Z
-}
{-
Here's what is happening.
......
tcfail143.hs:28:9:
tcfail143.hs:29:9:
Couldn't match type `Z' with `S Z'
When using functional dependencies to combine
MinMax Z b Z b,
arising from the dependency `b c d -> a'
in the instance declaration at tcfail143.hs:12:10
MinMax (S Z) Z Z Z,
arising from a use of `extend' at tcfail143.hs:29:9-16
In the expression: n1 `extend` n0
In an equation for `t2': t2 = n1 `extend` n0
tcfail143.hs:29:9:
Couldn't match type `Z' with `S Z'
When using functional dependencies to combine
MinMax a Z Z a,
arising from the dependency `b c d -> a'
in the instance declaration at tcfail143.hs:11:10
MinMax (S Z) Z Z Z,
arising from a use of `extend' at tcfail143.hs:29:9-16
In the expression: n1 `extend` n0
In an equation for `t2': t2 = n1 `extend` n0
tcfail143.hs:29:9:
Couldn't match type `Z' with `S Z'
When using functional dependencies to combine
MinMax Z Z Z Z,
arising from the dependency `b c d -> a'
in the instance declaration at tcfail143.hs:10:10
MinMax (S Z) Z Z Z,
arising from a use of `extend' at tcfail143.hs:29:9-16
In the expression: n1 `extend` n0
In an equation for `t2': t2 = n1 `extend` n0
tcfail143.hs:29:9:
Couldn't match type `S Z' with `Z'
When using functional dependencies to combine
MinMax a Z Z a,
arising from the dependency `a b -> c d'
in the instance declaration at tcfail143.hs:11:10
MinMax (S Z) Z Z Z,
arising from a use of `extend' at tcfail143.hs:29:9-16
In the expression: n1 `extend` n0
In an equation for `t2': t2 = n1 `extend` n0
tcfail143.hs:29:9:
Couldn't match type `S Z' with `Z'
arising from a use of `extend'
When using functional dependencies to combine
MinMax a Z Z a,
arising from the dependency `a b -> c d'
in the instance declaration at tcfail143.hs:11:10
MinMax (S Z) Z Z Z,
arising from a use of `extend' at tcfail143.hs:29:9-16
In the expression: n1 `extend` n0
In an equation for `t2': t2 = n1 `extend` n0
tcfail143.hs:29:9:
No instance for (MinMax (S Z) Z Z Z)
arising from a use of `extend'
Possible fix: add an instance declaration for (MinMax (S Z) Z Z Z)
In the expression: n1 `extend` n0
In an equation for `t2': t2 = n1 `extend` n0
tcfail167.hs:14:14:
Couldn't match type `Char' with `Float'
Inaccessible code in
a pattern with constructor `C2', in an equation for `inaccessible'
Couldn't match type `Char' with `Float'
In the pattern: C2
In an equation for `inaccessible': inaccessible C2 = ' '
tcfail191.hs:11:26:
Occurs check: cannot construct the infinite type: a = [a]
Couldn't match type `a' with `[a]'
`a' is a rigid type variable bound by
the polymorphic type `forall a1. [a1] -> [[a1]]'
at tcfail191.hs:11:9
In the expression: take 5
In a stmt of a list comprehension: then group using take 5
In the expression:
[() | x <- [Gnorf, Brain], then group using take 5]
[() | x <- [Gnorf, Brain], then group using take 5]
......@@ -10,7 +10,10 @@ tcfail192.hs:8:11:
foo = [x + 1 | x <- ["Hello", "World"], then group using take 5]
tcfail192.hs:10:26:
Occurs check: cannot construct the infinite type: a = [a]
Couldn't match type `a' with `[a]'
`a' is a rigid type variable bound by
the polymorphic type `forall a1. [a1] -> [[a1]]'
at tcfail192.hs:10:9
In the expression: take 5
In a stmt of a list comprehension: then group using take 5
In the expression:
......
tcfail193.hs:10:31:
Occurs check: cannot construct the infinite type: a = [a]
Couldn't match type `a' with `[a]'
`a' is a rigid type variable bound by
the polymorphic type `forall a1. [a1] -> [a1]'
at tcfail193.hs:10:10
In the expression: inits
In a stmt of a list comprehension: then inits
In the expression: [x | x <- [3, 2, 1], then inits]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment