Commit 0b00c6a0 authored by Simon Peyton Jones's avatar Simon Peyton Jones

Massive bunch of changes to track my massive refactoring to the typechecker

parent ca15920e
annfail07.hs:9:17:
Couldn't match expected type `[a]' with actual type `Bool'
Couldn't match expected type `[a0]' with actual type `Bool'
In the first argument of `head', namely `True'
In the expression: (head True)
In the annotation: {-# ANN f (head True) #-}
annfail08.hs:9:1:
No instance for (Data.Data.Data (a -> a))
No instance for (Data.Data.Data (a0 -> a0))
arising from an annotation
Possible fix:
add an instance declaration for (Data.Data.Data (a -> a))
add an instance declaration for (Data.Data.Data (a0 -> a0))
In the expression: (id + 1)
In the annotation: {-# ANN f (id + 1) #-}
annfail08.hs:9:15:
No instance for (Num (a -> a))
arising from a use of `+'
Possible fix: add an instance declaration for (Num (a -> a))
annfail08.hs:9:17:
No instance for (Num (a0 -> a0))
arising from the literal `1'
Possible fix: add an instance declaration for (Num (a0 -> a0))
In the second argument of `(+)', namely `1'
In the expression: (id + 1)
In the annotation: {-# ANN f (id + 1) #-}
annfail10.hs:9:1:
Ambiguous type variable `a' in the constraints:
(Data.Data.Data a) arising from an annotation
at annfail10.hs:9:1-15
(Num a) arising from the literal `1' at annfail10.hs:9:11
annfail10.hs:9:11:
Ambiguous type variable `a0' in the constraints:
(Num a0) arising from the literal `1' at annfail10.hs:9:11
(Data.Data.Data a0) arising from an annotation
at annfail10.hs:9:1-15
Probable fix: add a type signature that fixes these type variable(s)
In the expression: 1
In the annotation: {-# ANN f 1 #-}
......@@ -2,7 +2,8 @@
T2851.hs:9:15:
No instance for (Show (F a))
arising from the 'deriving' clause of a data type declaration
Possible fix: add an instance declaration for (Show (F a))
Alternatively, use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
Possible fix:
add an instance declaration for (Show (F a))
or use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (Show (D a))
{-# LANGUAGE GeneralizedNewtypeDeriving, MultiParamTypeClasses, FlexibleInstances, FunctionalDependencies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving, MultiParamTypeClasses, FlexibleInstances, FunctionalDependencies, FlexibleContexts, UndecidableInstances, StandaloneDeriving #-}
module T3621 where
-- This one is ok, even though the deriving clause mentions 'a'
......@@ -18,6 +18,19 @@ instance Monad (State s) where {}
instance MonadState s (State s) where {}
newtype WrappedState s a = WS { runWS :: State s a }
deriving (Monad, MonadState state)
deriving (Monad, MonadState state)
-- deriving (Monad)
deriving instance (MonadState state (State s))
=> MonadState state (WrappedState s)
-- ASSERT error
-- deriving instance (MonadState state (State s), Monad (WrappedState s))
-- => MonadState s (WrappedState s)
-- We try
-- instance MonadState state (State state a)
-- => MonadState state (WrappedState state a)
--
-- Superclass needs (Monad (WrappedState state a))
T3621.hs:21:22:
Couldn't match type `s' with `state'
`s' is a rigid type variable bound by
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
T3621.hs:21:21:
No instance for (MonadState state (State s))
arising from the 'deriving' clause of a data type declaration
Possible fix:
add an instance declaration for (MonadState state (State s))
or use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (MonadState state (WrappedState s))
......@@ -2,17 +2,19 @@
drvfail-foldable-traversable1.hs:9:23:
No instance for (Functor Trivial1)
arising from the 'deriving' clause of a data type declaration
Possible fix: add an instance declaration for (Functor Trivial1)
Alternatively, use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
Possible fix:
add an instance declaration for (Functor Trivial1)
or use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (Traversable Trivial1)
drvfail-foldable-traversable1.hs:13:22:
No instance for (Foldable Trivial2)
arising from the 'deriving' clause of a data type declaration
Possible fix: add an instance declaration for (Foldable Trivial2)
Alternatively, use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
Possible fix:
add an instance declaration for (Foldable Trivial2)
or use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (Traversable Trivial2)
drvfail-foldable-traversable1.hs:17:22:
......
......@@ -22,7 +22,8 @@ drvfail-functor2.hs:20:14:
drvfail-functor2.hs:26:14:
No instance for (Functor NoFunctor)
arising from the 'deriving' clause of a data type declaration
Possible fix: add an instance declaration for (Functor NoFunctor)
Alternatively, use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
Possible fix:
add an instance declaration for (Functor NoFunctor)
or use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (Functor UseNoFunctor)
......@@ -2,7 +2,8 @@
drvfail001.hs:16:33:
No instance for (Show (f (f a)))
arising from the 'deriving' clause of a data type declaration
Possible fix: add an instance declaration for (Show (f (f a)))
Alternatively, use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
Possible fix:
add an instance declaration for (Show (f (f a)))
or use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (Show (SM f a))
......@@ -2,7 +2,8 @@
drvfail003.hs:16:56:
No instance for (Show (v (v a)))
arising from the 'deriving' clause of a data type declaration
Possible fix: add an instance declaration for (Show (v (v a)))
Alternatively, use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
Possible fix:
add an instance declaration for (Show (v (v a)))
or use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (Show (Square_ v w a))
......@@ -2,7 +2,8 @@
drvfail004.hs:8:12:
No instance for (Eq (Foo a b))
arising from the 'deriving' clause of a data type declaration
Possible fix: add an instance declaration for (Eq (Foo a b))
Alternatively, use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
Possible fix:
add an instance declaration for (Eq (Foo a b))
or use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (Ord (Foo a b))
......@@ -2,7 +2,8 @@
drvfail007.hs:4:38:
No instance for (Eq (Int -> Int))
arising from the 'deriving' clause of a data type declaration
Possible fix: add an instance declaration for (Eq (Int -> Int))
Alternatively, use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
Possible fix:
add an instance declaration for (Eq (Int -> Int))
or use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (Eq Foo)
......@@ -2,7 +2,8 @@
drvfail012.hs:5:33:
No instance for (Eq (Ego a))
arising from the 'deriving' clause of a data type declaration
Possible fix: add an instance declaration for (Eq (Ego a))
Alternatively, use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
Possible fix:
add an instance declaration for (Eq (Ego a))
or use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (Ord (Ego a))
......@@ -2,15 +2,17 @@
drvfail013.hs:4:70:
No instance for (Eq (m (Maybe a)))
arising from the 'deriving' clause of a data type declaration
Possible fix: add an instance declaration for (Eq (m (Maybe a)))
Alternatively, use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
Possible fix:
add an instance declaration for (Eq (m (Maybe a)))
or use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (Eq (MaybeT m a))
drvfail013.hs:6:70:
No instance for (Eq (m (Maybe a)))
arising from the 'deriving' clause of a data type declaration
Possible fix: add an instance declaration for (Eq (m (Maybe a)))
Alternatively, use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
Possible fix:
add an instance declaration for (Eq (m (Maybe a)))
or use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (Eq (MaybeT' m a))
......@@ -2,20 +2,20 @@
T3651.hs:11:11:
Couldn't match type `()' with `Bool'
Inaccessible code in
a pattern with constructor `U', in an equation for `unsafe1'
a pattern with constructor U :: Z (), in an equation for `unsafe1'
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'
a pattern with constructor U :: Z (), in an equation for `unsafe2'
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'
a pattern with constructor U :: Z (), in an equation for `unsafe3'
In the pattern: U
In an equation for `unsafe3': unsafe3 B U = True
gadt10.hs:6:24:
`RInt' is not applied to enough type arguments
Expected kind `?', but `RInt' has kind `k -> *'
Expected kind `?', but `RInt' has kind `k0 -> *'
In the type `RInt'
In the definition of data constructor `R'
In the data type declaration for `RInt'
gadt21.hs:21:60:
Could not deduce (Ord a1) from the context (a ~ Set a1)
arising from a use of `f'
Could not deduce (Ord a1) arising from a use of `f'
from the context (a ~ Set a1)
bound by a pattern with constructor
TypeSet :: forall a. Type a -> Type (Set a),
in an equation for `withOrdDynExpr'
at gadt21.hs:21:35-43
Possible fix:
add (Ord a1) to the context of
the data constructor `TypeSet'
or the data constructor `DynExpr'
or the type signature for `withOrdDynExpr'
or the type signature for
withOrdDynExpr :: DynExpr
-> (forall a. Ord a => Expr a -> b)
-> Maybe b
In the first argument of `Just', namely `(f e)'
In the expression: Just (f e)
In an equation for `withOrdDynExpr':
......
......@@ -2,7 +2,8 @@
rw.hs:14:47:
Couldn't match type `a' with `Int'
`a' is a rigid type variable bound by
the type signature for `writeInt' at rw.hs:12:14
the type signature for writeInt :: T a -> IORef a -> IO ()
at rw.hs:13:1
In the second argument of `writeIORef', namely `(1 :: Int)'
In the expression: writeIORef ref (1 :: Int)
In a case alternative: ~(Li x) -> writeIORef ref (1 :: Int)
......@@ -10,7 +11,9 @@ rw.hs:14:47:
rw.hs:19:51:
Couldn't match type `a' with `Bool'
`a' is a rigid type variable bound by
the type signature for `readBool' at rw.hs:16:14
the type signature for readBool :: T a -> IORef a -> IO ()
at rw.hs:17:1
Expected type: a -> Bool
Actual type: Bool -> Bool
In the second argument of `(.)', namely `not'
In the second argument of `(>>=)', namely `(print . not)'
In the expression: readIORef ref >>= (print . not)
Stopped at break012.hs:(1,1)-(5,18)
_result :: (a1, a2 -> a2, (), a -> a -> a) = _
_result :: (t, a1 -> a1, (), a -> a -> a) = _
Stopped at break012.hs:5:10-18
_result :: (a1, a2 -> a2, (), a -> a -> a) = _
a :: a1 = _
b :: a3 -> a3 = _
_result :: (t, a1 -> a1, (), a -> a -> a) = _
a :: t = _
b :: a2 -> a2 = _
c :: () = _
d :: a -> a -> a = _
a :: a1
b :: a3 -> a3
a :: t
b :: a2 -> a2
c :: ()
d :: a -> a -> a
a = (_t1::a1)
b = (_t2::forall a3. a3 -> a3)
a = (_t1::t)
b = (_t2::forall a2. a2 -> a2)
c = (_t3::())
d = (_t4::a -> a -> a)
......@@ -2,7 +2,7 @@ t = O (_t1::t)
()
t = O ((_t2::a1) : (_t3::[a1]))
()
t = O ((_t4::a11) : (_t5::a11) : (_t6::[a11]))
t = O ((_t4::a2) : (_t5::a2) : (_t6::[a2]))
()
t = O ((_t7::Maybe [a1]) : Just [(_t8::a1),(_t9::a1)] :
(_t10::[Maybe [a1]]))
......
......@@ -7,5 +7,5 @@ let o = O (id foo)
seq _t1 ()
:t _t1
:p o
seq _t3 ()
seq _t4 ()
:p o
\ No newline at end of file
o = O (_t1::t)
()
_t1 :: SafeList x NonEmpty
o = O (Cons (_t2::GHC.Classes.T:Eq x1) (_t3::x1)
(_t4::SafeList x1 y))
()
o = O (Cons (_t5::GHC.Classes.T:Eq Integer) 3
(_t6::SafeList Integer y1))
o = O (_t1::t)
()
_t1 :: SafeList a NonEmpty
o = O (Cons (GHC.Classes.D:Eq (_t2::a1 -> a1 -> Bool)
(_t3::a1 -> a1 -> Bool))
(_t4::a1) (_t5::SafeList a1 y))
()
o = O (Cons (GHC.Classes.D:Eq (_t6::Integer -> Integer -> Bool)
(_t7::Integer -> Integer -> Bool))
3 (_t8::SafeList Integer y1))
......@@ -6,4 +6,4 @@
let e = Exist 1
:p e
seq _t1 ()
:p e
\ No newline at end of file
:p e
($$$) :: [a -> b] -> [a] -> [b] -- Defined at <interactive>:1:8-10
($$$) :: [b -> c] -> [b] -> [c] -- Defined at <interactive>:1:8-10
......@@ -20,10 +20,9 @@ wib x = bar x
-- instance Concrete Bool Bool
{- This is a nice example of the trickiness of functional dependencies.
Here's what is happening. First a very cut-down version of your
example:
Here's what is happening.
Now consider type inference for 'wib'. GHC 6.6 figures out that the call
Consider type inference for 'wib'. GHC 6.6 figures out that the call
of 'bar' gives rise to the constraint (Concrete p q), where x has type
'p'. Ah, but x must have type 'a', so the constraint is (Concrete a
q).
......
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'
Couldn't match type `z0' with `n'
`z0' is untouchable
inside the constraints (Maybe m ~ Maybe n)
bound at a type expected by the context:
Maybe m ~ Maybe n => EQ_ z0 z0
`n' is a rigid type variable bound by
the type signature for `foo' at Simple14.hs:16:17
Expected type: z
Actual type: m
the type signature for foo :: EQ_ (Maybe m) (Maybe n)
at Simple14.hs:17:1
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))
TYPE SIGNATURES
emptyL :: forall a. ListColl a
test2 :: forall c a a1.
(Num a1, Num a, Coll c, Elem c ~ (a, a1)) =>
test2 :: forall c t t1.
(Elem c ~ (t, t1), Coll c, Num t1, Num t) =>
c -> c
TYPE CONSTRUCTORS
data ListColl a
......
T3208b.hs:15:10:
Could not deduce (OTerm o ~ STerm a)
from the context (OTerm a ~ STerm a, OBJECT a, SUBST a)
Expected type: STerm o
Actual type: OTerm o
Could not deduce (STerm a0 ~ STerm a)
from the context (OTerm a ~ STerm a, OBJECT a, SUBST a)
bound by the type signature for
fce' :: (OTerm a ~ STerm a, OBJECT a, SUBST a) => a -> c
at T3208b.hs:15:1-22
NB: `STerm' is a type function, and may not be injective
Expected type: STerm a0
Actual type: OTerm a0
In the expression: fce (apply f)
In an equation for `fce'': fce' f = fce (apply f)
T3208b.hs:15:10:
Could not deduce (STerm o ~ STerm a)
from the context (OTerm a ~ STerm a, OBJECT a, SUBST a)
NB: `STerm' is a type function, and may not be injective
Expected type: STerm o
Actual type: OTerm o
T3208b.hs:15:15:
Could not deduce (OTerm a0 ~ STerm a)
from the context (OTerm a ~ STerm a, OBJECT a, SUBST a)
bound by the type signature for
fce' :: (OTerm a ~ STerm a, OBJECT a, SUBST a) => a -> c
at T3208b.hs:15:1-22
In the first argument of `fce', namely `(apply f)'
In the expression: fce (apply f)
In an equation for `fce'': fce' f = fce (apply f)
T4120.hs:17:10:
Couldn't match expected type `forall s. MVector s a'
with actual type `forall s. Mutable Vector s a1'
Expected type: (forall s. MVector s a) -> Int
Actual type: (forall s. Mutable Vector s a1) -> Int
with actual type `forall s. Mutable Vector s a0'
Expected type: (forall s. MVector s a) -> Int
Actual type: (forall s. Mutable Vector s a0) -> Int
In the expression: create1
In an equation for `create': create = create1
......@@ -116,7 +116,9 @@ test('GivenCheckSwap', normal, compile, [''])
test('GivenCheckDecomp', normal, compile, [''])
test('GivenCheckTop', normal, compile, [''])
test('Gentle', normal, compile, [''])
# A very delicate test
test('Gentle', normal, compile_fail, [''])
test('T1981', normal, compile, [''])
test('T2238', expect_fail, compile, [''])
test('OversatDecomp', normal, compile, [''])
......
GADTwrong1.hs:12:19:
Could not deduce (a1 ~ b) from the context (() ~ Const a1)
Could not deduce (a1 ~ b)
from the context (() ~ Const a1)
bound by a pattern with constructor
T :: forall a. a -> T (Const a),
in a case alternative
at GADTwrong1.hs:12:12-14
`a1' is a rigid type variable bound by
a pattern with constructor T :: forall a. a -> T (Const a)
at GADTwrong1.hs:12:12
a pattern with constructor
T :: forall a. a -> T (Const a),
in a case alternative
at GADTwrong1.hs:12:12
`b' is a rigid type variable bound by
the type signature for `coerce' at GADTwrong1.hs:10:20
the type signature for coerce :: a -> b at GADTwrong1.hs:11:1
In the expression: y
In a case alternative: T y -> y
In the expression: case T x :: T (Const b) of { T y -> y }
NoMatchErr.hs:20:5:
Could not deduce (Memo d ~ Memo d1) from the context (Fun d1)
Could not deduce (Memo d ~ Memo d0)
from the context (Fun d)
bound by the type signature for f :: Fun d => Memo d a -> Memo d a
at NoMatchErr.hs:20:1-15
NB: `Memo' is a type function, and may not be injective
Expected type: Memo d1 a
Actual type: Memo d a
In the first argument of `(.)', namely `abst'
Expected type: Memo d a
Actual type: Memo d0 a
Expected type: Memo d a -> Memo d a
Actual type: Memo d0 a -> Memo d0 a
In the expression: abst . appl
In an equation for `f': f = abst . appl
SimpleFail16.hs:10:12:
Couldn't match type `F ()' with `p a'
Couldn't match type `F ()' with `p0 a0'
In the first argument of `foo', namely `(undefined :: F ())'