Commit 02bac025 authored by Simon Peyton Jones's avatar Simon Peyton Jones

Remove some horrible munging of origins for Coercible

I just didn't think it was buying enough for all the cruft it caused.
We can put some back if people start complaining about poor error
messages. I forget quite how I tripped over this but I got sucked in.

* Lots of tidying up in TcErrors

* Rename pprArisingAt to pprCtLoc, by analogy with pprCtOrigin

* Remove CoercibleOrigin data constructor from CtOrigin

* Make relevantBindings return a Ct with a zonked
  and tidied CtOrigin

* Add to TcRnTypes
      ctOrigin   :: Ct -> CtOrigin
      ctEvOrigin :: CtEvidence -> CtOrigin
      setCtLoc   :: Ct -> CtLoc -> Ct
parent 4a7a6c3a
......@@ -232,21 +232,8 @@ instCallConstraints orig preds
= do { co <- unifyType ty1 ty2
; return (EvCoercion co) }
| otherwise
= do { ev_var <- emitWanted modified_orig pred
= do { ev_var <- emitWanted orig pred
; return (EvId ev_var) }
where
-- Coercible constraints appear as normal class constraints, but
-- are aggressively canonicalized and manipulated during solving.
-- The final equality to solve may barely resemble the initial
-- constraint. Here, we remember the initial constraint in a
-- CtOrigin for better error messages. It's perhaps worthwhile
-- considering making this approach general, for other class
-- constraints, too.
modified_orig
| Just (Representational, ty1, ty2) <- getEqPredTys_maybe pred
= CoercibleOrigin ty1 ty2
| otherwise
= orig
instDFunType :: DFunId -> [DFunInstType] -> TcM ([TcType], TcThetaType)
-- See Note [DFunInstType: instantiating types] in InstEnv
......@@ -408,7 +395,7 @@ syntaxNameCtxt name orig ty tidy_env
<+> ptext (sLit "(needed by a syntactic construct)")
, nest 2 (ptext (sLit "has the required type:")
<+> ppr (tidyType tidy_env ty))
, nest 2 (pprArisingAt inst_loc) ]
, nest 2 (pprCtLoc inst_loc) ]
; return (tidy_env, msg) }
{-
......
This diff is collapsed.
......@@ -911,10 +911,6 @@ zonkTidyOrigin env (KindEqOrigin ty1 ty2 orig)
; (env2, ty2') <- zonkTidyTcType env1 ty2
; (env3, orig') <- zonkTidyOrigin env2 orig
; return (env3, KindEqOrigin ty1' ty2' orig') }
zonkTidyOrigin env (CoercibleOrigin ty1 ty2)
= do { (env1, ty1') <- zonkTidyTcType env ty1
; (env2, ty2') <- zonkTidyTcType env1 ty2
; return (env2, CoercibleOrigin ty1' ty2') }
zonkTidyOrigin env (FunDepOrigin1 p1 l1 p2 l2)
= do { (env1, p1') <- zonkTidyTcType env p1
; (env2, p2') <- zonkTidyTcType env1 p2
......
......@@ -56,9 +56,9 @@ module TcRnTypes(
isCDictCan_Maybe, isCFunEqCan_maybe,
isCIrredEvCan, isCNonCanonical, isWantedCt, isDerivedCt,
isGivenCt, isHoleCt, isExprHoleCt, isTypeHoleCt,
ctEvidence, ctLoc, ctPred, ctFlavour, ctEqRel,
ctEvidence, ctLoc, setCtLoc, ctPred, ctFlavour, ctEqRel, ctOrigin,
mkNonCanonical, mkNonCanonicalCt,
ctEvPred, ctEvLoc, ctEvEqRel,
ctEvPred, ctEvLoc, ctEvOrigin, ctEvEqRel,
ctEvTerm, ctEvCoercion, ctEvId,
WantedConstraints(..), insolubleWC, emptyWC, isEmptyWC,
......@@ -72,7 +72,7 @@ module TcRnTypes(
CtLoc(..), ctLocSpan, ctLocEnv, ctLocLevel, ctLocOrigin,
ctLocDepth, bumpCtLocDepth,
setCtLocOrigin, setCtLocEnv, setCtLocSpan,
CtOrigin(..), pprCtOrigin,
CtOrigin(..), pprCtOrigin, pprCtLoc,
pushErrCtxt, pushErrCtxtSameOrigin,
SkolemInfo(..),
......@@ -94,7 +94,6 @@ module TcRnTypes(
-- Pretty printing
pprEvVarTheta,
pprEvVars, pprEvVarWithType,
pprArising, pprArisingAt,
-- Misc other types
TcId, TcIdSet, HoleSort(..)
......@@ -1266,6 +1265,12 @@ ctEvidence = cc_ev
ctLoc :: Ct -> CtLoc
ctLoc = ctEvLoc . ctEvidence
setCtLoc :: Ct -> CtLoc -> Ct
setCtLoc ct loc = ct { cc_ev = (cc_ev ct) { ctev_loc = loc } }
ctOrigin :: Ct -> CtOrigin
ctOrigin = ctLocOrigin . ctLoc
ctPred :: Ct -> PredType
-- See Note [Ct/evidence invariant]
ctPred ct = ctEvPred (cc_ev ct)
......@@ -1750,6 +1755,9 @@ ctEvPred = ctev_pred
ctEvLoc :: CtEvidence -> CtLoc
ctEvLoc = ctev_loc
ctEvOrigin :: CtEvidence -> CtOrigin
ctEvOrigin = ctLocOrigin . ctEvLoc
-- | Get the equality relation relevant for a 'CtEvidence'
ctEvEqRel :: CtEvidence -> EqRel
ctEvEqRel = predTypeEqRel . ctEvPred
......@@ -2034,17 +2042,6 @@ pushErrCtxtSameOrigin :: ErrCtxt -> CtLoc -> CtLoc
pushErrCtxtSameOrigin err loc@(CtLoc { ctl_env = lcl })
= loc { ctl_env = lcl { tcl_ctxt = err : tcl_ctxt lcl } }
pprArising :: CtOrigin -> SDoc
-- Used for the main, top-level error message
-- We've done special processing for TypeEq and FunDep origins
pprArising (TypeEqOrigin {}) = empty
pprArising orig = pprCtOrigin orig
pprArisingAt :: CtLoc -> SDoc
pprArisingAt (CtLoc { ctl_origin = o, ctl_env = lcl})
= sep [ pprCtOrigin o
, text "at" <+> ppr (tcl_loc lcl)]
{-
************************************************************************
* *
......@@ -2174,7 +2171,6 @@ data CtOrigin
| KindEqOrigin
TcType TcType -- A kind equality arising from unifying these two types
CtOrigin -- originally arising from this
| CoercibleOrigin TcType TcType -- a Coercible constraint
| IPOccOrigin HsIPName -- Occurrence of an implicit parameter
......@@ -2227,11 +2223,19 @@ data CtOrigin
ctoHerald :: SDoc
ctoHerald = ptext (sLit "arising from")
pprCtOrigin :: CtOrigin -> SDoc
pprCtLoc :: CtLoc -> SDoc
-- "arising from ... at ..."
-- Not an instance of Outputable because of the "arising from" prefix
pprCtLoc (CtLoc { ctl_origin = o, ctl_env = lcl})
= sep [ pprCtOrigin o
, text "at" <+> ppr (tcl_loc lcl)]
pprCtOrigin :: CtOrigin -> SDoc
-- "arising from ..."
-- Not an instance of Outputable because of the "arising from" prefix
pprCtOrigin (GivenOrigin sk) = ctoHerald <+> ppr sk
pprCtOrigin (SpecPragOrigin ctxt)
pprCtOrigin (SpecPragOrigin ctxt)
= case ctxt of
FunSigCtxt n _ -> ptext (sLit "a SPECIALISE pragma for") <+> quotes (ppr n)
SpecInstCtxt -> ptext (sLit "a SPECIALISE INSTANCE pragma")
......@@ -2239,13 +2243,13 @@ pprCtOrigin (SpecPragOrigin ctxt)
pprCtOrigin (FunDepOrigin1 pred1 loc1 pred2 loc2)
= hang (ctoHerald <+> ptext (sLit "a functional dependency between constraints:"))
2 (vcat [ hang (quotes (ppr pred1)) 2 (pprArisingAt loc1)
, hang (quotes (ppr pred2)) 2 (pprArisingAt loc2) ])
2 (vcat [ hang (quotes (ppr pred1)) 2 (pprCtLoc loc1)
, hang (quotes (ppr pred2)) 2 (pprCtLoc loc2) ])
pprCtOrigin (FunDepOrigin2 pred1 orig1 pred2 loc2)
= hang (ctoHerald <+> ptext (sLit "a functional dependency between:"))
2 (vcat [ hang (ptext (sLit "constraint") <+> quotes (ppr pred1))
2 (pprArising orig1 )
2 (pprCtOrigin orig1 )
, hang (ptext (sLit "instance") <+> quotes (ppr pred2))
2 (ptext (sLit "at") <+> ppr loc2) ])
......@@ -2268,11 +2272,6 @@ pprCtOrigin (DerivOriginCoerce meth ty1 ty2)
2 (sep [ text "from type" <+> quotes (ppr ty1)
, nest 2 $ text "to type" <+> quotes (ppr ty2) ])
pprCtOrigin (CoercibleOrigin ty1 ty2)
= hang (ctoHerald <+> text "trying to show that the representations of")
2 (quotes (ppr ty1) <+> text "and" $$
quotes (ppr ty2) <+> text "are the same")
pprCtOrigin simple_origin
= ctoHerald <+> pprCtO simple_origin
......
T4846.hs:29:1:
T4846.hs:29:1: error:
Couldn't match type ‘Bool’ with ‘BOOL’
arising from trying to show that the representations of
‘Expr Bool’ and
‘Expr BOOL’ are the same
Relevant role signatures: type role Expr nominal
arising from a use of ‘coerce’
In the expression: coerce (mkExpr :: Expr Bool) :: Expr BOOL
In an equation for ‘mkExpr’:
mkExpr = coerce (mkExpr :: Expr Bool) :: Expr BOOL
......
T5498.hs:30:39:
T5498.hs:30:39: error:
Couldn't match representation of type ‘c a’
with that of ‘c (Down a)’
arising from the coercion of the method ‘intIso’
from type ‘forall (c :: * -> *). c a -> c Int’
to type ‘forall (c :: * -> *). c (Down a) -> c Int’
Relevant role signatures: type role Down representational
arising from the coercion of the method ‘intIso’
from type ‘forall (c :: * -> *). c a -> c Int’
to type ‘forall (c :: * -> *). c (Down a) -> c Int’
NB: We cannot know what roles the parameters to ‘c’ have;
we must assume that the role is nominal
When deriving the instance for (IntIso (Down a))
T6147.hs:13:32:
T6147.hs:13:32: error:
Couldn't match type ‘Int’ with ‘Foo’
arising from the coercion of the method ‘foo’
from type ‘Int -> T Int’ to type ‘Foo -> T Foo’
Relevant role signatures: type role T nominal
arising from the coercion of the method ‘foo’
from type ‘Int -> T Int’ to type ‘Foo -> T Foo’
When deriving the instance for (C Foo)
T7148.hs:27:40:
T7148.hs:27:40: error:
Occurs check: cannot construct the infinite type: b ~ Tagged a b
arising from the coercion of the method ‘iso2’
from type ‘forall b. SameType b () -> SameType b b’
to type ‘forall b. SameType b () -> SameType b (Tagged a b)’
Relevant role signatures:
type role Tagged phantom representational
type role SameType nominal nominal
arising from the coercion of the method ‘iso2’
from type ‘forall b. SameType b () -> SameType b b’
to type ‘forall b. SameType b () -> SameType b (Tagged a b)’
When deriving the instance for (IsoUnit (Tagged a b))
T7148.hs:27:40:
T7148.hs:27:40: error:
Occurs check: cannot construct the infinite type: b ~ Tagged a b
arising from the coercion of the method ‘iso1’
from type ‘forall b. SameType () b -> SameType b b’
to type ‘forall b. SameType () b -> SameType (Tagged a b) b’
Relevant role signatures:
type role Tagged phantom representational
type role SameType nominal nominal
arising from the coercion of the method ‘iso1’
from type ‘forall b. SameType () b -> SameType b b’
to type ‘forall b. SameType () b -> SameType (Tagged a b) b’
When deriving the instance for (IsoUnit (Tagged a b))
T7148a.hs:19:50:
T7148a.hs:19:50: error:
Couldn't match representation of type ‘b’ with that of ‘Result a b’
‘b’ is a rigid type variable bound by
the type forall b1. Proxy b1 -> a -> Result a b1 at T7148a.hs:19:50
arising from the coercion of the method ‘coerce’
from type ‘forall b. Proxy b -> a -> Result a b’
to type ‘forall b.
Proxy b -> IS_NO_LONGER a -> Result (IS_NO_LONGER a) b’
Relevant role signatures:
type role IS_NO_LONGER representational
type role Result nominal nominal
type role Proxy phantom
arising from the coercion of the method ‘coerce’
from type ‘forall b. Proxy b -> a -> Result a b’
to type ‘forall b.
Proxy b -> IS_NO_LONGER a -> Result (IS_NO_LONGER a) b’
‘b’ is a rigid type variable bound by
the type forall b1. Proxy b1 -> a -> Result a b1 at T7148a.hs:19:50
When deriving the instance for (Convert (IS_NO_LONGER a))
T8851.hs:24:12:
T8851.hs:24:12: error:
Couldn't match type ‘Parser’ with ‘MyParser’
arising from the coercion of the method ‘notFollowedBy’
from type ‘forall a.
(Monad Parser, Show a) =>
Parser a -> Parser ()’
to type ‘forall a.
(Monad MyParser, Show a) =>
MyParser a -> MyParser ()’
Relevant role signatures:
type role Monad nominal
type role Show nominal
type role MyParser phantom
type role Parser phantom
arising from the coercion of the method ‘notFollowedBy’
from type ‘forall a.
(Monad Parser, Show a) =>
Parser a -> Parser ()’
to type ‘forall a.
(Monad MyParser, Show a) =>
MyParser a -> MyParser ()’
When deriving the instance for (Parsing MyParser)
T8984.hs:7:46:
T8984.hs:7:46: error:
Couldn't match representation of type ‘cat a (N cat a Int)’
with that of ‘cat a (cat a Int)’
arising from the coercion of the method ‘app’
from type ‘cat a (cat a Int)’ to type ‘N cat a (N cat a Int)’
Relevant role signatures:
type role N representational nominal nominal
arising from the coercion of the method ‘app’
from type ‘cat a (cat a Int)’ to type ‘N cat a (N cat a Int)’
NB: We cannot know what roles the parameters to ‘cat a’ have;
we must assume that the role is nominal
When deriving the instance for (C (N cat a))
CasePrune.hs:14:31:
CasePrune.hs:14:31: error:
Couldn't match type ‘Int’ with ‘A’
arising from the coercion of the method ‘ic’
from type ‘T Int’ to type ‘T A’
Relevant role signatures: type role T nominal
arising from the coercion of the method ‘ic’
from type ‘T Int’ to type ‘T A’
When deriving the instance for (C A)
../../typecheck/should_run/Defer01.hs:11:40: Warning:
../../typecheck/should_run/Defer01.hs:11:40: warning:
Couldn't match type ‘Char’ with ‘[Char]’
Expected type: String
Actual type: Char
......@@ -7,17 +7,17 @@
In the second argument of ‘(>>)’, namely ‘putStr ','’
In the expression: putStr "Hello World" >> putStr ','
../../typecheck/should_run/Defer01.hs:14:5: Warning:
../../typecheck/should_run/Defer01.hs:14:5: warning:
Couldn't match expected type ‘Int’ with actual type ‘Char’
In the expression: 'p'
In an equation for ‘a’: a = 'p'
../../typecheck/should_run/Defer01.hs:18:9: Warning:
../../typecheck/should_run/Defer01.hs:18:9: warning:
No instance for (Eq B) arising from a use of ‘==’
In the expression: x == x
In an equation for ‘b’: b x = x == x
../../typecheck/should_run/Defer01.hs:25:4: Warning:
../../typecheck/should_run/Defer01.hs:25:4: warning:
Couldn't match type ‘Int’ with ‘Bool’
Inaccessible code in
a pattern with constructor: C2 :: Bool -> C Bool,
......@@ -25,14 +25,14 @@
In the pattern: C2 x
In an equation for ‘c’: c (C2 x) = True
../../typecheck/should_run/Defer01.hs:28:5: Warning:
../../typecheck/should_run/Defer01.hs:28:5: warning:
No instance for (Num (a -> a))
(maybe you haven't applied a function to enough arguments?)
arising from the literal ‘1’
In the expression: 1
In an equation for ‘d’: d = 1
../../typecheck/should_run/Defer01.hs:31:5: Warning:
../../typecheck/should_run/Defer01.hs:31:5: warning:
Couldn't match expected type ‘Char -> t’ with actual type ‘Char’
Relevant bindings include
f :: t (bound at ../../typecheck/should_run/Defer01.hs:31:1)
......@@ -41,11 +41,11 @@
In the expression: e 'q'
In an equation for ‘f’: f = e 'q'
../../typecheck/should_run/Defer01.hs:34:8: Warning:
../../typecheck/should_run/Defer01.hs:34:8: warning:
Couldn't match expected type ‘Char’ with actual type ‘a’
‘a’ is a rigid type variable bound by
the type signature for: h :: a -> (Char, Char)
at ../../typecheck/should_run/Defer01.hs:33:6
‘a’ is a rigid type variable bound by
the type signature for: h :: a -> (Char, Char)
at ../../typecheck/should_run/Defer01.hs:33:6
Relevant bindings include
x :: a (bound at ../../typecheck/should_run/Defer01.hs:34:3)
h :: a -> (Char, Char)
......@@ -53,7 +53,7 @@
In the expression: x
In the expression: (x, 'c')
../../typecheck/should_run/Defer01.hs:39:17: Warning:
../../typecheck/should_run/Defer01.hs:39:17: warning:
Couldn't match expected type ‘Bool’ with actual type ‘T a’
Relevant bindings include
a :: a (bound at ../../typecheck/should_run/Defer01.hs:39:3)
......@@ -61,12 +61,12 @@
In the first argument of ‘not’, namely ‘(K a)’
In the expression: (not (K a))
../../typecheck/should_run/Defer01.hs:43:5: Warning:
../../typecheck/should_run/Defer01.hs:43:5: warning:
No instance for (MyClass a1) arising from a use of ‘myOp’
In the expression: myOp 23
In an equation for ‘j’: j = myOp 23
../../typecheck/should_run/Defer01.hs:43:10: Warning:
../../typecheck/should_run/Defer01.hs:43:10: warning:
No instance for (Num a1) arising from the literal ‘23’
The type variable ‘a1’ is ambiguous
Note: there are several potential instances:
......@@ -78,7 +78,7 @@
In the expression: myOp 23
In an equation for ‘j’: j = myOp 23
../../typecheck/should_run/Defer01.hs:45:6: Warning:
../../typecheck/should_run/Defer01.hs:45:6: warning:
Couldn't match type ‘Int’ with ‘Bool’
Inaccessible code in
the type signature for: k :: (Int ~ Bool) => Int -> Bool
......@@ -87,30 +87,30 @@
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
In the type signature for ‘k’: k :: (Int ~ Bool) => Int -> Bool
../../typecheck/should_run/Defer01.hs:45:6: Warning:
../../typecheck/should_run/Defer01.hs:45:6: warning:
Couldn't match expected type ‘Bool’ with actual type ‘Int’
In the ambiguity check for the type signature for ‘k’:
k :: (Int ~ Bool) => Int -> Bool
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
In the type signature for ‘k’: k :: (Int ~ Bool) => Int -> Bool
../../typecheck/should_run/Defer01.hs:45:6: Warning:
../../typecheck/should_run/Defer01.hs:45:6: warning:
Couldn't match type ‘Int’ with ‘Bool’
Inaccessible code in
the type signature for: k :: (Int ~ Bool) => Int -> Bool
../../typecheck/should_run/Defer01.hs:46:7: Warning:
../../typecheck/should_run/Defer01.hs:46:7: warning:
Couldn't match expected type ‘Bool’ with actual type ‘Int’
In the expression: x
In an equation for ‘k’: k x = x
../../typecheck/should_run/Defer01.hs:49:5: Warning:
../../typecheck/should_run/Defer01.hs:49:5: warning:
Couldn't match expected type ‘IO a0’
with actual type ‘Char -> IO ()’
Probable cause: ‘putChar’ is applied to too few arguments
In the first argument of ‘(>>)’, namely ‘putChar’
In the expression: putChar >> putChar 'p'
*** Exception: ../../typecheck/should_run/Defer01.hs:11:40:
*** Exception: ../../typecheck/should_run/Defer01.hs:11:40: error:
Couldn't match type ‘Char’ with ‘[Char]’
Expected type: String
Actual type: Char
......@@ -118,31 +118,31 @@
In the second argument of ‘(>>)’, namely ‘putStr ','’
In the expression: putStr "Hello World" >> putStr ','
(deferred type error)
*** Exception: ../../typecheck/should_run/Defer01.hs:14:5:
*** Exception: ../../typecheck/should_run/Defer01.hs:14:5: error:
Couldn't match expected type ‘Int’ with actual type ‘Char’
In the expression: 'p'
In an equation for ‘a’: a = 'p'
(deferred type error)
*** Exception: ../../typecheck/should_run/Defer01.hs:18:9:
*** Exception: ../../typecheck/should_run/Defer01.hs:18:9: error:
No instance for (Eq B) arising from a use of ‘==’
In the expression: x == x
In an equation for ‘b’: b x = x == x
(deferred type error)
<interactive>:8:11:
<interactive>:8:11: error:
Couldn't match type ‘Bool’ with ‘Int’
Expected type: C Int
Actual type: C Bool
In the first argument of ‘c’, namely ‘(C2 True)’
In the first argument of ‘print’, namely ‘(c (C2 True))’
*** Exception: ../../typecheck/should_run/Defer01.hs:28:5:
*** Exception: ../../typecheck/should_run/Defer01.hs:28:5: error:
No instance for (Num (a -> a))
(maybe you haven't applied a function to enough arguments?)
arising from the literal ‘1’
In the expression: 1
In an equation for ‘d’: d = 1
(deferred type error)
*** Exception: ../../typecheck/should_run/Defer01.hs:31:5:
*** Exception: ../../typecheck/should_run/Defer01.hs:31:5: error:
Couldn't match expected type ‘Char -> t’ with actual type ‘Char’
Relevant bindings include
f :: t (bound at ../../typecheck/should_run/Defer01.hs:31:1)
......@@ -151,11 +151,11 @@
In the expression: e 'q'
In an equation for ‘f’: f = e 'q'
(deferred type error)
*** Exception: ../../typecheck/should_run/Defer01.hs:34:8:
*** Exception: ../../typecheck/should_run/Defer01.hs:34:8: error:
Couldn't match expected type ‘Char’ with actual type ‘a’
‘a’ is a rigid type variable bound by
the type signature for: h :: a -> (Char, Char)
at ../../typecheck/should_run/Defer01.hs:33:6
‘a’ is a rigid type variable bound by
the type signature for: h :: a -> (Char, Char)
at ../../typecheck/should_run/Defer01.hs:33:6
Relevant bindings include
x :: a (bound at ../../typecheck/should_run/Defer01.hs:34:3)
h :: a -> (Char, Char)
......@@ -163,7 +163,7 @@
In the expression: x
In the expression: (x, 'c')
(deferred type error)
*** Exception: ../../typecheck/should_run/Defer01.hs:39:17:
*** Exception: ../../typecheck/should_run/Defer01.hs:39:17: error:
Couldn't match expected type ‘Bool’ with actual type ‘T a’
Relevant bindings include
a :: a (bound at ../../typecheck/should_run/Defer01.hs:39:3)
......@@ -171,18 +171,18 @@
In the first argument of ‘not’, namely ‘(K a)’
In the expression: (not (K a))
(deferred type error)
*** Exception: ../../typecheck/should_run/Defer01.hs:43:5:
*** Exception: ../../typecheck/should_run/Defer01.hs:43:5: error:
No instance for (MyClass a1) arising from a use of ‘myOp’
In the expression: myOp 23
In an equation for ‘j’: j = myOp 23
(deferred type error)
<interactive>:14:8:
<interactive>:14:8: error:
Couldn't match expected type ‘Bool’ with actual type ‘Int’
In the first argument of ‘print’, namely ‘(k 2)’
In the expression: print (k 2)
In an equation for ‘it’: it = print (k 2)
*** Exception: ../../typecheck/should_run/Defer01.hs:49:5:
*** Exception: ../../typecheck/should_run/Defer01.hs:49:5: error:
Couldn't match expected type ‘IO a0’
with actual type ‘Char -> IO ()’
Probable cause: ‘putChar’ is applied to too few arguments
......
<interactive>:5:4:
<interactive>:5:4: error:
Couldn't match expected type ‘Ghci1.X’
with actual type ‘X’
NB: ‘Ghci1.X’ is defined at <interactive>:2:1-14
X’ is defined at <interactive>:4:1-25
NB: ‘X’ is defined at <interactive>:4:1-25
Ghci1.X’ is defined at <interactive>:2:1-14
In the first argument of ‘f’, namely ‘(Y 3)’
In the expression: f (Y 3)
<interactive>:6:49:
<interactive>:6:49: error:
Couldn't match expected type ‘ListableElem (a, a)’
with actual type ‘a’
‘a’ is a rigid type variable bound by
the instance declaration at <interactive>:6:10
‘a’ is a rigid type variable bound by
the instance declaration at <interactive>:6:10
Relevant bindings include
b :: a (bound at <interactive>:6:43)
a :: a (bound at <interactive>:6:41)
......
<interactive>:7:9:
<interactive>:7:9: error:
Couldn't match type ‘T’
with ‘Ghci1.T’
NB: ‘T’ is defined at <interactive>:6:1-16
Ghci1.T’ is defined at <interactive>:3:1-14
NB: ‘Ghci1.T’ is defined at <interactive>:3:1-14
T’ is defined at <interactive>:6:1-16
Expected type: T'
Actual type: T
In the expression: C :: T'
......
<interactive>:9:4:
<interactive>:9:4: error:
Couldn't match expected type ‘Ghci1.Planet’
with actual type ‘Planet’
NB: ‘Ghci1.Planet’ is defined at <interactive>:5:1-37
Planet’ is defined at <interactive>:8:1-36
NB: ‘Planet’ is defined at <interactive>:8:1-36
Ghci1.Planet’ is defined at <interactive>:5:1-37
In the first argument of ‘pn’, namely ‘Mercury’
In the expression: pn Mercury
<interactive>:10:4:
<interactive>:10:4: error:
Couldn't match expected type ‘Ghci1.Planet’
with actual type ‘Planet’
NB: ‘Ghci1.Planet’ is defined at <interactive>:5:1-37
Planet’ is defined at <interactive>:8:1-36
NB: ‘Planet’ is defined at <interactive>:8:1-36
Ghci1.Planet’ is defined at <interactive>:5:1-37
In the first argument of ‘pn’, namely ‘Venus’
In the expression: pn Venus
<interactive>:11:4:
<interactive>:11:4: error:
Couldn't match expected type ‘Ghci1.Planet’
with actual type ‘Planet’
NB: ‘Ghci1.Planet’ is defined at <interactive>:5:1-37
Planet’ is defined at <interactive>:8:1-36
NB: ‘Planet’ is defined at <interactive>:8:1-36
Ghci1.Planet’ is defined at <interactive>:5:1-37
In the first argument of ‘pn’, namely ‘Mars’
In the expression: pn Mars
<interactive>:13:44:
<interactive>:13:44: error:
Couldn't match expected type ‘Planet’
with actual type ‘Ghci1.Planet’
NB: ‘Planet’ is defined at <interactive>:8:1-36
Ghci1.Planet’ is defined at <interactive>:5:1-37
NB: ‘Ghci1.Planet’ is defined at <interactive>:5:1-37
Planet’ is defined at <interactive>:8:1-36
In the pattern: Earth
In an equation for ‘pn’: pn Earth = "E"
<interactive>:10:12:
<interactive>:10:12: error:
Couldn't match expected type ‘Ghci1.Planet’
with actual type ‘Planet’
NB: ‘Ghci1.Planet’ is defined at <interactive>:5:1-49
Planet’ is defined at <interactive>:8:1-41
NB: ‘Planet’ is defined at <interactive>:8:1-41
Ghci1.Planet’ is defined at <interactive>:5:1-49
In the second argument of ‘(==)’, namely ‘Mercury’
In the expression: mercury == Mercury
<interactive>:12:10:
<interactive>:12:10: error:
Couldn't match expected type ‘Planet’
with actual type ‘Ghci1.Planet’
NB: ‘Planet’ is defined at <interactive>:8:1-41
Ghci1.Planet’ is defined at <interactive>:5:1-49
NB: ‘Ghci1.Planet’ is defined at <interactive>:5:1-49
Planet’ is defined at <interactive>:8:1-41
In the second argument of ‘(==)’, namely ‘Earth’
In the expression: Venus == Earth
T6088.hs:16:33:
T6088.hs:16:33: error:
Couldn't match type ‘Pos n’ with ‘True’
arising from the 'deriving' clause of a data type declaration
When deriving the instance for (C (B n))
[1 of 2] Compiling T9580a ( T9580a.hs, T9580a.o )
[2 of 2] Compiling T9580 ( T9580.hs, T9580.o )
T9580.hs:7:9:
Couldn't match representation of type ‘Dimensional Int Double’
with that of ‘Double’
Relevant role signatures: type role Dimensional nominal nominal
The data constructor ‘T9580a.Quantity'’
of newtype ‘Dimensional Int v’ is not in scope
In the expression: coerce x
In an equation for ‘foo’: foo x = coerce x
[1 of 2] Compiling T9580a ( T9580a.hs, T9580a.o )
[2 of 2] Compiling T9580 ( T9580.hs, T9580.o )
T9580.hs:7:9: error:
Couldn't match representation of type ‘Dimensional Int Double’
with that of ‘Double’
arising from a use of ‘coerce’
The data constructor ‘T9580a.Quantity'’
of newtype ‘Dimensional Int v’ is not in scope
In the expression: coerce x
In an equation for ‘foo’: foo x = coerce x
mod180.hs:8:5:
mod180.hs:8:5: error:
Couldn't match expected type ‘T’
with actual type ‘main:Mod180_A.T’
NB: ‘T’ is defined at Mod180_B.hs:3:1-10
main:Mod180_A.T’ is defined at Mod180_A.hs:3:1-10
NB: ‘main:Mod180_A.T’ is defined at Mod180_A.hs:3:1-10
T’ is defined at Mod180_B.hs:3:1-10
In the expression: x
In an equation for ‘z’: z = x
T7438.hs:6:14:
T7438.hs:6:14: error:
Couldn't match expected type ‘t1’ with actual type ‘t’
‘t’ is untouchable
inside the constraints: t2 ~ t3
......@@ -7,10 +7,10 @@ T7438.hs:6:14:
Nil :: forall (k :: BOX) (b :: k). Thrist b b,
in an equation for ‘go’
at T7438.hs:6:4-6
‘t’ is a rigid type variable bound by
the inferred type of go :: Thrist t2 t3 -> t -> t1 at T7438.hs:6:1
‘t1’ is a rigid type variable bound by
the inferred type of go :: Thrist t2 t3 -> t -> t1 at T7438.hs:6:1
‘t’ is a rigid type variable bound by
the inferred type of go :: Thrist t2 t3 -> t -> t1 at T7438.hs:6:1
‘t1’ is a rigid type variable bound by
the inferred type of go :: Thrist t2 t3 -> t -> t1 at T7438.hs:6:1
Possible fix: add a type signature for ‘go’
Relevant bindings include
acc :: t (bound at T7438.hs:6:8)
......
Roles10.hs:16:12:
Roles10.hs:16:12: error:
Couldn't match representation of type ‘Bool’ with that of ‘Char’
arising from the coercion of the method ‘meth’
from type ‘Int -> F Int’ to type ‘Age -> F Age’
Relevant role signatures: type role F nominal
arising from the coercion of the method ‘meth’
from type ‘Int -> F Int’ to type ‘Age -> F Age’
When deriving the instance for (C Age)
RolesIArray.hs:10:13:
RolesIArray.hs:10:13: error:
Couldn't match type ‘Word64’ with ‘N’
arising from the coercion of the method ‘Data.Array.Base.unsafeAccumArray’
from type ‘forall e' i.
Ix i =>
(Word64 -> e' -> Word64)
-> Word64 -> (i, i) -> [(Int, e')] -> UArray i Word64’
to type ‘forall e' i.