From c05fdddec71f9dc8ebe62d751ccf03367128072a Mon Sep 17 00:00:00 2001
From: Evan Laforge
Date: Tue, 24 Nov 2015 12:43:18 +0100
Subject: [PATCH] Rearrange error msgs and add section markers (Trac #11014).
MIMEVersion: 1.0
ContentType: text/plain; charset=UTF8
ContentTransferEncoding: 8bit
This puts the "Relevant bindings" section at the end.
It uses a TcErrors.Report Monoid to divide messages by importance and
then mappends them together. This is not the most efficient way since
there are various intermediate Reports and list appends, but it probably
doesn't matter since error messages shouldn't get that large, and are
usually prepended. In practice, everything is `important` except
`relevantBindings`, which is `supplementary`.
ErrMsg's errMsgShortDoc and errMsgExtraInfo were extracted into ErrDoc,
which has important, context, and suppelementary fields. Each of those
three sections is marked with a bullet character, '•' on unicode
terminals and '*' on ascii terminals. Since this breaks tons of tests,
I also modified testlib.normalise_errmsg to strip out '•'s.
 Additional notes:
To avoid prepending * to an empty doc, I needed to filter empty docs.
This seemed less errorprone than trying to modify everyone who produces
SDoc to instead produce Maybe SDoc. So I added `Outputable.isEmpty`.
Unfortunately it needs a DynFlags, which is kind of bogus, but otherwise
I think I'd need another Empty case for SDoc, and then it couldn't be a
newtype any more.
ErrMsg's errMsgShortString is only used by the Show instance, which is
in turn only used by Show HscTypes.SourceError, which is in turn only
needed for the Exception instance. So it's probably possible to get rid
of errMsgShortString, but that would a be an unrelated cleanup.
Fixes #11014.
Test Plan: see above
Reviewers: austin, simonpj, thomie, bgamari
Reviewed By: thomie, bgamari
Subscribers: simonpj, nomeata, thomie
Differential Revision: https://phabricator.haskell.org/D1427
GHC Trac Issues: #11014

compiler/cmm/CmmLayoutStack.hs  2 +
compiler/main/ErrUtils.hs  80 ++++++
compiler/typecheck/TcErrors.hs  166 ++++++++++++
compiler/typecheck/TcRnMonad.hs  10 +
compiler/utils/Outputable.hs  8 +
testsuite/driver/testlib.py  12 +
.../tests/arrows/should_fail/T5380.stderr  8 +
testsuite/tests/driver/T2507.stderr  6 +
testsuite/tests/driver/T6037.stderr  6 +
testsuite/tests/driver/T8959a.stderr  6 +
testsuite/tests/gadt/T3169.stderr  4 +
testsuite/tests/gadt/T7558.stderr  4 +
testsuite/tests/gadt/gadtescape1.stderr  4 +
testsuite/tests/gadt/gadt13.stderr  4 +
testsuite/tests/gadt/gadt7.stderr  4 +
testsuite/tests/gadt/rw.stderr  10 +
testsuite/tests/ghci/scripts/Defer02.stderr  24 +
testsuite/tests/ghci/scripts/ghci050.stderr  4 +
.../should_compile/PushedInAsGivens.stderr  10 +
.../should_compile/T3208b.stderr  6 +
.../should_fail/ExtraTcsUntch.stderr  12 +
.../should_fail/GADTwrong1.stderr  4 +
.../should_fail/Overlap10.stderr  4 +
.../should_fail/Overlap11.stderr  4 +
.../should_fail/Overlap15.stderr  4 +
.../indexedtypes/should_fail/Overlap6.stderr  4 +
.../indexedtypes/should_fail/Overlap9.stderr  4 +
.../should_fail/SimpleFail16.stderr  4 +
.../should_fail/SimpleFail5a.stderr  4 +
.../indexedtypes/should_fail/T2544.stderr  8 +
.../indexedtypes/should_fail/T2664.stderr  6 +
.../indexedtypes/should_fail/T2693.stderr  4 +
.../indexedtypes/should_fail/T3330a.stderr  12 +
.../indexedtypes/should_fail/T3330c.stderr  4 +
.../indexedtypes/should_fail/T3440.stderr  4 +
.../indexedtypes/should_fail/T4093a.stderr  2 +
.../indexedtypes/should_fail/T4093b.stderr  18 +
.../indexedtypes/should_fail/T4099.stderr  8 +
.../indexedtypes/should_fail/T4174.stderr  8 +
.../indexedtypes/should_fail/T4179.stderr  4 +
.../indexedtypes/should_fail/T4272.stderr  6 +
.../indexedtypes/should_fail/T5439.stderr  4 +
.../indexedtypes/should_fail/T6123.stderr  2 +
.../indexedtypes/should_fail/T7194.stderr  4 +
.../indexedtypes/should_fail/T7354.stderr  4 +
.../indexedtypes/should_fail/T7354a.stderr  2 +
.../indexedtypes/should_fail/T7729.stderr  4 +
.../indexedtypes/should_fail/T7729a.stderr  4 +
.../indexedtypes/should_fail/T7786.stderr  18 +
.../indexedtypes/should_fail/T8129.stdout  2 +
.../indexedtypes/should_fail/T8227.stderr  10 +
.../indexedtypes/should_fail/T8518.stderr  16 +
.../indexedtypes/should_fail/T9662.stderr  24 +
testsuite/tests/module/mod71.stderr  6 +
.../tests/parser/should_fail/T7848.stderr  26 +
.../parser/should_fail/readFail003.stderr  8 +
.../should_compile/SplicesUsed.stderr  8 +
.../partialsigs/should_compile/T10438.stderr  10 +
.../partialsigs/should_compile/T10463.stderr  4 +
.../should_compile/TypedSplice.stderr  8 +
.../NamedWildcardsNotEnabled.stderr  8 +
.../partialsigs/should_fail/T10045.stderr  6 +
.../partialsigs/should_fail/T10615.stderr  4 +
.../partialsigs/should_fail/Trac10045.stderr  92 +++++
.../WildcardsInPatternAndExprSig.stderr  36 ++
testsuite/tests/polykinds/T7230.stderr  6 +
testsuite/tests/polykinds/T7438.stderr  4 +
testsuite/tests/polykinds/T7594.stderr  2 +
.../simplCore/should_compile/simpl017.stderr  20 +
testsuite/tests/th/T10267.stderr  12 +
testsuite/tests/th/T7276a.stdout  28 +
.../tests/typecheck/should_compile/FD1.stderr  2 +
.../tests/typecheck/should_compile/FD2.stderr  4 +
.../tests/typecheck/should_compile/FD3.stderr  4 +
.../typecheck/should_compile/T2494.stderr  8 +
.../typecheck/should_compile/T9497a.stderr  2 +
.../typecheck/should_compile/T9834.stderr  12 +
.../typecheck/should_compile/holes.stderr  14 +
.../typecheck/should_compile/holes2.stderr  2 +
.../typecheck/should_compile/holes3.stderr  14 +
.../typecheck/should_compile/tc141.stderr  8 +
.../should_fail/FDsFromGivens2.stderr  4 +
.../should_fail/FrozenErrorTests.stderr  12 +
.../tests/typecheck/should_fail/T10285.stderr  4 +
.../tests/typecheck/should_fail/T10495.stderr  2 +
.../tests/typecheck/should_fail/T10534.stderr  4 +
.../typecheck/should_fail/T10715b.stderr  2 +
.../tests/typecheck/should_fail/T1899.stderr  4 +
.../tests/typecheck/should_fail/T2534.stderr  2 +
.../tests/typecheck/should_fail/T2688.stderr  4 +
.../tests/typecheck/should_fail/T2714.stderr  8 +
.../tests/typecheck/should_fail/T3950.stderr  4 +
.../tests/typecheck/should_fail/T5689.stderr  4 +
.../tests/typecheck/should_fail/T5853.stderr  4 +
.../tests/typecheck/should_fail/T7264.stderr  4 +
.../tests/typecheck/should_fail/T7368a.stderr  4 +
.../tests/typecheck/should_fail/T7453.stderr  18 +
.../tests/typecheck/should_fail/T7696.stderr  2 +
.../tests/typecheck/should_fail/T7734.stderr  8 +
.../tests/typecheck/should_fail/T7748a.stderr  10 +
.../tests/typecheck/should_fail/T7869.stderr  8 +
.../tests/typecheck/should_fail/T8044.stderr  4 +
.../tests/typecheck/should_fail/T8142.stderr  4 +
.../tests/typecheck/should_fail/T8262.stderr  4 +
.../tests/typecheck/should_fail/T8428.stderr  4 +
.../tests/typecheck/should_fail/T8450.stderr  2 +
.../tests/typecheck/should_fail/T9109.stderr  2 +
.../tests/typecheck/should_fail/T9497d.stderr  2 +
.../tests/typecheck/should_fail/T9605.stderr  2 +
.../tests/typecheck/should_fail/T9612.stderr  10 +
.../should_fail/TcCoercibleFail.stderr  4 +
.../tests/typecheck/should_fail/mc22.stderr  2 +
.../tests/typecheck/should_fail/mc23.stderr  2 +
.../tests/typecheck/should_fail/mc24.stderr  2 +
.../tests/typecheck/should_fail/mc25.stderr  2 +
.../typecheck/should_fail/tcfail001.stderr  2 +
.../typecheck/should_fail/tcfail002.stderr  4 +
.../typecheck/should_fail/tcfail004.stderr  4 +
.../typecheck/should_fail/tcfail005.stderr  4 +
.../typecheck/should_fail/tcfail013.stderr  2 +
.../typecheck/should_fail/tcfail014.stderr  4 +
.../typecheck/should_fail/tcfail016.stderr  8 +
.../typecheck/should_fail/tcfail032.stderr  4 +
.../typecheck/should_fail/tcfail033.stderr  4 +
.../typecheck/should_fail/tcfail065.stderr  4 +
.../typecheck/should_fail/tcfail068.stderr  18 +
.../typecheck/should_fail/tcfail076.stderr  4 +
.../typecheck/should_fail/tcfail099.stderr  4 +
.../typecheck/should_fail/tcfail103.stderr  4 +
.../typecheck/should_fail/tcfail122.stderr  2 +
.../typecheck/should_fail/tcfail131.stderr  4 +
.../typecheck/should_fail/tcfail140.stderr  12 +
.../typecheck/should_fail/tcfail153.stderr  6 +
.../typecheck/should_fail/tcfail174.stderr  8 +
.../typecheck/should_fail/tcfail175.stderr  4 +
.../typecheck/should_fail/tcfail178.stderr  4 +
.../typecheck/should_fail/tcfail179.stderr  4 +
.../typecheck/should_fail/tcfail182.stderr  4 +
.../typecheck/should_fail/tcfail198.stderr  4 +
.../typecheck/should_fail/tcfail200.stderr  4 +
.../typecheck/should_fail/tcfail201.stderr  4 +
.../typecheck/should_fail/tcfail206.stderr  8 +
.../tests/typecheck/should_run/T10284.stdout  6 +
.../tests/typecheck/should_run/T7861.stderr  4 +
.../typecheck/should_run/T9497arun.stderr  4 +
.../typecheck/should_run/T9497brun.stderr  4 +
.../typecheck/should_run/T9497crun.stderr  4 +
.../typecheck/should_run/tcrun035.stderr  4 +
148 files changed, 690 insertions(+), 590 deletions()
diff git a/compiler/cmm/CmmLayoutStack.hs b/compiler/cmm/CmmLayoutStack.hs
index 90fc613475..2c332a524d 100644
 a/compiler/cmm/CmmLayoutStack.hs
+++ b/compiler/cmm/CmmLayoutStack.hs
@@ 25,7 +25,7 @@ import Util
import DynFlags
import FastString
import Outputable
+import Outputable hiding ( isEmpty )
import qualified Data.Set as Set
import Control.Monad.Fix
import Data.Array as Array
diff git a/compiler/main/ErrUtils.hs b/compiler/main/ErrUtils.hs
index 11c8c9d0db..efdf808369 100644
 a/compiler/main/ErrUtils.hs
+++ b/compiler/main/ErrUtils.hs
@@ 10,14 +10,15 @@ module ErrUtils (
MsgDoc,
Validity(..), andValid, allValid, isValid, getInvalids,
 ErrMsg, WarnMsg, Severity(..),
+ ErrMsg, ErrDoc, errDoc, WarnMsg, Severity(..),
Messages, ErrorMessages, WarningMessages,
 errMsgSpan, errMsgContext, errMsgShortDoc, errMsgExtraInfo,
+ errMsgSpan, errMsgContext,
mkLocMessage, pprMessageBag, pprErrMsgBagWithLoc,
pprLocErrMsg, makeIntoWarning,
errorsFound, emptyMessages, isEmptyMessages,
 mkErrMsg, mkPlainErrMsg, mkLongErrMsg, mkWarnMsg, mkPlainWarnMsg,
+ mkErrMsg, mkPlainErrMsg, mkErrDoc, mkLongErrMsg, mkWarnMsg,
+ mkPlainWarnMsg,
printBagOfErrors,
warnIsErrorMsg, mkLongWarnMsg,
@@ 94,13 +95,28 @@ type ErrorMessages = Bag ErrMsg
data ErrMsg = ErrMsg {
errMsgSpan :: SrcSpan,
errMsgContext :: PrintUnqualified,
 errMsgShortDoc :: MsgDoc,  errMsgShort* should always
 errMsgShortString :: String,  contain the same text
 errMsgExtraInfo :: MsgDoc,
+ errMsgDoc :: ErrDoc,
+   This has the same text as errDocImportant . errMsgDoc.
+ errMsgShortString :: String,
errMsgSeverity :: Severity
}
 The SrcSpan is used for sorting errors into linenumber order
+  Categorise error msgs by their importance. This is so each section can
+ be rendered visually distinct. See Note [Error report] for where these come
+ from.
+data ErrDoc = ErrDoc {
+   Primary error msg.
+ errDocImportant :: [MsgDoc],
+   Context e.g. \"In the second argument of ...\".
+ _errDocContext :: [MsgDoc],
+   Supplementary information, e.g. \"Relevant bindings include ...\".
+ _errDocSupplementary :: [MsgDoc]
+ }
+
+errDoc :: [MsgDoc] > [MsgDoc] > [MsgDoc] > ErrDoc
+errDoc = ErrDoc
+
type WarnMsg = ErrMsg
data Severity
@@ 156,13 +172,17 @@ makeIntoWarning err = err { errMsgSeverity = SevWarning }
 
 Collecting up messages for later ordering and printing.
mk_err_msg :: DynFlags > Severity > SrcSpan > PrintUnqualified > MsgDoc > SDoc > ErrMsg
mk_err_msg dflags sev locn print_unqual msg extra
 = ErrMsg { errMsgSpan = locn, errMsgContext = print_unqual
 , errMsgShortDoc = msg , errMsgShortString = showSDoc dflags msg
 , errMsgExtraInfo = extra
+mk_err_msg :: DynFlags > Severity > SrcSpan > PrintUnqualified > ErrDoc > ErrMsg
+mk_err_msg dflags sev locn print_unqual doc
+ = ErrMsg { errMsgSpan = locn
+ , errMsgContext = print_unqual
+ , errMsgDoc = doc
+ , errMsgShortString = showSDoc dflags (vcat (errDocImportant doc))
, errMsgSeverity = sev }
+mkErrDoc :: DynFlags > SrcSpan > PrintUnqualified > ErrDoc > ErrMsg
+mkErrDoc dflags = mk_err_msg dflags SevError
+
mkLongErrMsg, mkLongWarnMsg :: DynFlags > SrcSpan > PrintUnqualified > MsgDoc > MsgDoc > ErrMsg
 A long (multiline) error message
mkErrMsg, mkWarnMsg :: DynFlags > SrcSpan > PrintUnqualified > MsgDoc > ErrMsg
@@ 170,12 +190,12 @@ mkErrMsg, mkWarnMsg :: DynFlags > SrcSpan > PrintUnqualified > MsgD
mkPlainErrMsg, mkPlainWarnMsg :: DynFlags > SrcSpan > MsgDoc > ErrMsg
 Variant that doesn't care about qualified/unqualified names
mkLongErrMsg dflags locn unqual msg extra = mk_err_msg dflags SevError locn unqual msg extra
mkErrMsg dflags locn unqual msg = mk_err_msg dflags SevError locn unqual msg empty
mkPlainErrMsg dflags locn msg = mk_err_msg dflags SevError locn alwaysQualify msg empty
mkLongWarnMsg dflags locn unqual msg extra = mk_err_msg dflags SevWarning locn unqual msg extra
mkWarnMsg dflags locn unqual msg = mk_err_msg dflags SevWarning locn unqual msg empty
mkPlainWarnMsg dflags locn msg = mk_err_msg dflags SevWarning locn alwaysQualify msg empty
+mkLongErrMsg dflags locn unqual msg extra = mk_err_msg dflags SevError locn unqual (ErrDoc [msg] [] [extra])
+mkErrMsg dflags locn unqual msg = mk_err_msg dflags SevError locn unqual (ErrDoc [msg] [] [])
+mkPlainErrMsg dflags locn msg = mk_err_msg dflags SevError locn alwaysQualify (ErrDoc [msg] [] [])
+mkLongWarnMsg dflags locn unqual msg extra = mk_err_msg dflags SevWarning locn unqual (ErrDoc [msg] [] [extra])
+mkWarnMsg dflags locn unqual msg = mk_err_msg dflags SevWarning locn unqual (ErrDoc [msg] [] [])
+mkPlainWarnMsg dflags locn msg = mk_err_msg dflags SevWarning locn alwaysQualify (ErrDoc [msg] [] [])

emptyMessages :: Messages
@@ 194,34 +214,42 @@ errorsFound _dflags (_warns, errs) = not (isEmptyBag errs)
printBagOfErrors :: DynFlags > Bag ErrMsg > IO ()
printBagOfErrors dflags bag_of_errors
= sequence_ [ let style = mkErrStyle dflags unqual
 in log_action dflags dflags sev s style (d $$ e)
+ in log_action dflags dflags sev s style (formatErrDoc dflags doc)
 ErrMsg { errMsgSpan = s,
 errMsgShortDoc = d,
+ errMsgDoc = doc,
errMsgSeverity = sev,
 errMsgExtraInfo = e,
errMsgContext = unqual } < sortMsgBag (Just dflags)
 bag_of_errors
 ]
+ bag_of_errors ]
+
+formatErrDoc :: DynFlags > ErrDoc > SDoc
+formatErrDoc dflags (ErrDoc important context supplementary)
+ = case msgs of
+ [msg] > vcat msg
+ _ > vcat $ map starred msgs
+ where
+ msgs = filter (not . null) $ map (filter (not . Outputable.isEmpty dflags))
+ [important, context, supplementary]
+ starred = (bullet<+>) . vcat
+ bullet = text $ if DynFlags.useUnicode dflags then "•" else "*"
pprErrMsgBagWithLoc :: Bag ErrMsg > [SDoc]
pprErrMsgBagWithLoc bag = [ pprLocErrMsg item  item < sortMsgBag Nothing bag ]
pprLocErrMsg :: ErrMsg > SDoc
pprLocErrMsg (ErrMsg { errMsgSpan = s
 , errMsgShortDoc = d
 , errMsgExtraInfo = e
+ , errMsgDoc = doc
, errMsgSeverity = sev
, errMsgContext = unqual })
= sdocWithDynFlags $ \dflags >
withPprStyle (mkErrStyle dflags unqual) $
 mkLocMessage sev s (d $$ e)
+ mkLocMessage sev s (formatErrDoc dflags doc)
sortMsgBag :: Maybe DynFlags > Bag ErrMsg > [ErrMsg]
sortMsgBag dflags = sortBy (maybeFlip $ comparing errMsgSpan) . bagToList
where maybeFlip :: (a > a > b) > (a > a > b)
maybeFlip
 fromMaybe False (fmap reverseErrors dflags) = flip
  otherwise = id
+  otherwise = id
ghcExit :: DynFlags > Int > IO ()
ghcExit dflags val
diff git a/compiler/typecheck/TcErrors.hs b/compiler/typecheck/TcErrors.hs
index 38273630b6..c733d21705 100644
 a/compiler/typecheck/TcErrors.hs
+++ b/compiler/typecheck/TcErrors.hs
@@ 35,7 +35,7 @@ import VarSet
import VarEnv
import NameSet
import Bag
import ErrUtils ( ErrMsg, pprLocErrMsg )
+import ErrUtils ( ErrMsg, errDoc, pprLocErrMsg )
import BasicTypes
import Util
import FastString
@@ 49,6 +49,11 @@ import Control.Monad ( when )
import Data.Maybe
import Data.List ( partition, mapAccumL, nub, sortBy )
+#if __GLASGOW_HASKELL__ < 709
+import Data.Monoid ( Monoid, mempty, mappend, mconcat )
+#endif
+
+
{
************************************************************************
* *
@@ 179,6 +184,38 @@ report_unsolved mb_binds_var err_as_warn type_errors expr_holes type_holes wante
 Internal functions

+  An error Report collects messages categorised by their importance.
+ See Note [Error report] for details.
+data Report
+ = Report { report_important :: [SDoc]
+ , report_relevant_bindings :: [SDoc]
+ }
+
+{ Note [Error report]
+The idea is that error msgs are divided into three parts: the main msg, the
+context block (\"In the second argument of ...\"), and the relevant bindings
+block, which are displayed in that order, with a mark to divide them. The
+idea is that the main msg ('report_important') varies depending on the error
+in question, but context and relevant bindings are always the same, which
+should simplify visual parsing.
+
+The context is added when the the Report is passed off to 'mkErrorReport'.
+Unfortunately, unlike the context, the relevant bindings are added in
+multiple places so they have to be in the Report.
+}
+
+instance Monoid Report where
+ mempty = Report [] []
+ mappend (Report a1 b1) (Report a2 b2) = Report (a1 ++ a2) (b1 ++ b2)
+
+  Put a doc into the important msgs block.
+important :: SDoc > Report
+important doc = mempty { report_important = [doc] }
+
+  Put a doc into the relevant bindings block.
+relevant_bindings :: SDoc > Report
+relevant_bindings doc = mempty { report_relevant_bindings = [doc] }
+
data TypeErrorChoice  What to do for type errors found by the type checker
= TypeError  A type error aborts compilation with an error message
 TypeWarn  A type error is deferred to runtime, plus a compiletime warning
@@ 278,13 +315,13 @@ warnRedundantConstraints ctxt env info ev_vars
 to the error context, which is a bit tiresome
addErrCtxt (ptext (sLit "In") <+> ppr info) $
do { env < getLclEnv
 ; msg < mkErrorMsg ctxt env doc
+ ; msg < mkErrorReport ctxt env (important doc)
; reportWarning msg }
 otherwise  But for InstSkol there already *is* a surrounding
 "In the instance declaration for Eq [a]" context
 and we don't want to say it twice. Seems a bit adhoc
 = do { msg < mkErrorMsg ctxt env doc
+ = do { msg < mkErrorReport ctxt env (important doc)
; reportWarning msg }
where
doc = ptext (sLit "Redundant constraint") <> plural redundant_evs <> colon
@@ 445,6 +482,7 @@ mkUserTypeErrorReporter ctxt
mkUserTypeError :: ReportErrCtxt > Ct > TcM ErrMsg
mkUserTypeError ctxt ct = mkErrorMsgFromCt ctxt ct
+ $ important
$ pprUserTypeErrorTy
$ case getUserTypeErrorMsg ct of
Just (_,msg) > msg
@@ 612,14 +650,16 @@ pprWithArising (ct:cts)
ppr_one ct' = hang (parens (pprType (ctPred ct')))
2 (pprCtLoc (ctLoc ct'))
mkErrorMsgFromCt :: ReportErrCtxt > Ct > SDoc > TcM ErrMsg
mkErrorMsgFromCt ctxt ct msg
 = mkErrorMsg ctxt (ctLocEnv (ctLoc ct)) msg
+mkErrorMsgFromCt :: ReportErrCtxt > Ct > Report > TcM ErrMsg
+mkErrorMsgFromCt ctxt ct report
+ = mkErrorReport ctxt (ctLocEnv (ctLoc ct)) report
mkErrorMsg :: ReportErrCtxt > TcLclEnv > SDoc > TcM ErrMsg
mkErrorMsg ctxt tcl_env msg
 = do { err_info < mkErrInfo (cec_tidy ctxt) (tcl_ctxt tcl_env)
 ; mkLongErrAt (RealSrcSpan (tcl_loc tcl_env)) msg err_info }
+mkErrorReport :: ReportErrCtxt > TcLclEnv > Report > TcM ErrMsg
+mkErrorReport ctxt tcl_env (Report important relevant_bindings)
+ = do { context < mkErrInfo (cec_tidy ctxt) (tcl_ctxt tcl_env)
+ ; mkErrDocAt (RealSrcSpan (tcl_loc tcl_env))
+ (errDoc important [context] relevant_bindings)
+ }
type UserGiven = ([EvVar], SkolemInfo, Bool, RealSrcSpan)
@@ 713,7 +753,8 @@ mkIrredErr ctxt cts
= do { (ctxt, binds_msg, ct1) < relevantBindings True ctxt ct1
; let orig = ctOrigin ct1
msg = couldNotDeduce (getUserGivens ctxt) (map ctPred cts, orig)
 ; mkErrorMsgFromCt ctxt ct1 (msg $$ binds_msg) }
+ ; mkErrorMsgFromCt ctxt ct1 $
+ important msg `mappend` relevant_bindings binds_msg }
where
(ct1:_) = cts
@@ 725,14 +766,16 @@ mkHoleError ctxt ct@(CHoleCan { cc_occ = occ, cc_hole = hole_sort })
= do { dflags < getDynFlags
; rdr_env < getGlobalRdrEnv
; impInfo < getImports
 ; mkLongErrAt (RealSrcSpan (tcl_loc lcl_env)) out_of_scope_msg
 (unknownNameSuggestions dflags rdr_env
 (tcl_rdr lcl_env) impInfo (mkRdrUnqual occ)) }
+ ; mkErrDocAt (RealSrcSpan (tcl_loc lcl_env)) $
+ errDoc [out_of_scope_msg] []
+ [unknownNameSuggestions dflags rdr_env
+ (tcl_rdr lcl_env) impInfo (mkRdrUnqual occ)] }
 otherwise  Explicit holes, like "_" or "_f"
 = do { (ctxt, binds_doc, ct) < relevantBindings False ctxt ct
+ = do { (ctxt, binds_msg, ct) < relevantBindings False ctxt ct
 The 'False' means "don't filter the bindings"; see Trac #8191
 ; mkErrorMsgFromCt ctxt ct (hole_msg $$ binds_doc) }
+ ; mkErrorMsgFromCt ctxt ct $
+ important hole_msg `mappend` relevant_bindings binds_msg }
where
ct_loc = ctLoc ct
@@ 786,7 +829,7 @@ mkHoleError _ ct = pprPanic "mkHoleError" (ppr ct)

mkIPErr :: ReportErrCtxt > [Ct] > TcM ErrMsg
mkIPErr ctxt cts
 = do { (ctxt, bind_msg, ct1) < relevantBindings True ctxt ct1
+ = do { (ctxt, binds_msg, ct1) < relevantBindings True ctxt ct1
; let orig = ctOrigin ct1
preds = map ctPred cts
givens = getUserGivens ctxt
@@ 797,7 +840,8 @@ mkIPErr ctxt cts
 otherwise
= couldNotDeduce givens (preds, orig)
 ; mkErrorMsgFromCt ctxt ct1 (msg $$ bind_msg) }
+ ; mkErrorMsgFromCt ctxt ct1 $
+ important msg `mappend` relevant_bindings binds_msg }
where
(ct1:_) = cts
@@ 840,7 +884,8 @@ mkEqErr1 ctxt ct
= do { (ctxt, binds_msg, ct) < relevantBindings True ctxt ct
; let (given_loc, given_msg) = mk_given (ctLoc ct) (cec_encl ctxt)
; dflags < getDynFlags
 ; mkEqErr_help dflags ctxt (given_msg $$ binds_msg)
+ ; let report = important given_msg `mappend` relevant_bindings binds_msg
+ ; mkEqErr_help dflags ctxt report
(setCtLoc ct given_loc)  Note [Inaccessible code]
Nothing ty1 ty2 }
@@ 855,8 +900,9 @@ mkEqErr1 ctxt ct
ReprEq > mkCoercibleExplanation rdr_env fam_envs ty1 ty2
; dflags < getDynFlags
; traceTc "mkEqErr1" (ppr ct $$ pprCtOrigin (ctOrigin ct))
 ; mkEqErr_help dflags ctxt (wanted_msg $$ coercible_msg $$ binds_msg)
 ct is_oriented ty1 ty2 }
+ ; let report = mconcat [important wanted_msg, important coercible_msg,
+ relevant_bindings binds_msg]
+ ; mkEqErr_help dflags ctxt report ct is_oriented ty1 ty2 }
where
(ty1, ty2) = getEqPredTys (ctPred ct)
@@ 961,61 +1007,67 @@ mkRoleSigs ty1 ty2
roles = tyConRoles tc
}
mkEqErr_help :: DynFlags > ReportErrCtxt > SDoc
+mkEqErr_help :: DynFlags > ReportErrCtxt > Report
> Ct
> Maybe SwapFlag  Nothing <=> not sure
> TcType > TcType > TcM ErrMsg
mkEqErr_help dflags ctxt extra ct oriented ty1 ty2
  Just tv1 < tcGetTyVar_maybe ty1 = mkTyVarEqErr dflags ctxt extra ct oriented tv1 ty2
  Just tv2 < tcGetTyVar_maybe ty2 = mkTyVarEqErr dflags ctxt extra ct swapped tv2 ty1
  otherwise = reportEqErr ctxt extra ct oriented ty1 ty2
+mkEqErr_help dflags ctxt report ct oriented ty1 ty2
+  Just tv1 < tcGetTyVar_maybe ty1 = mkTyVarEqErr dflags ctxt report ct oriented tv1 ty2
+  Just tv2 < tcGetTyVar_maybe ty2 = mkTyVarEqErr dflags ctxt report ct swapped tv2 ty1
+  otherwise = reportEqErr ctxt report ct oriented ty1 ty2
where
swapped = fmap flipSwap oriented
reportEqErr :: ReportErrCtxt > SDoc
+reportEqErr :: ReportErrCtxt > Report
> Ct
> Maybe SwapFlag  Nothing <=> not sure
> TcType > TcType > TcM ErrMsg
reportEqErr ctxt extra1 ct oriented ty1 ty2
 = do { let extra2 = mkEqInfoMsg ct ty1 ty2
 ; mkErrorMsgFromCt ctxt ct (vcat [ misMatchOrCND ctxt ct oriented ty1 ty2
 , extra2, extra1]) }
+reportEqErr ctxt report ct oriented ty1 ty2
+ = mkErrorMsgFromCt ctxt ct (mconcat [misMatch, eqInfo, report])
+ where misMatch = important $ misMatchOrCND ctxt ct oriented ty1 ty2
+ eqInfo = important $ mkEqInfoMsg ct ty1 ty2
mkTyVarEqErr :: DynFlags > ReportErrCtxt > SDoc > Ct
+mkTyVarEqErr :: DynFlags > ReportErrCtxt > Report > Ct
> Maybe SwapFlag > TcTyVar > TcType > TcM ErrMsg
 tv1 and ty2 are already tidied
mkTyVarEqErr dflags ctxt extra ct oriented tv1 ty2
+mkTyVarEqErr dflags ctxt report ct oriented tv1 ty2
 isUserSkolem ctxt tv1  ty2 won't be a metatyvar, or else the thing would
 be oriented the other way round;
 see TcCanonical.canEqTyVarTyVar
 isSigTyVar tv1 && not (isTyVarTy ty2)
 ctEqRel ct == ReprEq && not (isTyVarUnderDatatype tv1 ty2)
 the cases below don't really apply to ReprEq (except occurs check)
 = mkErrorMsgFromCt ctxt ct (vcat [ misMatchOrCND ctxt ct oriented ty1 ty2
 , extraTyVarInfo ctxt tv1 ty2
 , extra ])
+ = mkErrorMsgFromCt ctxt ct $ mconcat
+ [ important $ misMatchOrCND ctxt ct oriented ty1 ty2
+ , important $ extraTyVarInfo ctxt tv1 ty2
+ , report
+ ]
 So tv is a meta tyvar (or started that way before we
 generalised it). So presumably it is an *untouchable*
 meta tyvar or a SigTv, else it'd have been unified
 not (k2 `tcIsSubKind` k1)  Kind error
 = mkErrorMsgFromCt ctxt ct $ (kindErrorMsg (mkTyVarTy tv1) ty2 $$ extra)
+ = mkErrorMsgFromCt ctxt ct $
+ (important $ kindErrorMsg (mkTyVarTy tv1) ty2) `mappend` report
 OC_Occurs < occ_check_expand
, ctEqRel ct == NomEq  isTyVarUnderDatatype tv1 ty2
 See Note [Occurs check error] in TcCanonical
 = do { let occCheckMsg = addArising (ctOrigin ct) $
+ = do { let occCheckMsg = important $ addArising (ctOrigin ct) $
hang (text "Occurs check: cannot construct the infinite type:")
2 (sep [ppr ty1, char '~', ppr ty2])
 extra2 = mkEqInfoMsg ct ty1 ty2
 ; mkErrorMsgFromCt ctxt ct (occCheckMsg $$ extra2 $$ extra) }
+ extra2 = important $ mkEqInfoMsg ct ty1 ty2
+ ; mkErrorMsgFromCt ctxt ct $ mconcat [occCheckMsg, extra2, report] }
 OC_Forall < occ_check_expand
= do { let msg = vcat [ ptext (sLit "Cannot instantiate unification variable")
<+> quotes (ppr tv1)
, hang (ptext (sLit "with a type involving foralls:")) 2 (ppr ty2)
, nest 2 (ptext (sLit "GHC doesn't yet support impredicative polymorphism")) ]
 ; mkErrorMsgFromCt ctxt ct msg }
+  Unlike the other reports, this discards the old 'report_important'
+  instead of augmenting it. This is because the details are not likely
+  to be helpful since this is just an unimplemented feature.
+ ; mkErrorMsgFromCt ctxt ct $ report { report_important = [msg] } }
 If the immediatelyenclosing implication has 'tv' a skolem, and
 we know by now its an InferSkol kind of skolem, then presumably
@@ 1024,46 +1076,50 @@ mkTyVarEqErr dflags ctxt extra ct oriented tv1 ty2
 (implic:_) < cec_encl ctxt
, Implic { ic_skols = skols } < implic
, tv1 `elem` skols
 = mkErrorMsgFromCt ctxt ct (vcat [ misMatchMsg ct oriented ty1 ty2
 , extraTyVarInfo ctxt tv1 ty2
 , extra ])
+ = mkErrorMsgFromCt ctxt ct $ mconcat
+ [ important $ misMatchMsg ct oriented ty1 ty2
+ , important $ extraTyVarInfo ctxt tv1 ty2
+ , report
+ ]
 Check for skolem escape
 (implic:_) < cec_encl ctxt  Get the innermost context
, Implic { ic_env = env, ic_skols = skols, ic_info = skol_info } < implic
, let esc_skols = filter (`elemVarSet` (tyVarsOfType ty2)) skols
, not (null esc_skols)
 = do { let msg = misMatchMsg ct oriented ty1 ty2
+ = do { let msg = important $ misMatchMsg ct oriented ty1 ty2
esc_doc = sep [ ptext (sLit "because type variable") <> plural esc_skols
<+> pprQuotedList esc_skols
, ptext (sLit "would escape") <+>
if isSingleton esc_skols then ptext (sLit "its scope")
else ptext (sLit "their scope") ]
 tv_extra = vcat [ nest 2 $ esc_doc
+ tv_extra = important $
+ vcat [ nest 2 $ esc_doc
, sep [ (if isSingleton esc_skols
then ptext (sLit "This (rigid, skolem) type variable is")
else ptext (sLit "These (rigid, skolem) type variables are"))
<+> ptext (sLit "bound by")
, nest 2 $ ppr skol_info
, nest 2 $ ptext (sLit "at") <+> ppr (tcl_loc env) ] ]
 ; mkErrorMsgFromCt ctxt ct (msg $$ tv_extra $$ extra) }
+ ; mkErrorMsgFromCt ctxt ct (mconcat [msg, tv_extra, report]) }
 Nastiest case: attempt to unify an untouchable variable
 (implic:_) < cec_encl ctxt  Get the innermost context
, Implic { ic_env = env, ic_given = given, ic_info = skol_info } < implic
 = do { let msg = misMatchMsg ct oriented ty1 ty2
 tclvl_extra
 = nest 2 $
+ = do { let msg = important $ misMatchMsg ct oriented ty1 ty2
+ tclvl_extra = important $
+ nest 2 $
sep [ quotes (ppr tv1) <+> ptext (sLit "is untouchable")
, nest 2 $ ptext (sLit "inside the constraints:") <+> pprEvVarTheta given
, nest 2 $ ptext (sLit "bound by") <+> ppr skol_info
, nest 2 $ ptext (sLit "at") <+> ppr (tcl_loc env) ]
 tv_extra = extraTyVarInfo ctxt tv1 ty2
 add_sig = suggestAddSig ctxt ty1 ty2
 ; mkErrorMsgFromCt ctxt ct (vcat [msg, tclvl_extra, tv_extra, add_sig, extra]) }
+ tv_extra = important $ extraTyVarInfo ctxt tv1 ty2
+ add_sig = important $ suggestAddSig ctxt ty1 ty2
+ ; mkErrorMsgFromCt ctxt ct $ mconcat
+ [msg, tclvl_extra, tv_extra, add_sig, report] }
 otherwise
 = reportEqErr ctxt extra ct oriented (mkTyVarTy tv1) ty2
+ = reportEqErr ctxt report ct oriented (mkTyVarTy tv1) ty2
 This *can* happen (Trac #6123, and test T2627b)
 Consider an ambiguous toplevel constraint (a ~ F a)
 Not an occurs check, because F is a type function.
@@ 1497,7 +1553,7 @@ mkDictErr ctxt cts
 have the same sourcelocation origin, to try avoid a cascade
 of error from one location
; (ctxt, err) < mk_dict_err ctxt (head (no_inst_cts ++ overlap_cts))
 ; mkErrorMsgFromCt ctxt ct1 err }
+ ; mkErrorMsgFromCt ctxt ct1 (important err) }
where
no_givens = null (getUserGivens ctxt)
diff git a/compiler/typecheck/TcRnMonad.hs b/compiler/typecheck/TcRnMonad.hs
index 5544254311..770b5bcfa5 100644
 a/compiler/typecheck/TcRnMonad.hs
+++ b/compiler/typecheck/TcRnMonad.hs
@@ 753,6 +753,12 @@ mkLongErrAt loc msg extra
printer < getPrintUnqualified dflags ;
return $ mkLongErrMsg dflags loc printer msg extra }
+mkErrDocAt :: SrcSpan > ErrDoc > TcRn ErrMsg
+mkErrDocAt loc errDoc
+ = do { dflags < getDynFlags ;
+ printer < getPrintUnqualified dflags ;
+ return $ mkErrDoc dflags loc printer errDoc }
+
addLongErrAt :: SrcSpan > MsgDoc > MsgDoc > TcRn ()
addLongErrAt loc msg extra = mkLongErrAt loc msg extra >>= reportError
@@ 769,7 +775,7 @@ reportError err
reportWarning :: ErrMsg > TcRn ()
reportWarning err
= do { let warn = makeIntoWarning err
  'err' was build by mkLongErrMsg or something like that,
+  'err' was built by mkLongErrMsg or something like that,
 so it's of error severity. For a warning we downgrade
 its severity to SevWarning
@@ 1099,7 +1105,7 @@ mkErrInfo env ctxts
= go 0 env ctxts
where
go :: Int > TidyEnv > [ErrCtxt] > TcM SDoc
 go _ _ [] = return Outputable.empty
+ go _ _ [] = return empty
go n env ((is_landmark, ctxt) : ctxts)
 is_landmark  n < mAX_CONTEXTS  Too verbose  opt_PprStyle_Debug
= do { (env', msg) < ctxt env
diff git a/compiler/utils/Outputable.hs b/compiler/utils/Outputable.hs
index fbd6760923..40acbf1d70 100644
 a/compiler/utils/Outputable.hs
+++ b/compiler/utils/Outputable.hs
@@ 19,7 +19,7 @@ module Outputable (
docToSDoc,
interppSP, interpp'SP,
pprQuotedList, pprWithCommas, quotedListWithOr, quotedListWithNor,
 empty, nest,
+ empty, isEmpty, nest,
char,
text, ftext, ptext, ztext,
int, intWithCommas, integer, float, double, rational,
@@ 301,8 +301,8 @@ pprDeeper d = SDoc $ \ctx > case ctx of
runSDoc d ctx{sdocStyle = PprUser q (PartWay (n1))}
_ > runSDoc d ctx
+  Truncate a list that is longer than the current depth.
pprDeeperList :: ([SDoc] > SDoc) > [SDoc] > SDoc
 Truncate a list that list that is longer than the current depth
pprDeeperList f ds
 null ds = f []
 otherwise = SDoc work
@@ 462,6 +462,10 @@ irrelevantNCols :: Int
 Used for OneLineMode and LeftMode when number of cols isn't used
irrelevantNCols = 1
+isEmpty :: DynFlags > SDoc > Bool
+isEmpty dflags sdoc = Pretty.isEmpty $ runSDoc sdoc dummySDocContext
+ where dummySDocContext = initSDocContext dflags PprDebug
+
docToSDoc :: Doc > SDoc
docToSDoc d = SDoc (\_ > d)
diff git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py
index 45e8d3e295..60e5d465ac 100644
 a/testsuite/driver/testlib.py
+++ b/testsuite/driver/testlib.py
@@ 1,3 +1,4 @@
+# coding=utf8
#
# (c) Simon Marlow 2002
#
@@ 1547,7 +1548,8 @@ def check_stderr_ok(name, way):
return compare_outputs(way, 'stderr',
join_normalisers(norm, getTestOpts().extra_errmsg_normaliser), \
 expected_stderr_file, actual_stderr_file)
+ expected_stderr_file, actual_stderr_file,
+ whitespace_normaliser=normalise_whitespace)
def dump_stderr( name ):
print("Stderr:")
@@ 1692,8 +1694,7 @@ def compare_outputs(way, kind, normaliser, expected_file, actual_file,
def normalise_whitespace( str ):
# Merge contiguous whitespace characters into a single space.
 str = re.sub('[ \t\n]+', ' ', str)
 return str.strip()
+ return ' '.join(w for w in str.split())
def normalise_callstacks(str):
def repl(matches):
@@ 1722,6 +1723,11 @@ def normalise_errmsg( str ):
str = re.sub('ghcstage[123]', 'ghc', str)
# Error messages simetimes contain integer implementation package
str = re.sub('integer(gmpsimple)[09.]+', 'integer', str)
+ # Also filter out bullet characters. This is because bullets are used to
+ # separate error sections, and tests shouldn't be sensitive to how the
+ # the division happens.
+ bullet = u'•'.encode('utf8')
+ str = str.replace(bullet, '')
return str
# normalise a .prof file, so that we can reasonably compare it against
diff git a/testsuite/tests/arrows/should_fail/T5380.stderr b/testsuite/tests/arrows/should_fail/T5380.stderr
index bff48f5233..177183225c 100644
 a/testsuite/tests/arrows/should_fail/T5380.stderr
+++ b/testsuite/tests/arrows/should_fail/T5380.stderr
@@ 5,12 +5,12 @@ T5380.hs:7:27:
the type signature for:
testB :: not_bool > (() > ()) > () > not_unit
at T5380.hs:6:10
+ In the expression: b
+ In the expression: proc () > if b then f < () else f < ()
Relevant bindings include
b :: not_bool (bound at T5380.hs:7:7)
testB :: not_bool > (() > ()) > () > not_unit
(bound at T5380.hs:7:1)
 In the expression: b
 In the expression: proc () > if b then f < () else f < ()
T5380.hs:7:34:
Couldn't match type ‘not_unit’ with ‘()’
@@ 20,8 +20,8 @@ T5380.hs:7:34:
at T5380.hs:6:10
Expected type: () > not_unit
Actual type: () > ()
+ In the expression: f
+ In the command: f < ()
Relevant bindings include
testB :: not_bool > (() > ()) > () > not_unit
(bound at T5380.hs:7:1)
 In the expression: f
 In the command: f < ()
diff git a/testsuite/tests/driver/T2507.stderr b/testsuite/tests/driver/T2507.stderr
index 1a6e6f38f1..5cb9f41bc2 100644
 a/testsuite/tests/driver/T2507.stderr
+++ b/testsuite/tests/driver/T2507.stderr
@@ 1,5 +1,5 @@
T2507.hs:5:7: error:
 Couldn't match expected type `Int' with actual type `()'
 In the expression: ()
 In an equation for `foo': foo = ()
+ * Couldn't match expected type `Int' with actual type `()'
+ * In the expression: ()
+ In an equation for `foo': foo = ()
diff git a/testsuite/tests/driver/T6037.stderr b/testsuite/tests/driver/T6037.stderr
index 3059288d10..efc778c023 100644
 a/testsuite/tests/driver/T6037.stderr
+++ b/testsuite/tests/driver/T6037.stderr
@@ 1,5 +1,5 @@
T6037.hs:5:7:
 Couldn't match expected type `Int' with actual type `()'
 In the expression: ()
 In an equation for `f?o': f?o = ()
+ * Couldn't match expected type `Int' with actual type `()'
+ * In the expression: ()
+ In an equation for `f?o': f?o = ()
diff git a/testsuite/tests/driver/T8959a.stderr b/testsuite/tests/driver/T8959a.stderr
index 476b9ee0b1..96bc9dd72e 100644
 a/testsuite/tests/driver/T8959a.stderr
+++ b/testsuite/tests/driver/T8959a.stderr
@@ 1,5 +1,5 @@
T8959a.hs:5:7: error:
 Couldn't match expected type `Int > Int' with actual type `()'
 In the expression: ()
 In an equation for `foo': foo = ()
+ * Couldn't match expected type `Int > Int' with actual type `()'
+ * In the expression: ()
+ In an equation for `foo': foo = ()
diff git a/testsuite/tests/gadt/T3169.stderr b/testsuite/tests/gadt/T3169.stderr
index 3e4a9504b2..12a39ebe51 100644
 a/testsuite/tests/gadt/T3169.stderr
+++ b/testsuite/tests/gadt/T3169.stderr
@@ 7,10 +7,10 @@ T3169.hs:13:22:
at T3169.hs:12:3
Expected type: Map a (Map b elt)
Actual type: Map (a, b) elt
+ In the second argument of ‘lookup’, namely ‘m’
+ In the expression: lookup a m :: Maybe (Map b elt)
Relevant bindings include
m :: Map (a, b) elt (bound at T3169.hs:12:17)
b :: b (bound at T3169.hs:12:13)
lookup :: (a, b) > Map (a, b) elt > Maybe elt
(bound at T3169.hs:12:3)
 In the second argument of ‘lookup’, namely ‘m’
 In the expression: lookup a m :: Maybe (Map b elt)
diff git a/testsuite/tests/gadt/T7558.stderr b/testsuite/tests/gadt/T7558.stderr
index 4929982f70..3d09467402 100644
 a/testsuite/tests/gadt/T7558.stderr
+++ b/testsuite/tests/gadt/T7558.stderr
@@ 7,7 +7,7 @@ T7558.hs:8:4:
a pattern with constructor:
MkT :: forall a b. (a ~ Maybe b) => a > Maybe b > T a b,
in an equation for ‘f’
 Relevant bindings include
 f :: T a a > Bool (bound at T7558.hs:8:1)
In the pattern: MkT x y
In an equation for ‘f’: f (MkT x y) = [x, y] `seq` True
+ Relevant bindings include
+ f :: T a a > Bool (bound at T7558.hs:8:1)
diff git a/testsuite/tests/gadt/gadtescape1.stderr b/testsuite/tests/gadt/gadtescape1.stderr
index a8df3a598a..39d736adb8 100644
 a/testsuite/tests/gadt/gadtescape1.stderr
+++ b/testsuite/tests/gadt/gadtescape1.stderr
@@ 11,7 +11,7 @@ gadtescape1.hs:19:58:
Possible fix: add a type signature for ‘weird1’
Expected type: t
Actual type: ExpGADT t1
 Relevant bindings include
 weird1 :: t (bound at gadtescape1.hs:19:1)
In the expression: a
In a case alternative: Hidden (ExpInt _) a > a
+ Relevant bindings include
+ weird1 :: t (bound at gadtescape1.hs:19:1)
diff git a/testsuite/tests/gadt/gadt13.stderr b/testsuite/tests/gadt/gadt13.stderr
index db3fb99717..ce56fe838e 100644
 a/testsuite/tests/gadt/gadt13.stderr
+++ b/testsuite/tests/gadt/gadt13.stderr
@@ 10,7 +10,7 @@ gadt13.hs:15:13:
‘t’ is a rigid type variable bound by
the inferred type of shw :: Term t1 > t at gadt13.hs:15:1
Possible fix: add a type signature for ‘shw’
 Relevant bindings include
 shw :: Term t1 > t (bound at gadt13.hs:15:1)
In the expression: ("I " ++) . shows t
In an equation for ‘shw’: shw (I t) = ("I " ++) . shows t
+ Relevant bindings include
+ shw :: Term t1 > t (bound at gadt13.hs:15:1)
diff git a/testsuite/tests/gadt/gadt7.stderr b/testsuite/tests/gadt/gadt7.stderr
index 89c05c5637..e49cac1577 100644
 a/testsuite/tests/gadt/gadt7.stderr
+++ b/testsuite/tests/gadt/gadt7.stderr
@@ 11,9 +11,9 @@ gadt7.hs:16:38:
‘t’ is a rigid type variable bound by
the inferred type of i1b :: T t1 > r > t at gadt7.hs:16:1
Possible fix: add a type signature for ‘i1b’
+ In the expression: y1
+ In a case alternative: K > y1
Relevant bindings include
y1 :: r (bound at gadt7.hs:16:16)
y :: r (bound at gadt7.hs:16:7)
i1b :: T t1 > r > t (bound at gadt7.hs:16:1)
 In the expression: y1
 In a case alternative: K > y1
diff git a/testsuite/tests/gadt/rw.stderr b/testsuite/tests/gadt/rw.stderr
index 8b02f5c4d7..dcd3e10397 100644
 a/testsuite/tests/gadt/rw.stderr
+++ b/testsuite/tests/gadt/rw.stderr
@@ 4,13 +4,13 @@ rw.hs:14:47:
‘a’ is a rigid type variable bound by
the type signature for: writeInt :: T a > IORef a > IO ()
at rw.hs:12:12
+ 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)
Relevant bindings include
ref :: IORef a (bound at rw.hs:13:12)
v :: T a (bound at rw.hs:13:10)
writeInt :: T a > IORef a > IO () (bound 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)
rw.hs:19:51:
Couldn't match type ‘a’ with ‘Bool’
@@ 19,9 +19,9 @@ rw.hs:19:51:
at rw.hs:16:12
Expected type: a > Bool
Actual type: Bool > Bool
+ In the second argument of ‘(.)’, namely ‘not’
+ In the second argument of ‘(>>=)’, namely ‘(print . not)’
Relevant bindings include
ref :: IORef a (bound at rw.hs:17:12)
v :: T a (bound at rw.hs:17:10)
readBool :: T a > IORef a > IO () (bound at rw.hs:17:1)
 In the second argument of ‘(.)’, namely ‘not’
 In the second argument of ‘(>>=)’, namely ‘(print . not)’
diff git a/testsuite/tests/ghci/scripts/Defer02.stderr b/testsuite/tests/ghci/scripts/Defer02.stderr
index 4888e6958c..48ddf4b598 100644
 a/testsuite/tests/ghci/scripts/Defer02.stderr
+++ b/testsuite/tests/ghci/scripts/Defer02.stderr
@@ 33,12 +33,12 @@
../../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)
The function ‘e’ is applied to one argument,
but its type ‘Char’ has none
In the expression: e 'q'
In an equation for ‘f’: f = e 'q'
+ Relevant bindings include
+ f :: t (bound at ../../typecheck/should_run/Defer01.hs:31:1)
../../typecheck/should_run/Defer01.hs:34:8: warning:
Couldn't match expected type ‘Char’ with actual type ‘a’
@@ 46,20 +46,20 @@
the type signature for:
h :: a > (Char, Char)
at ../../typecheck/should_run/Defer01.hs:33:6
+ In the expression: x
+ In the expression: (x, 'c')
Relevant bindings include
x :: a (bound at ../../typecheck/should_run/Defer01.hs:34:3)
h :: a > (Char, Char)
(bound at ../../typecheck/should_run/Defer01.hs:34:1)
 In the expression: x
 In the expression: (x, 'c')
../../typecheck/should_run/Defer01.hs:39:17: warning:
Couldn't match expected type ‘Bool’ with actual type ‘T a’
+ In the first argument of ‘not’, namely ‘(K a)’
+ In the expression: (not (K a))
Relevant bindings include
a :: a (bound at ../../typecheck/should_run/Defer01.hs:39:3)
i :: a > () (bound at ../../typecheck/should_run/Defer01.hs:39:1)
 In the first argument of ‘not’, namely ‘(K a)’
 In the expression: (not (K a))
../../typecheck/should_run/Defer01.hs:43:5: warning:
No instance for (MyClass a1) arising from a use of ‘myOp’
@@ 147,12 +147,12 @@
(deferred type error)
*** 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)
The function ‘e’ is applied to one argument,
but its type ‘Char’ has none
In the expression: e 'q'
In an equation for ‘f’: f = e 'q'
+ Relevant bindings include
+ f :: t (bound at ../../typecheck/should_run/Defer01.hs:31:1)
(deferred type error)
*** Exception: ../../typecheck/should_run/Defer01.hs:34:8: error:
Couldn't match expected type ‘Char’ with actual type ‘a’
@@ 160,20 +160,20 @@
the type signature for:
h :: a > (Char, Char)
at ../../typecheck/should_run/Defer01.hs:33:6
+ In the expression: x
+ In the expression: (x, 'c')
Relevant bindings include
x :: a (bound at ../../typecheck/should_run/Defer01.hs:34:3)
h :: a > (Char, Char)
(bound at ../../typecheck/should_run/Defer01.hs:34:1)
 In the expression: x
 In the expression: (x, 'c')
(deferred type error)
*** Exception: ../../typecheck/should_run/Defer01.hs:39:17: error:
Couldn't match expected type ‘Bool’ with actual type ‘T a’
+ In the first argument of ‘not’, namely ‘(K a)’
+ In the expression: (not (K a))
Relevant bindings include
a :: a (bound at ../../typecheck/should_run/Defer01.hs:39:3)
i :: a > () (bound at ../../typecheck/should_run/Defer01.hs:39:1)
 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: error:
No instance for (MyClass a1) arising from a use of ‘myOp’
diff git a/testsuite/tests/ghci/scripts/ghci050.stderr b/testsuite/tests/ghci/scripts/ghci050.stderr
index 4b454bd8bf..31232b6b0b 100644
 a/testsuite/tests/ghci/scripts/ghci050.stderr
+++ b/testsuite/tests/ghci/scripts/ghci050.stderr
@@ 4,10 +4,10 @@
with actual type ‘a’
‘a’ is a rigid type variable bound by
the instance declaration at :5:10
+ In the expression: a
+ In the expression: [a, b]
Relevant bindings include
b :: a (bound at :5:43)
a :: a (bound at :5:41)
asList :: (a, a) > [ListableElem (a, a)]
(bound at :5:33)
 In the expression: a
 In the expression: [a, b]
diff git a/testsuite/tests/indexedtypes/should_compile/PushedInAsGivens.stderr b/testsuite/tests/indexedtypes/should_compile/PushedInAsGivens.stderr
index b76aef8fd4..66b24174ae 100644
 a/testsuite/tests/indexedtypes/should_compile/PushedInAsGivens.stderr
+++ b/testsuite/tests/indexedtypes/should_compile/PushedInAsGivens.stderr
@@ 5,19 +5,16 @@ PushedInAsGivens.hs:10:31:
This (rigid, skolem) type variable is bound by
the type signature for: foo :: (F Int ~ [a1]) => a1 > Int
at PushedInAsGivens.hs:9:2044
+ In the expression: y
+ In the first argument of ‘length’, namely ‘[x, y]’
Relevant bindings include
x :: a1 (bound at PushedInAsGivens.hs:10:17)
foo :: a1 > Int (bound at PushedInAsGivens.hs:10:13)
y :: a (bound at PushedInAsGivens.hs:9:5)
bar :: a > (a, Int) (bound at PushedInAsGivens.hs:9:1)
 In the expression: y
 In the first argument of ‘length’, namely ‘[x, y]’
PushedInAsGivens.hs:11:15:
Couldn't match expected type ‘[a]’ with actual type ‘F Int’
 Relevant bindings include
 y :: a (bound at PushedInAsGivens.hs:9:5)
 bar :: a > (a, Int) (bound at PushedInAsGivens.hs:9:1)
In the expression: foo y
In the expression: (y, foo y)
In the expression:
@@ 25,3 +22,6 @@ PushedInAsGivens.hs:11:15:
foo :: (F Int ~ [a]) => a > Int
foo x = length [...]
in (y, foo y)
+ Relevant bindings include
+ y :: a (bound at PushedInAsGivens.hs:9:5)
+ bar :: a > (a, Int) (bound at PushedInAsGivens.hs:9:1)
diff git a/testsuite/tests/indexedtypes/should_compile/T3208b.stderr b/testsuite/tests/indexedtypes/should_compile/T3208b.stderr
index 282aa2f886..10f3d2a26d 100644
 a/testsuite/tests/indexedtypes/should_compile/T3208b.stderr
+++ b/testsuite/tests/indexedtypes/should_compile/T3208b.stderr
@@ 16,9 +16,9 @@ T3208b.hs:15:15:
fce' :: (OTerm a ~ STerm a, OBJECT a, SUBST a) => a > c
at T3208b.hs:14:956
The type variable ‘o0’ is ambiguous
 Relevant bindings include
 f :: a (bound at T3208b.hs:15:6)
 fce' :: a > c (bound at T3208b.hs:15:1)
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)
+ Relevant bindings include
+ f :: a (bound at T3208b.hs:15:6)
+ fce' :: a > c (bound at T3208b.hs:15:1)
diff git a/testsuite/tests/indexedtypes/should_fail/ExtraTcsUntch.stderr b/testsuite/tests/indexedtypes/should_fail/ExtraTcsUntch.stderr
index b551f39d4c..f8cd07d0f7 100644
 a/testsuite/tests/indexedtypes/should_fail/ExtraTcsUntch.stderr
+++ b/testsuite/tests/indexedtypes/should_fail/ExtraTcsUntch.stderr
@@ 1,18 +1,18 @@
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)
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: 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)
+
+ExtraTcsUntch.hs:25:38: error:
+ Couldn't match expected type ‘F Int’ with actual type ‘[[t]]’
In the first argument of ‘h’, namely ‘[[undefined]]’
In the expression: h [[undefined]]
In the expression: (h [[undefined]], op x [y])
+ Relevant bindings include
+ x :: [t] (bound at ExtraTcsUntch.hs:21:3)
+ f :: [t] > ((), ((), ())) (bound at ExtraTcsUntch.hs:21:1)
diff git a/testsuite/tests/indexedtypes/should_fail/GADTwrong1.stderr b/testsuite/tests/indexedtypes/should_fail/GADTwrong1.stderr
index 2f2d3bff65..694a7832ad 100644
 a/testsuite/tests/indexedtypes/should_fail/GADTwrong1.stderr
+++ b/testsuite/tests/indexedtypes/should_fail/GADTwrong1.stderr
@@ 7,8 +7,8 @@ GADTwrong1.hs:12:21:
at GADTwrong1.hs:12:14
‘b’ is a rigid type variable bound by
the type signature for: coerce :: a > b at GADTwrong1.hs:10:20
+ In the expression: y
+ In a case alternative: T y > y
Relevant bindings include
y :: c (bound at GADTwrong1.hs:12:16)
coerce :: a > b (bound at GADTwrong1.hs:11:1)
 In the expression: y
 In a case alternative: T y > y
diff git a/testsuite/tests/indexedtypes/should_fail/Overlap10.stderr b/testsuite/tests/indexedtypes/should_fail/Overlap10.stderr
index 5a53870eff..b6ad5772fe 100644
 a/testsuite/tests/indexedtypes/should_fail/Overlap10.stderr
+++ b/testsuite/tests/indexedtypes/should_fail/Overlap10.stderr
@@ 1,8 +1,8 @@
Overlap10.hs:10:7:
Couldn't match expected type ‘F a Bool’ with actual type ‘Bool’
+ In the expression: False
+ In an equation for ‘g’: g x = False
Relevant bindings include
x :: a (bound at Overlap10.hs:10:3)
g :: a > F a Bool (bound at Overlap10.hs:10:1)
 In the expression: False
 In an equation for ‘g’: g x = False
diff git a/testsuite/tests/indexedtypes/should_fail/Overlap11.stderr b/testsuite/tests/indexedtypes/should_fail/Overlap11.stderr
index 6e3286eb27..36af24fbd1 100644
 a/testsuite/tests/indexedtypes/should_fail/Overlap11.stderr
+++ b/testsuite/tests/indexedtypes/should_fail/Overlap11.stderr
@@ 1,8 +1,8 @@
Overlap11.hs:10:8:
Couldn't match expected type ‘F a Int’ with actual type ‘Int’
+ In the expression: (5 :: Int)
+ In an equation for ‘g’: g x = (5 :: Int)
Relevant bindings include
x :: a (bound at Overlap11.hs:10:3)
g :: a > F a Int (bound at Overlap11.hs:10:1)
 In the expression: (5 :: Int)
 In an equation for ‘g’: g x = (5 :: Int)
diff git a/testsuite/tests/indexedtypes/should_fail/Overlap15.stderr b/testsuite/tests/indexedtypes/should_fail/Overlap15.stderr
index a24504caa4..673a90798d 100644
 a/testsuite/tests/indexedtypes/should_fail/Overlap15.stderr
+++ b/testsuite/tests/indexedtypes/should_fail/Overlap15.stderr
@@ 1,7 +1,7 @@
Overlap15.hs:16:9:
Couldn't match expected type ‘F b [b] Bool’ with actual type ‘Bool’
 Relevant bindings include
 foo :: Proxy b > F b [b] Bool (bound at Overlap15.hs:16:1)
In the expression: False
In an equation for ‘foo’: foo _ = False
+ Relevant bindings include
+ foo :: Proxy b > F b [b] Bool (bound at Overlap15.hs:16:1)
diff git a/testsuite/tests/indexedtypes/should_fail/Overlap6.stderr b/testsuite/tests/indexedtypes/should_fail/Overlap6.stderr
index 1b406e48f1..b2dc99251f 100644
 a/testsuite/tests/indexedtypes/should_fail/Overlap6.stderr
+++ b/testsuite/tests/indexedtypes/should_fail/Overlap6.stderr
@@ 6,8 +6,8 @@ Overlap6.hs:15:7:
at Overlap6.hs:14:6
Expected type: Proxy (And x 'True)
Actual type: Proxy x
+ In the expression: x
+ In an equation for ‘g’: g x = x
Relevant bindings include
x :: Proxy x (bound at Overlap6.hs:15:3)
g :: Proxy x > Proxy (And x 'True) (bound at Overlap6.hs:15:1)
 In the expression: x
 In an equation for ‘g’: g x = x
diff git a/testsuite/tests/indexedtypes/should_fail/Overlap9.stderr b/testsuite/tests/indexedtypes/should_fail/Overlap9.stderr
index 9dd542f4c8..11b73c52f9 100644
 a/testsuite/tests/indexedtypes/should_fail/Overlap9.stderr
+++ b/testsuite/tests/indexedtypes/should_fail/Overlap9.stderr
@@ 1,8 +1,8 @@
Overlap9.hs:10:7:
Couldn't match expected type ‘F a’ with actual type ‘Int’
+ In the expression: length (show x)
+ In an equation for ‘g’: g x = length (show x)
Relevant bindings include
x :: a (bound at Overlap9.hs:10:3)
g :: a > F a (bound at Overlap9.hs:10:1)
 In the expression: length (show x)
 In an equation for ‘g’: g x = length (show x)
diff git a/testsuite/tests/indexedtypes/should_fail/SimpleFail16.stderr b/testsuite/tests/indexedtypes/should_fail/SimpleFail16.stderr
index 0d663a6497..74db7b1dcf 100644
 a/testsuite/tests/indexedtypes/should_fail/SimpleFail16.stderr
+++ b/testsuite/tests/indexedtypes/should_fail/SimpleFail16.stderr
@@ 2,8 +2,8 @@
SimpleFail16.hs:10:12:
Couldn't match expected type ‘p0 a0’ with actual type ‘F ()’
The type variables ‘p0’, ‘a0’ are ambiguous
 Relevant bindings include
 bar :: p0 a0 (bound at SimpleFail16.hs:10:1)
In the first argument of ‘foo’, namely ‘(undefined :: F ())’
In the expression: foo (undefined :: F ())
In an equation for ‘bar’: bar = foo (undefined :: F ())
+ Relevant bindings include
+ bar :: p0 a0 (bound at SimpleFail16.hs:10:1)
diff git a/testsuite/tests/indexedtypes/should_fail/SimpleFail5a.stderr b/testsuite/tests/indexedtypes/should_fail/SimpleFail5a.stderr
index 09df4c2510..8288d30619 100644
 a/testsuite/tests/indexedtypes/should_fail/SimpleFail5a.stderr
+++ b/testsuite/tests/indexedtypes/should_fail/SimpleFail5a.stderr
@@ 6,7 +6,7 @@ SimpleFail5a.hs:31:11:
at SimpleFail5a.hs:30:14
Expected type: S3 a
Actual type: S3 Int
 Relevant bindings include
 bar3wrong :: S3 a > a (bound at SimpleFail5a.hs:31:1)
In the pattern: D3Int
In an equation for ‘bar3wrong’: bar3wrong D3Int = 1
+ Relevant bindings include
+ bar3wrong :: S3 a > a (bound at SimpleFail5a.hs:31:1)
diff git a/testsuite/tests/indexedtypes/should_fail/T2544.stderr b/testsuite/tests/indexedtypes/should_fail/T2544.stderr
index 0245cb7b6a..e60cdab2a5 100644
 a/testsuite/tests/indexedtypes/should_fail/T2544.stderr
+++ b/testsuite/tests/indexedtypes/should_fail/T2544.stderr
@@ 5,10 +5,10 @@ T2544.hs:17:18: error:
The type variable ‘i0’ is ambiguous
Expected type: IxMap l [Int]
Actual type: IxMap i0 [Int]
 Relevant bindings include
 empty :: IxMap (l :: r) [Int] (bound at T2544.hs:17:4)
In the first argument of ‘BiApp’, namely ‘empty’
In the expression: BiApp empty empty
+ Relevant bindings include
+ empty :: IxMap (l :: r) [Int] (bound at T2544.hs:17:4)
T2544.hs:17:24: error:
Couldn't match type ‘IxMap i1’ with ‘IxMap r’
@@ 16,7 +16,7 @@ T2544.hs:17:24: error:
The type variable ‘i1’ is ambiguous
Expected type: IxMap r [Int]
Actual type: IxMap i1 [Int]
 Relevant bindings include
 empty :: IxMap (l :: r) [Int] (bound at T2544.hs:17:4)
In the second argument of ‘BiApp’, namely ‘empty’
In the expression: BiApp empty empty
+ Relevant bindings include
+ empty :: IxMap (l :: r) [Int] (bound at T2544.hs:17:4)
diff git a/testsuite/tests/indexedtypes/should_fail/T2664.stderr b/testsuite/tests/indexedtypes/should_fail/T2664.stderr
index fb28764c80..d2dd0dff60 100644
 a/testsuite/tests/indexedtypes/should_fail/T2664.stderr
+++ b/testsuite/tests/indexedtypes/should_fail/T2664.stderr
@@ 12,10 +12,10 @@ T2664.hs:31:52:
the instance declaration at T2664.hs:22:10
Expected type: Dual (Dual a)
Actual type: b
 Relevant bindings include
 v :: MVar (Either (PChan a) (PChan b)) (bound at T2664.hs:24:9)
 newPChan :: IO (PChan (a :*: b), PChan c) (bound at T2664.hs:23:5)
In the third argument of ‘pchoose’, namely ‘newPChan’
In the first argument of ‘E’, namely ‘(pchoose Right v newPChan)’
In the expression:
E (pchoose Right v newPChan) (pchoose Left v newPChan)
+ Relevant bindings include
+ v :: MVar (Either (PChan a) (PChan b)) (bound at T2664.hs:24:9)
+ newPChan :: IO (PChan (a :*: b), PChan c) (bound at T2664.hs:23:5)
diff git a/testsuite/tests/indexedtypes/should_fail/T2693.stderr b/testsuite/tests/indexedtypes/should_fail/T2693.stderr
index 0c6ea152a7..182bbde8ed 100644
 a/testsuite/tests/indexedtypes/should_fail/T2693.stderr
+++ b/testsuite/tests/indexedtypes/should_fail/T2693.stderr
@@ 18,16 +18,16 @@ T2693.hs:11:7:
T2693.hs:19:15:
Couldn't match expected type ‘(a5, b0)’ with actual type ‘TFn a2’
The type variables ‘b0’, ‘a2’, ‘a5’ are ambiguous
 Relevant bindings include n :: a5 (bound at T2693.hs:19:7)
In the first argument of ‘fst’, namely ‘x’
In the first argument of ‘(+)’, namely ‘fst x’
+ Relevant bindings include n :: a5 (bound at T2693.hs:19:7)
T2693.hs:19:23:
Couldn't match expected type ‘(a3, a5)’ with actual type ‘TFn a4’
The type variables ‘a3’, ‘a4’, ‘a5’ are ambiguous
 Relevant bindings include n :: a5 (bound at T2693.hs:19:7)
In the first argument of ‘snd’, namely ‘x’
In the second argument of ‘(+)’, namely ‘snd x’
+ Relevant bindings include n :: a5 (bound at T2693.hs:19:7)
T2693.hs:29:20:
Couldn't match type ‘TFn a0’ with ‘PVR a1’
diff git a/testsuite/tests/indexedtypes/should_fail/T3330a.stderr b/testsuite/tests/indexedtypes/should_fail/T3330a.stderr
index 9adb5ad462..a114158938 100644
 a/testsuite/tests/indexedtypes/should_fail/T3330a.stderr
+++ b/testsuite/tests/indexedtypes/should_fail/T3330a.stderr
@@ 7,12 +7,12 @@ T3330a.hs:19:34:
Expected type: (s0 ix0 > ix1)
> r ix1 > Writer [AnyF s] (r'0 ix1)
Actual type: s ix
+ In the first argument of ‘hmapM’, namely ‘p’
+ In the first argument of ‘execWriter’, namely ‘(hmapM p collect x)’
Relevant bindings include
x :: PF s r ix (bound at T3330a.hs:19:12)
p :: s ix (bound at T3330a.hs:19:10)
children :: s ix > PF s r ix > [AnyF s] (bound at T3330a.hs:19:1)
 In the first argument of ‘hmapM’, namely ‘p’
 In the first argument of ‘execWriter’, namely ‘(hmapM p collect x)’
T3330a.hs:19:34:
Couldn't match type ‘ix’ with ‘r ix1 > Writer [AnyF s] (r'0 ix1)’
@@ 22,12 +22,12 @@ T3330a.hs:19:34:
Expected type: (s0 ix0 > ix1)
> r ix1 > Writer [AnyF s] (r'0 ix1)
Actual type: s ix
+ In the first argument of ‘hmapM’, namely ‘p’
+ In the first argument of ‘execWriter’, namely ‘(hmapM p collect x)’
Relevant bindings include
x :: PF s r ix (bound at T3330a.hs:19:12)
p :: s ix (bound at T3330a.hs:19:10)
children :: s ix > PF s r ix > [AnyF s] (bound at T3330a.hs:19:1)
 In the first argument of ‘hmapM’, namely ‘p’
 In the first argument of ‘execWriter’, namely ‘(hmapM p collect x)’
T3330a.hs:19:44:
Couldn't match type ‘ix’ with ‘r0 ix0 > Writer [AnyF s0] (r0 ix0)’
@@ 36,9 +36,9 @@ T3330a.hs:19:44:
at T3330a.hs:18:13
Expected type: PF s r (r0 ix0 > Writer [AnyF s0] (r0 ix0))
Actual type: PF s r ix
+ In the third argument of ‘hmapM’, namely ‘x’
+ In the first argument of ‘execWriter’, namely ‘(hmapM p collect x)’
Relevant bindings include
x :: PF s r ix (bound at T3330a.hs:19:12)
p :: s ix (bound at T3330a.hs:19:10)
children :: s ix > PF s r ix > [AnyF s] (bound at T3330a.hs:19:1)
 In the third argument of ‘hmapM’, namely ‘x’
 In the first argument of ‘execWriter’, namely ‘(hmapM p collect x)’
diff git a/testsuite/tests/indexedtypes/should_fail/T3330c.stderr b/testsuite/tests/indexedtypes/should_fail/T3330c.stderr
index 61881d340f..d0a8320384 100644
 a/testsuite/tests/indexedtypes/should_fail/T3330c.stderr
+++ b/testsuite/tests/indexedtypes/should_fail/T3330c.stderr
@@ 6,9 +6,9 @@ T3330c.hs:23:43: error:
R :: (* > *) > *
Expected type: Der ((>) x) (Der f1 x)
Actual type: R f1
+ In the first argument of ‘plug’, namely ‘rf’
+ In the first argument of ‘Inl’, namely ‘(plug rf df x)’
Relevant bindings include
x :: x (bound at T3330c.hs:23:29)
df :: Der f1 x (bound at T3330c.hs:23:25)
plug' :: R f > Der f x > x > f x (bound at T3330c.hs:23:1)
 In the first argument of ‘plug’, namely ‘rf’
 In the first argument of ‘Inl’, namely ‘(plug rf df x)’
diff git a/testsuite/tests/indexedtypes/should_fail/T3440.stderr b/testsuite/tests/indexedtypes/should_fail/T3440.stderr
index 5deb1e8de4..cfc5570c66 100644
 a/testsuite/tests/indexedtypes/should_fail/T3440.stderr
+++ b/testsuite/tests/indexedtypes/should_fail/T3440.stderr
@@ 14,9 +14,9 @@ T3440.hs:11:22:
‘a’ is a rigid type variable bound by
the type signature for: unwrap :: GADT (Fam a) > (a, Fam a)
at T3440.hs:10:11
+ In the expression: x
+ In the expression: (x, y)
Relevant bindings include
y :: Fam a1 (bound at T3440.hs:11:16)
x :: a1 (bound at T3440.hs:11:14)
unwrap :: GADT (Fam a) > (a, Fam a) (bound at T3440.hs:11:1)
 In the expression: x
 In the expression: (x, y)
diff git a/testsuite/tests/indexedtypes/should_fail/T4093a.stderr b/testsuite/tests/indexedtypes/should_fail/T4093a.stderr
index b1810d3096..efeb34a94a 100644
 a/testsuite/tests/indexedtypes/should_fail/T4093a.stderr
+++ b/testsuite/tests/indexedtypes/should_fail/T4093a.stderr
@@ 9,6 +9,6 @@ T4093a.hs:8:8: error:
at T4093a.hs:7:9
Expected type: 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 ()
+ Relevant bindings include hang :: Foo e (bound at T4093a.hs:8:1)
diff git a/testsuite/tests/indexedtypes/should_fail/T4093b.stderr b/testsuite/tests/indexedtypes/should_fail/T4093b.stderr
index 802757d514..53d7844f4f 100644
 a/testsuite/tests/indexedtypes/should_fail/T4093b.stderr
+++ b/testsuite/tests/indexedtypes/should_fail/T4093b.stderr
@@ 16,15 +16,6 @@ T4093b.hs:31:13:
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))
 Relevant bindings include
 f :: n C O
 > EitherCO e (A C O n) (A O O n) > EitherCO e (A C O n) (A O O n)
 (bound at T4093b.hs:31:5)
 l :: n O C
 > EitherCO e (A C O n) (A O O n) > EitherCO e (A C C n) (A O C n)
 (bound at T4093b.hs:34:5)
 b :: Block n e x (bound at T4093b.hs:25:17)
 blockToNodeList :: Block n e x > A e x n (bound at T4093b.hs:25:1)
In the expression: (JustC n, NothingC)
In an equation for ‘f’: f n _ = (JustC n, NothingC)
In an equation for ‘blockToNodeList’:
@@ 39,3 +30,12 @@ T4093b.hs:31:13:
> EitherCO e (A C O n) (A O O n) > EitherCO e (A C O n) (A O O n)
f n _ = (JustC n, NothingC)
....
+ Relevant bindings include
+ f :: n C O
+ > EitherCO e (A C O n) (A O O n) > EitherCO e (A C O n) (A O O n)
+ (bound at T4093b.hs:31:5)
+ l :: n O C
+ > EitherCO e (A C O n) (A O O n) > EitherCO e (A C C n) (A O C n)
+ (bound at T4093b.hs:34:5)
+ b :: Block n e x (bound at T4093b.hs:25:17)
+ blockToNodeList :: Block n e x > A e x n (bound at T4093b.hs:25:1)
diff git a/testsuite/tests/indexedtypes/should_fail/T4099.stderr b/testsuite/tests/indexedtypes/should_fail/T4099.stderr
index a16223254d..c5b4245c17 100644
 a/testsuite/tests/indexedtypes/should_fail/T4099.stderr
+++ b/testsuite/tests/indexedtypes/should_fail/T4099.stderr
@@ 3,19 +3,19 @@ T4099.hs:11:30:
Couldn't match expected type ‘T a0’ with actual type ‘T b’
NB: ‘T’ is a type function, and may not be injective
The type variable ‘a0’ is ambiguous
+ In the second argument of ‘foo’, namely ‘x’
+ In the expression: foo (error "urk") x
Relevant bindings include
x :: T b (bound at T4099.hs:11:8)
a :: b (bound at T4099.hs:11:6)
bar1 :: b > T b > Int (bound at T4099.hs:11:1)
 In the second argument of ‘foo’, namely ‘x’
 In the expression: foo (error "urk") x
T4099.hs:14:30:
Couldn't match expected type ‘T a1’ with actual type ‘Maybe b’
The type variable ‘a1’ is ambiguous
+ In the second argument of ‘foo’, namely ‘x’
+ In the expression: foo (error "urk") x
Relevant bindings include
x :: Maybe b (bound at T4099.hs:14:8)
a :: b (bound at T4099.hs:14:6)
bar2 :: b > Maybe b > Int (bound at T4099.hs:14:1)
 In the second argument of ‘foo’, namely ‘x’
 In the expression: foo (error "urk") x
diff git a/testsuite/tests/indexedtypes/should_fail/T4174.stderr b/testsuite/tests/indexedtypes/should_fail/T4174.stderr
index cc4a7ae5c5..872004519e 100644
 a/testsuite/tests/indexedtypes/should_fail/T4174.stderr
+++ b/testsuite/tests/indexedtypes/should_fail/T4174.stderr
@@ 7,11 +7,11 @@ T4174.hs:42:12:
at T4174.hs:41:13
Expected type: m (Field (Way (GHC6'8 minor) n t p) a b)
Actual type: m (Field (WayOf m) SmStep RtsSpinLock)
+ In the expression: sync_large_objects
+ In an equation for ‘testcase’: testcase = sync_large_objects
Relevant bindings include
testcase :: m (Field (Way (GHC6'8 minor) n t p) a b)
(bound at T4174.hs:42:1)
 In the expression: sync_large_objects
 In an equation for ‘testcase’: testcase = sync_large_objects
T4174.hs:42:12:
Couldn't match type ‘b’ with ‘RtsSpinLock’
@@ 21,8 +21,8 @@ T4174.hs:42:12:
at T4174.hs:41:13
Expected type: m (Field (Way (GHC6'8 minor) n t p) a b)
Actual type: m (Field (WayOf m) SmStep RtsSpinLock)
+ In the expression: sync_large_objects
+ In an equation for ‘testcase’: testcase = sync_large_objects
Relevant bindings include
testcase :: m (Field (Way (GHC6'8 minor) n t p) a b)
(bound at T4174.hs:42:1)
 In the expression: sync_large_objects
 In an equation for ‘testcase’: testcase = sync_large_objects
diff git a/testsuite/tests/indexedtypes/should_fail/T4179.stderr b/testsuite/tests/indexedtypes/should_fail/T4179.stderr
index 7069de90d8..f7f142a4bd 100644
 a/testsuite/tests/indexedtypes/should_fail/T4179.stderr
+++ b/testsuite/tests/indexedtypes/should_fail/T4179.stderr
@@ 8,8 +8,8 @@ T4179.hs:26:16:
Actual type: x (A2 (FCon x) > A3 (FCon x))
> A2 (x (A2 (FCon x) > A3 (FCon x)))
> A3 (x (A2 (FCon x) > A3 (FCon x)))
+ In the first argument of ‘foldDoC’, namely ‘op’
+ In the expression: foldDoC op
Relevant bindings include
fCon :: Con x > A2 (FCon x) > A3 (FCon x)
(bound at T4179.hs:26:1)
 In the first argument of ‘foldDoC’, namely ‘op’
 In the expression: foldDoC op
diff git a/testsuite/tests/indexedtypes/should_fail/T4272.stderr b/testsuite/tests/indexedtypes/should_fail/T4272.stderr
index 74e36f7651..84d50dc69f 100644
 a/testsuite/tests/indexedtypes/should_fail/T4272.stderr
+++ b/testsuite/tests/indexedtypes/should_fail/T4272.stderr
@@ 6,11 +6,11 @@ T4272.hs:15:26:
at T4272.hs:14:16
Expected type: TermFamily a (TermFamily a a)
Actual type: TermFamily a a
 Relevant bindings include
 t :: TermFamily a a (bound at T4272.hs:15:6)
 laws :: TermFamily a a > b (bound at T4272.hs:15:1)
In the first argument of ‘terms’, namely
‘(undefined :: TermFamily a a)’
In the second argument of ‘prune’, namely
‘(terms (undefined :: TermFamily a a))’
In the expression: prune t (terms (undefined :: TermFamily a a))
+ Relevant bindings include
+ t :: TermFamily a a (bound at T4272.hs:15:6)
+ laws :: TermFamily a a > b (bound at T4272.hs:15:1)
diff git a/testsuite/tests/indexedtypes/should_fail/T5439.stderr b/testsuite/tests/indexedtypes/should_fail/T5439.stderr
index a68e8c2226..c5b9c9cfc9 100644
 a/testsuite/tests/indexedtypes/should_fail/T5439.stderr
+++ b/testsuite/tests/indexedtypes/should_fail/T5439.stderr
@@ 4,6 +4,8 @@ T5439.hs:82:28:
with ‘Attempt (HHead (HDrop n0 l0)) > Attempt (HElemOf l0)’
Expected type: f (Attempt (HNth n0 l0) > Attempt (HElemOf l0))
Actual type: f (Attempt (WaitOpResult (WaitOps rs)))
+ In the first argument of ‘complete’, namely ‘ev’
+ In the expression: complete ev
Relevant bindings include
register :: Bool > Peano n > WaitOps (HDrop n rs) > IO Bool
(bound at T5439.hs:64:9)
@@ 13,8 +15,6 @@ T5439.hs:82:28:
registerWaitOp :: WaitOps rs
> f (Attempt (WaitOpResult (WaitOps rs))) > IO Bool
(bound at T5439.hs:61:3)
 In the first argument of ‘complete’, namely ‘ev’
 In the expression: complete ev
T5439.hs:82:39:
Couldn't match expected type ‘Peano n0’
diff git a/testsuite/tests/indexedtypes/should_fail/T6123.stderr b/testsuite/tests/indexedtypes/should_fail/T6123.stderr
index 8431c4d9fb..d97968b3aa 100644
 a/testsuite/tests/indexedtypes/should_fail/T6123.stderr
+++ b/testsuite/tests/indexedtypes/should_fail/T6123.stderr
@@ 2,6 +2,6 @@
T6123.hs:10:14: error:
Occurs check: cannot construct the infinite type: t0 ~ Id t0
The type variable ‘t0’ is ambiguous
 Relevant bindings include cundefined :: t0 (bound at T6123.hs:10:1)
In the expression: cid undefined
In an equation for ‘cundefined’: cundefined = cid undefined
+ Relevant bindings include cundefined :: t0 (bound at T6123.hs:10:1)
diff git a/testsuite/tests/indexedtypes/should_fail/T7194.stderr b/testsuite/tests/indexedtypes/should_fail/T7194.stderr
index 12df18bc81..b28868abdb 100644
 a/testsuite/tests/indexedtypes/should_fail/T7194.stderr
+++ b/testsuite/tests/indexedtypes/should_fail/T7194.stderr
@@ 5,9 +5,9 @@ T7194.hs:18:35:
This (rigid, skolem) type variable is bound by
the type signature for: g :: C (F a) => a > Int
at T7194.hs:17:2341
+ In the expression: foo y
+ In the first argument of ‘length’, namely ‘[x, foo y]’
Relevant bindings include
y :: a (bound at T7194.hs:18:20)
g :: a > Int (bound at T7194.hs:18:18)
x :: b0 (bound at T7194.hs:17:9)
 In the expression: foo y
 In the first argument of ‘length’, namely ‘[x, foo y]’
diff git a/testsuite/tests/indexedtypes/should_fail/T7354.stderr b/testsuite/tests/indexedtypes/should_fail/T7354.stderr
index 7c505f1876..f115604b10 100644
 a/testsuite/tests/indexedtypes/should_fail/T7354.stderr
+++ b/testsuite/tests/indexedtypes/should_fail/T7354.stderr
@@ 4,7 +4,7 @@ T7354.hs:28:11:
a ~ Base t (Prim [a] a)
Expected type: Prim [a] a > Base t (Prim [a] a)
Actual type: Prim [a] a > a
 Relevant bindings include
 foo :: Prim [a] a > t (bound at T7354.hs:28:1)
In the first argument of ‘ana’, namely ‘alg’
In the expression: ana alg
+ Relevant bindings include
+ foo :: Prim [a] a > t (bound at T7354.hs:28:1)
diff git a/testsuite/tests/indexedtypes/should_fail/T7354a.stderr b/testsuite/tests/indexedtypes/should_fail/T7354a.stderr
index ac7bc80cc8..ed38da6ed2 100644
 a/testsuite/tests/indexedtypes/should_fail/T7354a.stderr
+++ b/testsuite/tests/indexedtypes/should_fail/T7354a.stderr
@@ 1,6 +1,6 @@
T7354a.hs:5:13:
Couldn't match expected type ‘Base t t’ with actual type ‘()’
 Relevant bindings include foo :: t (bound at T7354a.hs:5:1)
In the first argument of ‘embed’, namely ‘()’
In the expression: embed ()
+ Relevant bindings include foo :: t (bound at T7354a.hs:5:1)
diff git a/testsuite/tests/indexedtypes/should_fail/T7729.stderr b/testsuite/tests/indexedtypes/should_fail/T7729.stderr
index 7be5d5764c..6686f39ca0 100644
 a/testsuite/tests/indexedtypes/should_fail/T7729.stderr
+++ b/testsuite/tests/indexedtypes/should_fail/T7729.stderr
@@ 4,8 +4,8 @@ T7729.hs:36:14: error:
The type variable ‘t0’ is ambiguous
Expected type: t0 (BasePrimMonad m) a > Rand m a
Actual type: BasePrimMonad (Rand m) a > Rand m a
+ In the first argument of ‘(.)’, namely ‘liftPrim’
+ In the expression: liftPrim . lift
Relevant bindings include
liftPrim :: BasePrimMonad (Rand m) a > Rand m a
(bound at T7729.hs:36:3)
 In the first argument of ‘(.)’, namely ‘liftPrim’
 In the expression: liftPrim . lift
diff git a/testsuite/tests/indexedtypes/should_fail/T7729a.stderr b/testsuite/tests/indexedtypes/should_fail/T7729a.stderr
index 8bd5a24d68..ca5f29f2c7 100644
 a/testsuite/tests/indexedtypes/should_fail/T7729a.stderr
+++ b/testsuite/tests/indexedtypes/should_fail/T7729a.stderr
@@ 4,9 +4,9 @@ T7729a.hs:36:26:
The type variable ‘t0’ is ambiguous
Expected type: BasePrimMonad (Rand m) a
Actual type: t0 (BasePrimMonad m) a
+ In the first argument of ‘liftPrim’, namely ‘(lift x)’
+ In the expression: liftPrim (lift x)
Relevant bindings include
x :: BasePrimMonad (Rand m) a (bound at T7729a.hs:36:12)
liftPrim :: BasePrimMonad (Rand m) a > Rand m a
(bound at T7729a.hs:36:3)
 In the first argument of ‘liftPrim’, namely ‘(lift x)’
 In the expression: liftPrim (lift x)
diff git a/testsuite/tests/indexedtypes/should_fail/T7786.stderr b/testsuite/tests/indexedtypes/should_fail/T7786.stderr
index 686ccd77bc..62627d6377 100644
 a/testsuite/tests/indexedtypes/should_fail/T7786.stderr
+++ b/testsuite/tests/indexedtypes/should_fail/T7786.stderr
@@ 16,15 +16,6 @@ T7786.hs:86:49: error:
with ‘Intersect (BuriedUnder sub k 'Empty) inv’
Expected type: Sing xxx
Actual type: Sing (Intersect (BuriedUnder sub k 'Empty) inv)
 Relevant bindings include
 sub :: Database sub (bound at T7786.hs:86:13)
 k :: Sing k (bound at T7786.hs:86:11)
 db :: Database inv (bound at T7786.hs:86:8)
 addSub :: Database inv
 > Sing k
 > Database sub
 > Maybe (Database (BuriedUnder sub k inv))
 (bound at T7786.hs:86:1)
In the first argument of ‘return’, namely
‘(buryUnder (dbKeys sub) k Nil `intersectPaths` dbKeys db)’
In a stmt of a 'do' block:
@@ 34,3 +25,12 @@ T7786.hs:86:49: error:
do { Nil :: Sing xxx < return
(buryUnder (dbKeys sub) k Nil `intersectPaths` dbKeys db);
return $ Sub db k sub }
+ Relevant bindings include
+ sub :: Database sub (bound at T7786.hs:86:13)
+ k :: Sing k (bound at T7786.hs:86:11)
+ db :: Database inv (bound at T7786.hs:86:8)
+ addSub :: Database inv
+ > Sing k
+ > Database sub
+ > Maybe (Database (BuriedUnder sub k inv))
+ (bound at T7786.hs:86:1)
diff git a/testsuite/tests/indexedtypes/should_fail/T8129.stdout b/testsuite/tests/indexedtypes/should_fail/T8129.stdout
index 975ee8a721..bffa3dae0b 100644
 a/testsuite/tests/indexedtypes/should_fail/T8129.stdout
+++ b/testsuite/tests/indexedtypes/should_fail/T8129.stdout
@@ 1 +1 @@
 Could not deduce (C x0 (F x0))
+ • Could not deduce (C x0 (F x0))
diff git a/testsuite/tests/indexedtypes/should_fail/T8227.stderr b/testsuite/tests/indexedtypes/should_fail/T8227.stderr
index f09d468a75..d52f4b447d 100644
 a/testsuite/tests/indexedtypes/should_fail/T8227.stderr
+++ b/testsuite/tests/indexedtypes/should_fail/T8227.stderr
@@ 3,23 +3,23 @@ T8227.hs:16:27:
Couldn't match expected type ‘Scalar (V a)’
with actual type ‘Scalar (V (Scalar (V a)))
> Scalar (V (Scalar (V a)))’
+ In the expression: arcLengthToParam eps eps
+ In an equation for ‘absoluteToParam’:
+ absoluteToParam eps seg = arcLengthToParam eps eps
Relevant bindings include
seg :: a (bound at T8227.hs:16:21)
eps :: Scalar (V a) (bound at T8227.hs:16:17)
absoluteToParam :: Scalar (V a) > a > Scalar (V a)
(bound at T8227.hs:16:1)
 In the expression: arcLengthToParam eps eps
 In an equation for ‘absoluteToParam’:
 absoluteToParam eps seg = arcLengthToParam eps eps
T8227.hs:16:44:
Couldn't match expected type ‘Scalar (V (Scalar (V a)))’
with actual type ‘Scalar (V a)’
NB: ‘Scalar’ is a type function, and may not be injective
+ In the first argument of ‘arcLengthToParam’, namely ‘eps’
+ In the expression: arcLengthToParam eps eps
Relevant bindings include
seg :: a (bound at T8227.hs:16:21)
eps :: Scalar (V a) (bound at T8227.hs:16:17)
absoluteToParam :: Scalar (V a) > a > Scalar (V a)
(bound at T8227.hs:16:1)
 In the first argument of ‘arcLengthToParam’, namely ‘eps’
 In the expression: arcLengthToParam eps eps
diff git a/testsuite/tests/indexedtypes/should_fail/T8518.stderr b/testsuite/tests/indexedtypes/should_fail/T8518.stderr
index 313bdcfeaa..8a267d7bd0 100644
 a/testsuite/tests/indexedtypes/should_fail/T8518.stderr
+++ b/testsuite/tests/indexedtypes/should_fail/T8518.stderr
@@ 1,11 +1,6 @@
T8518.hs:14:18:
Couldn't match expected type ‘Maybe (F c)’ with actual type ‘F c’
 Relevant bindings include
 b :: B c (bound at T8518.hs:14:14)
 z :: Z c (bound at T8518.hs:14:12)
 c :: c (bound at T8518.hs:14:10)
 callCont :: c > Z c > B c > Maybe (F c) (bound at T8518.hs:14:1)
In the expression: rpt (4 :: Int) c z b
In an equation for ‘callCont’:
callCont c z b
@@ 13,16 +8,21 @@ T8518.hs:14:18:
where
rpt 0 c' z' b' = fromJust (fst <$> (continue c' z' b'))
rpt i c' z' b' = let ... in rpt (i  1) c''
+ Relevant bindings include
+ b :: B c (bound at T8518.hs:14:14)
+ z :: Z c (bound at T8518.hs:14:12)
+ c :: c (bound at T8518.hs:14:10)
+ callCont :: c > Z c > B c > Maybe (F c) (bound at T8518.hs:14:1)
T8518.hs:17:78:
Couldn't match expected type ‘F a1’
with actual type ‘Z a1 > B a1 > F a1’
+ In the expression: rpt (i  1) c''
+ In the expression:
+ let c'' = fromJust (snd <$> (continue c' z' b')) in rpt (i  1) c''
Relevant bindings include
c'' :: a1 (bound at T8518.hs:17:30)
b' :: B a1 (bound at T8518.hs:17:21)
z' :: Z a1 (bound at T8518.hs:17:18)
c' :: a1 (bound at T8518.hs:17:15)
rpt :: a > a1 > Z a1 > B a1 > F a1 (bound at T8518.hs:16:9)
 In the expression: rpt (i  1) c''
 In the expression:
 let c'' = fromJust (snd <$> (continue c' z' b')) in rpt (i  1) c''
diff git a/testsuite/tests/indexedtypes/should_fail/T9662.stderr b/testsuite/tests/indexedtypes/should_fail/T9662.stderr
index 596c16c724..3c800183a1 100644
 a/testsuite/tests/indexedtypes/should_fail/T9662.stderr
+++ b/testsuite/tests/indexedtypes/should_fail/T9662.stderr
@@ 15,10 +15,6 @@ T9662.hs:49:7: error:
> Exp (((sh :. k) :. m) :. n)
Actual type: Exp (((sh :. k) :. m) :. n)
> Exp (((sh :. k) :. m) :. n)
 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 expression:
backpermute
@@ 26,6 +22,10 @@ T9662.hs:49:7: error:
(atom :. atom :. atom :. atom)
(\ (sh :. k :. m :. n) > (sh :. m :. n :. k)))
id
+ Relevant bindings include
+ test :: Shape (((sh :. k) :. m) :. n)
+ > Shape (((sh :. m) :. n) :. k)
+ (bound at T9662.hs:45:1)
T9662.hs:49:7: error:
Couldn't match type ‘m’ with ‘k’
@@ 43,10 +43,6 @@ T9662.hs:49:7: error:
> Exp (((sh :. k) :. m) :. n)
Actual type: Exp (((sh :. k) :. m) :. n)
> Exp (((sh :. k) :. m) :. n)
 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 expression:
backpermute
@@ 54,6 +50,10 @@ T9662.hs:49:7: error:
(atom :. atom :. atom :. atom)
(\ (sh :. k :. m :. n) > (sh :. m :. n :. k)))
id
+ Relevant bindings include
+ test :: Shape (((sh :. k) :. m) :. n)
+ > Shape (((sh :. m) :. n) :. k)
+ (bound at T9662.hs:45:1)
T9662.hs:49:7: error:
Couldn't match type ‘n’ with ‘m’
@@ 71,10 +71,6 @@ T9662.hs:49:7: error:
> Exp (((sh :. k) :. m) :. n)
Actual type: Exp (((sh :. k) :. m) :. n)
> Exp (((sh :. k) :. m) :. n)
 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 expression:
backpermute
@@ 82,3 +78,7 @@ T9662.hs:49:7: error:
(atom :. atom :. atom :. atom)
(\ (sh :. k :. m :. n) > (sh :. m :. n :. k)))
id
+ Relevant bindings include
+ test :: Shape (((sh :. k) :. m) :. n)
+ > Shape (((sh :. m) :. n) :. k)
+ (bound at T9662.hs:45:1)
diff git a/testsuite/tests/module/mod71.stderr b/testsuite/tests/module/mod71.stderr
index 84a5c865b6..a85f7cf182 100644
 a/testsuite/tests/module/mod71.stderr
+++ b/testsuite/tests/module/mod71.stderr
@@ 4,9 +4,9 @@ mod71.hs:4:9: error:
Where: ‘t1’ is a rigid type variable bound by
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
+ Relevant bindings include
+ x :: t1 > a > t (bound at mod71.hs:4:3)
+ f :: (t1 > a > t) > t (bound at mod71.hs:4:1)
diff git a/testsuite/tests/parser/should_fail/T7848.stderr b/testsuite/tests/parser/should_fail/T7848.stderr
index 311146dc16..902f303649 100644
 a/testsuite/tests/parser/should_fail/T7848.stderr
+++ b/testsuite/tests/parser/should_fail/T7848.stderr
@@ 2,14 +2,6 @@
T7848.hs:6:57: error:
Occurs check: cannot construct the infinite type:
t2 ~ t0 > t > t1 > A > A > A > A > t2
 Relevant bindings include
 y :: forall t4. t4 > t > t1 > A > A > A > A > t2
 (bound at T7848.hs:8:9)
 (&) :: t > t1 > A > A > A > A > t2 (bound at T7848.hs:11:9)
 z :: t1 (bound at T7848.hs:6:12)
 (&) :: t1 (bound at T7848.hs:6:8)
 (+) :: t (bound at T7848.hs:6:3)
 x :: t > t1 > A > A > A > A > t2 (bound at T7848.hs:6:1)
In the expression: y
In an equation for ‘x’:
x (+) ((&)@z) ((:&&) a b) (c :&& d) (e `A` f) (A g h)
@@ 20,17 +12,20 @@ T7848.hs:6:57: error:
{# INLINE (&) #}
{# SPECIALIZE (&) :: a #}
(&) = x
+ Relevant bindings include
+ y :: forall t4. t4 > t > t1 > A > A > A > A > t2
+ (bound at T7848.hs:8:9)
+ (&) :: t > t1 > A > A > A > A > t2 (bound at T7848.hs:11:9)
+ z :: t1 (bound at T7848.hs:6:12)
+ (&) :: t1 (bound at T7848.hs:6:8)
+ (+) :: t (bound at T7848.hs:6:3)
+ x :: t > t1 > A > A > A > A > t2 (bound at T7848.hs:6:1)
T7848.hs:10:9: error:
Couldn't match expected type ‘t > t1 > A > A > A > A > t2’
with actual type ‘a’
‘a’ is a rigid type variable bound by
the type signature for: (&) :: a at T7848.hs:10:9
 Relevant bindings include
 z :: t1 (bound at T7848.hs:6:12)
 (&) :: t1 (bound at T7848.hs:6:8)
 (+) :: t (bound at T7848.hs:6:3)
 x :: t > t1 > A > A > A > A > t2 (bound at T7848.hs:6:1)
In the SPECIALISE pragma {# SPECIALIZE (&) :: a #}
In an equation for ‘x’:
x (+) ((&)@z) ((:&&) a b) (c :&& d) (e `A` f) (A g h)
@@ 41,3 +36,8 @@ T7848.hs:10:9: error:
{# INLINE (&) #}
{# SPECIALIZE (&) :: a #}
(&) = x
+ Relevant bindings include
+ z :: t1 (bound at T7848.hs:6:12)
+ (&) :: t1 (bound at T7848.hs:6:8)
+ (+) :: t (bound at T7848.hs:6:3)
+ x :: t > t1 > A > A > A > A > t2 (bound at T7848.hs:6:1)
diff git a/testsuite/tests/parser/should_fail/readFail003.stderr b/testsuite/tests/parser/should_fail/readFail003.stderr
index e90fbb455d..acb265b9b4 100644
 a/testsuite/tests/parser/should_fail/readFail003.stderr
+++ b/testsuite/tests/parser/should_fail/readFail003.stderr
@@ 2,10 +2,6 @@
readFail003.hs:4:27:
Occurs check: cannot construct the infinite type:
t ~ (t, [a], [a1])
 Relevant bindings include
 a :: t (bound at readFail003.hs:4:3)
 b :: [a] (bound at readFail003.hs:4:5)
 c :: [a1] (bound at readFail003.hs:4:7)
In the expression: a
In a pattern binding:
~(a, b, c)
@@ 14,3 +10,7 @@ readFail003.hs:4:27:
 otherwise = a
where
nullity = null
+ Relevant bindings include
+ a :: t (bound at readFail003.hs:4:3)
+ b :: [a] (bound at readFail003.hs:4:5)
+ c :: [a1] (bound at readFail003.hs:4:7)
diff git a/testsuite/tests/partialsigs/should_compile/SplicesUsed.stderr b/testsuite/tests/partialsigs/should_compile/SplicesUsed.stderr
index de30497289..1df0b889fd 100644
 a/testsuite/tests/partialsigs/should_compile/SplicesUsed.stderr
+++ b/testsuite/tests/partialsigs/should_compile/SplicesUsed.stderr
@@ 8,20 +8,20 @@ SplicesUsed.hs:7:16: warning:
SplicesUsed.hs:8:15: warning:
Found type wildcard ‘_a’ standing for ‘Maybe Bool’
 Relevant bindings include
 maybeBool :: Maybe Bool (bound at SplicesUsed.hs:8:1)
In an expression type signature: _a > _a
In the expression: id :: _a > _a
In the expression: (id :: _a > _a) (Just True :: Maybe _)
+ Relevant bindings include
+ maybeBool :: Maybe Bool (bound at SplicesUsed.hs:8:1)
SplicesUsed.hs:8:27: warning:
Found type wildcard ‘_’ standing for ‘Bool’
 Relevant bindings include
 maybeBool :: Maybe Bool (bound at SplicesUsed.hs:8:1)
In an expression type signature: Maybe _
In the first argument of ‘id :: _a > _a’, namely
‘(Just True :: Maybe _)’
In the expression: (id :: _a > _a) (Just True :: Maybe _)
+ Relevant bindings include
+ maybeBool :: Maybe Bool (bound at SplicesUsed.hs:8:1)
SplicesUsed.hs:10:17: warning:
Found type wildcard ‘_’ standing for ‘(Char, a)’
diff git a/testsuite/tests/partialsigs/should_compile/T10438.stderr b/testsuite/tests/partialsigs/should_compile/T10438.stderr
index 7c2a0907e8..2ae08675f2 100644
 a/testsuite/tests/partialsigs/should_compile/T10438.stderr
+++ b/testsuite/tests/partialsigs/should_compile/T10438.stderr
@@ 3,11 +3,6 @@ T10438.hs:7:22: warning:
Found type wildcard ‘_’ standing for ‘t2’
Where: ‘t2’ is a rigid type variable bound by
the inferred type of g :: t2 > t2 at T10438.hs:6:9
 Relevant bindings include
 r :: t2 (bound at T10438.hs:6:11)
 g :: t2 > t2 (bound at T10438.hs:6:9)
 f :: t (bound at T10438.hs:5:5)
 foo :: t > t1 > t1 (bound at T10438.hs:5:1)
In the type signature for:
x :: _
In an equation for ‘g’:
@@ 25,3 +20,8 @@ T10438.hs:7:22: warning:
where
x :: _
x = r
+ Relevant bindings include
+ r :: t2 (bound at T10438.hs:6:11)
+ g :: t2 > t2 (bound at T10438.hs:6:9)
+ f :: t (bound at T10438.hs:5:5)
+ foo :: t > t1 > t1 (bound at T10438.hs:5:1)
diff git a/testsuite/tests/partialsigs/should_compile/T10463.stderr b/testsuite/tests/partialsigs/should_compile/T10463.stderr
index 01fc4b3214..9a3215e9fb 100644
 a/testsuite/tests/partialsigs/should_compile/T10463.stderr
+++ b/testsuite/tests/partialsigs/should_compile/T10463.stderr
@@ 1,8 +1,8 @@
T10463.hs:5:9: warning:
Found type wildcard ‘_’ standing for ‘[Char]’
 Relevant bindings include
 f :: [Char] > [Char] (bound at T10463.hs:5:1)
In a pattern type signature: _
In the pattern: x :: _
In an equation for ‘f’: f (x :: _) = x ++ ""
+ Relevant bindings include
+ f :: [Char] > [Char] (bound at T10463.hs:5:1)
diff git a/testsuite/tests/partialsigs/should_compile/TypedSplice.stderr b/testsuite/tests/partialsigs/should_compile/TypedSplice.stderr
index 3cfa776ef1..2f92c657f3 100644
 a/testsuite/tests/partialsigs/should_compile/TypedSplice.stderr
+++ b/testsuite/tests/partialsigs/should_compile/TypedSplice.stderr
@@ 1,16 +1,16 @@
TypedSplice.hs:9:22: warning:
Found type wildcard ‘_’ standing for ‘Bool’
 Relevant bindings include
 metaExp :: Q (TExp (Bool > Bool)) (bound at TypedSplice.hs:9:1)
In an expression type signature: _ > _b
In the Template Haskell quotation [ not :: _ > _b ]
In the expression: [ not :: _ > _b ]
+ Relevant bindings include
+ metaExp :: Q (TExp (Bool > Bool)) (bound at TypedSplice.hs:9:1)
TypedSplice.hs:9:27: warning:
Found type wildcard ‘_b’ standing for ‘Bool’
 Relevant bindings include
 metaExp :: Q (TExp (Bool > Bool)) (bound at TypedSplice.hs:9:1)
In an expression type signature: _ > _b
In the Template Haskell quotation [ not :: _ > _b ]
In the expression: [ not :: _ > _b ]
+ Relevant bindings include
+ metaExp :: Q (TExp (Bool > Bool)) (bound at TypedSplice.hs:9:1)
diff git a/testsuite/tests/partialsigs/should_fail/NamedWildcardsNotEnabled.stderr b/testsuite/tests/partialsigs/should_fail/NamedWildcardsNotEnabled.stderr
index a8c4bc596c..7029b0495c 100644
 a/testsuite/tests/partialsigs/should_fail/NamedWildcardsNotEnabled.stderr
+++ b/testsuite/tests/partialsigs/should_fail/NamedWildcardsNotEnabled.stderr
@@ 4,18 +4,18 @@ NamedWildcardsNotEnabled.hs:4:9:
‘_b’ is a rigid type variable bound by
the type signature for: foo :: _a > _b
at NamedWildcardsNotEnabled.hs:3:8
 Relevant bindings include
 foo :: _a > _b (bound at NamedWildcardsNotEnabled.hs:4:1)
In the expression: not x
In an equation for ‘foo’: foo x = not x
+ Relevant bindings include
+ foo :: _a > _b (bound at NamedWildcardsNotEnabled.hs:4:1)
NamedWildcardsNotEnabled.hs:4:13:
Couldn't match expected type ‘Bool’ with actual type ‘_a’
‘_a’ is a rigid type variable bound by
the type signature for: foo :: _a > _b
at NamedWildcardsNotEnabled.hs:3:8
+ In the first argument of ‘not’, namely ‘x’
+ In the expression: not x
Relevant bindings include
x :: _a (bound at NamedWildcardsNotEnabled.hs:4:5)
foo :: _a > _b (bound at NamedWildcardsNotEnabled.hs:4:1)
 In the first argument of ‘not’, namely ‘x’
 In the expression: not x
diff git a/testsuite/tests/partialsigs/should_fail/T10045.stderr b/testsuite/tests/partialsigs/should_fail/T10045.stderr
index c57170ebc2..959bc0f52c 100644
 a/testsuite/tests/partialsigs/should_fail/T10045.stderr
+++ b/testsuite/tests/partialsigs/should_fail/T10045.stderr
@@ 6,9 +6,6 @@ T10045.hs:6:18: error:
‘t2’ is a rigid type variable bound by
the inferred type of copy :: t1 > Bool > t2 at T10045.hs:7:10
To use the inferred type, enable PartialTypeSignatures
 Relevant bindings include
 ws1 :: () (bound at T10045.hs:5:11)
 foo :: Meta > t (bound at T10045.hs:5:1)
In the type signature for:
copy :: _
In the expression:
@@ 22,3 +19,6 @@ T10045.hs:6:18: error:
copy :: _
copy w from = copy w True
in copy ws1 False
+ Relevant bindings include
+ ws1 :: () (bound at T10045.hs:5:11)
+ foo :: Meta > t (bound at T10045.hs:5:1)
diff git a/testsuite/tests/partialsigs/should_fail/T10615.stderr b/testsuite/tests/partialsigs/should_fail/T10615.stderr
index 22ce84af63..3c2c2e9dab 100644
 a/testsuite/tests/partialsigs/should_fail/T10615.stderr
+++ b/testsuite/tests/partialsigs/should_fail/T10615.stderr
@@ 12,9 +12,9 @@ T10615.hs:5:6: error:
the inferred type of f1 :: a1 > f at T10615.hs:4:7
Expected type: a1 > f
Actual type: a1 > b1 > a1
 Relevant bindings include f1 :: a1 > f (bound at T10615.hs:5:1)
In the expression: const
In an equation for ‘f1’: f1 = const
+ Relevant bindings include f1 :: a1 > f (bound at T10615.hs:5:1)
T10615.hs:7:7: error:
Found type wildcard ‘_’ standing for ‘a0’
@@ 29,6 +29,6 @@ T10615.hs:8:6: error:
the inferred type of f2 :: a0 > _f at T10615.hs:7:7
Expected type: a0 > _f
Actual type: a0 > b0 > a0
 Relevant bindings include f2 :: a0 > _f (bound at T10615.hs:8:1)
In the expression: const
In an equation for ‘f2’: f2 = const
+ Relevant bindings include f2 :: a0 > _f (bound at T10615.hs:8:1)
diff git a/testsuite/tests/partialsigs/should_fail/Trac10045.stderr b/testsuite/tests/partialsigs/should_fail/Trac10045.stderr
index 7eb8b3eebd..045423ca0c 100644
 a/testsuite/tests/partialsigs/should_fail/Trac10045.stderr
+++ b/testsuite/tests/partialsigs/should_fail/Trac10045.stderr
@@ 1,46 +1,46 @@

Trac10045.hs:6:17: error:
 Found type wildcard ‘_’ standing for ‘t1 > a > t2’
 Where: ‘t1’ is a rigid type variable bound by
 the inferred type of copy :: Num a => t1 > a > t2
 at Trac10045.hs:7:9
 ‘a’ is a rigid type variable bound by
 the inferred type of copy :: Num a => t1 > a > t2
 at Trac10045.hs:7:9
 ‘t2’ is a rigid type variable bound by
 the inferred type of copy :: Num a => t1 > a > t2
 at Trac10045.hs:7:9
 To use the inferred type, enable PartialTypeSignatures
 Relevant bindings include
 ws1 :: () (bound at Trac10045.hs:5:11)
 foo :: Meta > t (bound at Trac10045.hs:5:1)
 In the type signature for:
 copy :: _
 In the expression:
 let
 copy :: _
 copy w from = copy w 1
 in copy ws1 1
 In an equation for ‘foo’:
 foo (Meta ws1)
 = let
 copy :: _
 copy w from = copy w 1
 in copy ws1 1

Trac10045.hs:7:9: error:
 No instance for (Num a)
 When checking that ‘copy’ has the inferred type
 copy :: forall t t1 a. t > a > t1
 Probable cause: the inferred type is ambiguous
 In the expression:
 let
 copy :: _
 copy w from = copy w 1
 in copy ws1 1
 In an equation for ‘foo’:
 foo (Meta ws1)
 = let
 copy :: _
 copy w from = copy w 1
 in copy ws1 1
+
+Trac10045.hs:6:17: error:
+ Found type wildcard ‘_’ standing for ‘t1 > a > t2’
+ Where: ‘t1’ is a rigid type variable bound by
+ the inferred type of copy :: Num a => t1 > a > t2
+ at Trac10045.hs:7:9
+ ‘a’ is a rigid type variable bound by
+ the inferred type of copy :: Num a => t1 > a > t2
+ at Trac10045.hs:7:9
+ ‘t2’ is a rigid type variable bound by
+ the inferred type of copy :: Num a => t1 > a > t2
+ at Trac10045.hs:7:9
+ To use the inferred type, enable PartialTypeSignatures
+ In the type signature for:
+ copy :: _
+ In the expression:
+ let
+ copy :: _
+ copy w from = copy w 1
+ in copy ws1 1
+ In an equation for ‘foo’:
+ foo (Meta ws1)
+ = let
+ copy :: _
+ copy w from = copy w 1
+ in copy ws1 1
+ Relevant bindings include
+ ws1 :: () (bound at Trac10045.hs:5:11)
+ foo :: Meta > t (bound at Trac10045.hs:5:1)
+
+Trac10045.hs:7:9: error:
+ No instance for (Num a)
+ When checking that ‘copy’ has the inferred type
+ copy :: forall t t1 a. t > a > t1
+ Probable cause: the inferred type is ambiguous
+ In the expression:
+ let
+ copy :: _
+ copy w from = copy w 1
+ in copy ws1 1
+ In an equation for ‘foo’:
+ foo (Meta ws1)
+ = let
+ copy :: _
+ copy w from = copy w 1
+ in copy ws1 1
diff git a/testsuite/tests/partialsigs/should_fail/WildcardsInPatternAndExprSig.stderr b/testsuite/tests/partialsigs/should_fail/WildcardsInPatternAndExprSig.stderr
index 97dacfe20a..6e87e4ff9c 100644
 a/testsuite/tests/partialsigs/should_fail/WildcardsInPatternAndExprSig.stderr
+++ b/testsuite/tests/partialsigs/should_fail/WildcardsInPatternAndExprSig.stderr
@@ 5,12 +5,12 @@ WildcardsInPatternAndExprSig.hs:4:18: error:
the inferred type of bar :: Maybe [t] > t > [t]
at WildcardsInPatternAndExprSig.hs:4:1
To use the inferred type, enable PartialTypeSignatures
 Relevant bindings include
 bar :: Maybe [t] > t > [t]
 (bound at WildcardsInPatternAndExprSig.hs:4:1)
In a pattern type signature: _a
In the pattern: x :: _a
In the pattern: [x :: _a]
+ Relevant bindings include
+ bar :: Maybe [t] > t > [t]
+ (bound at WildcardsInPatternAndExprSig.hs:4:1)
WildcardsInPatternAndExprSig.hs:4:25: error:
Found type wildcard ‘_’ standing for ‘[t]’
@@ 18,12 +18,12 @@ WildcardsInPatternAndExprSig.hs:4:25: error:
the inferred type of bar :: Maybe [t] > t > [t]
at WildcardsInPatternAndExprSig.hs:4:1
To use the inferred type, enable PartialTypeSignatures
 Relevant bindings include
 bar :: Maybe [t] > t > [t]
 (bound at WildcardsInPatternAndExprSig.hs:4:1)
In a pattern type signature: _
In the pattern: [x :: _a] :: _
In the pattern: Just ([x :: _a] :: _)
+ Relevant bindings include
+ bar :: Maybe [t] > t > [t]
+ (bound at WildcardsInPatternAndExprSig.hs:4:1)
WildcardsInPatternAndExprSig.hs:4:38: error:
Found type wildcard ‘_b’ standing for ‘t’
@@ 31,14 +31,14 @@ WildcardsInPatternAndExprSig.hs:4:38: error:
the inferred type of bar :: Maybe [t] > t > [t]
at WildcardsInPatternAndExprSig.hs:4:1
To use the inferred type, enable PartialTypeSignatures
 Relevant bindings include
 bar :: Maybe [t] > t > [t]
 (bound at WildcardsInPatternAndExprSig.hs:4:1)
In a pattern type signature: Maybe [_b]
In the pattern: Just ([x :: _a] :: _) :: Maybe [_b]
In an equation for ‘bar’:
bar (Just ([x :: _a] :: _) :: Maybe [_b]) (z :: _c)
= [x, z] :: [_d]
+ Relevant bindings include
+ bar :: Maybe [t] > t > [t]
+ (bound at WildcardsInPatternAndExprSig.hs:4:1)
WildcardsInPatternAndExprSig.hs:4:49: error:
Found type wildcard ‘_c’ standing for ‘t’
@@ 46,15 +46,15 @@ WildcardsInPatternAndExprSig.hs:4:49: error:
the inferred type of bar :: Maybe [t] > t > [t]
at WildcardsInPatternAndExprSig.hs:4:1
To use the inferred type, enable PartialTypeSignatures
 Relevant bindings include
 x :: t (bound at WildcardsInPatternAndExprSig.hs:4:13)
 bar :: Maybe [t] > t > [t]
 (bound at WildcardsInPatternAndExprSig.hs:4:1)
In a pattern type signature: _c
In the pattern: z :: _c
In an equation for ‘bar’:
bar (Just ([x :: _a] :: _) :: Maybe [_b]) (z :: _c)
= [x, z] :: [_d]
+ Relevant bindings include
+ x :: t (bound at WildcardsInPatternAndExprSig.hs:4:13)
+ bar :: Maybe [t] > t > [t]
+ (bound at WildcardsInPatternAndExprSig.hs:4:1)
WildcardsInPatternAndExprSig.hs:4:66: error:
Found type wildcard ‘_d’ standing for ‘t’
@@ 62,13 +62,13 @@ WildcardsInPatternAndExprSig.hs:4:66: error:
the inferred type of bar :: Maybe [t] > t > [t]
at WildcardsInPatternAndExprSig.hs:4:1
To use the inferred type, enable PartialTypeSignatures
 Relevant bindings include
 z :: t (bound at WildcardsInPatternAndExprSig.hs:4:44)
 x :: t (bound at WildcardsInPatternAndExprSig.hs:4:13)
 bar :: Maybe [t] > t > [t]
 (bound at WildcardsInPatternAndExprSig.hs:4:1)
In an expression type signature: [_d]
In the expression: [x, z] :: [_d]
In an equation for ‘bar’:
bar (Just ([x :: _a] :: _) :: Maybe [_b]) (z :: _c)
= [x, z] :: [_d]
+ Relevant bindings include
+ z :: t (bound at WildcardsInPatternAndExprSig.hs:4:44)
+ x :: t (bound at WildcardsInPatternAndExprSig.hs:4:13)
+ bar :: Maybe [t] > t > [t]
+ (bound at WildcardsInPatternAndExprSig.hs:4:1)
diff git a/testsuite/tests/polykinds/T7230.stderr b/testsuite/tests/polykinds/T7230.stderr
index ed7140f53b..0756cd5284 100644
 a/testsuite/tests/polykinds/T7230.stderr
+++ b/testsuite/tests/polykinds/T7230.stderr
@@ 20,9 +20,9 @@ T7230.hs:48:32:
at T7230.hs:48:1726
Expected type: SBool (Increasing xs)
Actual type: SBool (x :<<= x1)
 Relevant bindings include
 y :: Sing x1 (bound at T7230.hs:48:23)
 x :: Sing x (bound at T7230.hs:48:14)
In the expression: x %:<<= y
In an equation for ‘crash’:
crash (SCons x (SCons y xs)) = x %:<<= y
+ Relevant bindings include
+ y :: Sing x1 (bound at T7230.hs:48:23)
+ x :: Sing x (bound at T7230.hs:48:14)
diff git a/testsuite/tests/polykinds/T7438.stderr b/testsuite/tests/polykinds/T7438.stderr
index d45bec1851..d87e437b31 100644
 a/testsuite/tests/polykinds/T7438.stderr
+++ b/testsuite/tests/polykinds/T7438.stderr
@@ 12,8 +12,8 @@ T7438.hs:6:14: error:
‘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’
+ In the expression: acc
+ In an equation for ‘go’: go Nil acc = acc
Relevant bindings include
acc :: t (bound at T7438.hs:6:8)
go :: Thrist t2 t3 > t > t1 (bound at T7438.hs:6:1)
 In the expression: acc
 In an equation for ‘go’: go Nil acc = acc
diff git a/testsuite/tests/polykinds/T7594.stderr b/testsuite/tests/polykinds/T7594.stderr
index 08ab1632e6..3ee902ad78 100644
 a/testsuite/tests/polykinds/T7594.stderr
+++ b/testsuite/tests/polykinds/T7594.stderr
@@ 10,6 +10,6 @@ T7594.hs:33:12:
Possible fix: add a type signature for ‘bar2’
Expected type: a > b
Actual type: a > IO ()
 Relevant bindings include bar2 :: b (bound at T7594.hs:33:1)
In the first argument of ‘app’, namely ‘print’
In the expression: app print q2
+ Relevant bindings include bar2 :: b (bound at T7594.hs:33:1)
diff git a/testsuite/tests/simplCore/should_compile/simpl017.stderr b/testsuite/tests/simplCore/should_compile/simpl017.stderr
index 5d4dc582e6..2d3c16ef71 100644
 a/testsuite/tests/simplCore/should_compile/simpl017.stderr
+++ b/testsuite/tests/simplCore/should_compile/simpl017.stderr
@@ 2,37 +2,37 @@
simpl017.hs:55:12:
Couldn't match expected type ‘forall v. [E m i] > E' v m a’
with actual type ‘[E m i] > E' v0 m a’
+ In the first argument of ‘return’, namely ‘f’
+ In a stmt of a 'do' block: return f
Relevant bindings include
f :: [E m i] > E' v0 m a (bound at simpl017.hs:54:9)
ix :: [E m i] > m i (bound at simpl017.hs:52:9)
a :: arr i a (bound at simpl017.hs:50:11)
liftArray :: arr i a > E m (forall v. [E m i] > E' v m a)
(bound at simpl017.hs:50:1)
 In the first argument of ‘return’, namely ‘f’
 In a stmt of a 'do' block: return f
simpl017.hs:74:5:
Couldn't match expected type ‘[E (ST t0) Int] > E (ST s) Int’
with actual type ‘forall v. [E (ST s) Int] > E' v (ST s) Int’
+ The function ‘a’ is applied to one argument,
+ but its type ‘forall v. [E (ST s) Int] > E' v (ST s) Int’ has none
+ In the first argument of ‘plus’, namely ‘a [one]’
+ In a stmt of a 'do' block: a [one] `plus` a [one]
Relevant bindings include
a :: forall v. [E (ST s) Int] > E' v (ST s) Int
(bound at simpl017.hs:71:5)
ma :: STArray s Int Int (bound at simpl017.hs:70:5)
foo :: STArray s Int Int > ST s Int (bound at simpl017.hs:70:1)
 The function ‘a’ is applied to one argument,
 but its type ‘forall v. [E (ST s) Int] > E' v (ST s) Int’ has none
 In the first argument of ‘plus’, namely ‘a [one]’
 In a stmt of a 'do' block: a [one] `plus` a [one]
simpl017.hs:74:19:
Couldn't match expected type ‘[E (ST t1) Int] > E (ST s) Int’
with actual type ‘forall v. [E (ST s) Int] > E' v (ST s) Int’
+ The function ‘a’ is applied to one argument,
+ but its type ‘forall v. [E (ST s) Int] > E' v (ST s) Int’ has none
+ In the second argument of ‘plus’, namely ‘a [one]’
+ In a stmt of a 'do' block: a [one] `plus` a [one]
Relevant bindings include
a :: forall v. [E (ST s) Int] > E' v (ST s) Int
(bound at simpl017.hs:71:5)
ma :: STArray s Int Int (bound at simpl017.hs:70:5)
foo :: STArray s Int Int > ST s Int (bound at simpl017.hs:70:1)
 The function ‘a’ is applied to one argument,
 but its type ‘forall v. [E (ST s) Int] > E' v (ST s) Int’ has none
 In the second argument of ‘plus’, namely ‘a [one]’
 In a stmt of a 'do' block: a [one] `plus` a [one]
diff git a/testsuite/tests/th/T10267.stderr b/testsuite/tests/th/T10267.stderr
index 442a779e44..909479389d 100644
 a/testsuite/tests/th/T10267.stderr
+++ b/testsuite/tests/th/T10267.stderr
@@ 5,11 +5,11 @@ T10267.hs:8:1: error:
the type signature for:
j :: a0 > a0
at T10267.hs:8:1
+ In the expression: _
+ In an equation for ‘j’: j x = _
Relevant bindings include
x :: a0 (bound at T10267.hs:8:1)
j :: a0 > a0 (bound at T10267.hs:8:1)
 In the expression: _
 In an equation for ‘j’: j x = _
T10267.hs:8:1: error:
Found hole: _foo :: a0 > a0
@@ 18,9 +18,9 @@ T10267.hs:8:1: error:
i :: a0 > a0
at T10267.hs:8:1
Or perhaps ‘_foo’ is misspelled, or not in scope
 Relevant bindings include i :: a0 > a0 (bound at T10267.hs:8:1)
In the expression: _foo
In an equation for ‘i’: i = _foo
+ Relevant bindings include i :: a0 > a0 (bound at T10267.hs:8:1)
T10267.hs:14:3: error:
Found hole: _foo :: a > a
@@ 29,9 +29,9 @@ T10267.hs:14:3: error:
k :: a > a
at T10267.hs:14:3
Or perhaps ‘_foo’ is misspelled, or not in scope
 Relevant bindings include k :: a > a (bound at T10267.hs:14:3)
In the expression: _foo
In an equation for ‘k’: k = _foo
+ Relevant bindings include k :: a > a (bound at T10267.hs:14:3)
T10267.hs:23:3: error:
Found hole: _ :: a
@@ 39,8 +39,8 @@ T10267.hs:23:3: error:
the type signature for:
l :: a > a
at T10267.hs:23:3
+ In the expression: _
+ In an equation for ‘l’: l x = _
Relevant bindings include
x :: a (bound at T10267.hs:23:3)
l :: a > a (bound at T10267.hs:23:3)
 In the expression: _
 In an equation for ‘l’: l x = _
diff git a/testsuite/tests/th/T7276a.stdout b/testsuite/tests/th/T7276a.stdout
index 410004b14d..f18cbbd1dd 100644
 a/testsuite/tests/th/T7276a.stdout
+++ b/testsuite/tests/th/T7276a.stdout
@@ 1,19 +1,19 @@
:3:9: warning:
 Couldn't match type ‘[Dec]’ with ‘Exp’
 Expected type: Q Exp
 Actual type: DecsQ
 In the expression: [d a = () ] :: Q Exp
 In an equation for ‘x’: x = [d a = () ] :: Q Exp
+ • Couldn't match type ‘[Dec]’ with ‘Exp’
+ Expected type: Q Exp
+ Actual type: DecsQ
+ • In the expression: [d a = () ] :: Q Exp
+ In an equation for ‘x’: x = [d a = () ] :: Q Exp
:1:1: error:
 Exception when trying to run compiletime code:
 :3:9: error:
 Couldn't match type ‘[Dec]’ with ‘Exp’
 Expected type: Q Exp
 Actual type: DecsQ
 In the expression: [d a = () ] :: Q Exp
 In an equation for ‘x’: x = [d a = () ] :: Q Exp
+ • Exception when trying to run compiletime code:
+ :3:9: error:
+ • Couldn't match type ‘[Dec]’ with ‘Exp’
+ Expected type: Q Exp
+ Actual type: DecsQ
+ • In the expression: [d a = () ] :: Q Exp
+ In an equation for ‘x’: x = [d a = () ] :: Q Exp
(deferred type error)
 Code: x
 In the untyped splice: $x
+ Code: x
+ • In the untyped splice: $x
diff git a/testsuite/tests/typecheck/should_compile/FD1.stderr b/testsuite/tests/typecheck/should_compile/FD1.stderr
index 2b0ac1733a..661bbcd9aa 100644
 a/testsuite/tests/typecheck/should_compile/FD1.stderr
+++ b/testsuite/tests/typecheck/should_compile/FD1.stderr
@@ 4,6 +4,6 @@ FD1.hs:16:1:
‘a’ is a rigid type variable bound by
the type signature for: plus :: E a (Int > Int) => Int > a
at FD1.hs:15:9
 Relevant bindings include plus :: Int > a (bound at FD1.hs:16:1)
The equation(s) for ‘plus’ have two arguments,
but its type ‘Int > a’ has only one
+ Relevant bindings include plus :: Int > a (bound at FD1.hs:16:1)
diff git a/testsuite/tests/typecheck/should_compile/FD2.stderr b/testsuite/tests/typecheck/should_compile/FD2.stderr
index 0134d87768..590c9b6520 100644
 a/testsuite/tests/typecheck/should_compile/FD2.stderr
+++ b/testsuite/tests/typecheck/should_compile/FD2.stderr
@@ 9,11 +9,11 @@ FD2.hs:26:34:
the type signature for:
mf :: Elem a e1 => e1 > Maybe e1 > Maybe e1
at FD2.hs:24:18
+ In the first argument of ‘Just’, namely ‘(f x y)’
+ In the expression: Just (f x y)
Relevant bindings include
y :: e1 (bound at FD2.hs:26:23)
x :: e1 (bound at FD2.hs:26:15)
mf :: e1 > Maybe e1 > Maybe e1 (bound at FD2.hs:25:12)
f :: e > e > e (bound at FD2.hs:22:10)
foldr1 :: (e > e > e) > a > e (bound at FD2.hs:22:3)
 In the first argument of ‘Just’, namely ‘(f x y)’
 In the expression: Just (f x y)
diff git a/testsuite/tests/typecheck/should_compile/FD3.stderr b/testsuite/tests/typecheck/should_compile/FD3.stderr
index f4c60451d8..8d3c33fcaf 100644
 a/testsuite/tests/typecheck/should_compile/FD3.stderr
+++ b/testsuite/tests/typecheck/should_compile/FD3.stderr
@@ 7,8 +7,8 @@ FD3.hs:15:15: error:
‘a’ is a rigid type variable bound by
the type signature for: translate :: (String, a) > A a
at FD3.hs:14:14
+ In the expression: mkA a
+ In an equation for ‘translate’: translate a = mkA a
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
diff git a/testsuite/tests/typecheck/should_compile/T2494.stderr b/testsuite/tests/typecheck/should_compile/T2494.stderr
index 0346e62a3f..71351cba0a 100644
 a/testsuite/tests/typecheck/should_compile/T2494.stderr
+++ b/testsuite/tests/typecheck/should_compile/T2494.stderr
@@ 7,14 +7,14 @@ T2494.hs:15:14:
the RULE "foo/foo" at T2494.hs:13:16
Expected type: Maybe (m a) > Maybe (m a)
Actual type: Maybe (m b) > Maybe (m b)
+ In the first argument of ‘foo’, namely ‘g’
+ In the second argument of ‘foo’, namely ‘(foo g x)’
Relevant bindings include
f :: forall (m :: * > *). Monad m => Maybe (m a) > Maybe (m a)
(bound at T2494.hs:13:11)
g :: forall (m :: * > *). Monad m => Maybe (m b) > Maybe (m b)
(bound at T2494.hs:14:11)
x :: Maybe a (bound at T2494.hs:14:65)
 In the first argument of ‘foo’, namely ‘g’
 In the second argument of ‘foo’, namely ‘(foo g x)’
T2494.hs:15:30:
Couldn't match type ‘b’ with ‘a’
@@ 24,11 +24,11 @@ T2494.hs:15:30:
the RULE "foo/foo" at T2494.hs:13:16
Expected type: Maybe (m a) > Maybe (m a)
Actual type: Maybe (m b) > Maybe (m b)
+ In the second argument of ‘(.)’, namely ‘g’
+ In the first argument of ‘foo’, namely ‘(f . g)’
Relevant bindings include
f :: forall (m :: * > *). Monad m => Maybe (m a) > Maybe (m a)
(bound at T2494.hs:13:11)
g :: forall (m :: * > *). Monad m => Maybe (m b) > Maybe (m b)
(bound at T2494.hs:14:11)
x :: Maybe a (bound at T2494.hs:14:65)
 In the second argument of ‘(.)’, namely ‘g’
 In the first argument of ‘foo’, namely ‘(f . g)’
diff git a/testsuite/tests/typecheck/should_compile/T9497a.stderr b/testsuite/tests/typecheck/should_compile/T9497a.stderr
index f6a388d214..3982616412 100644
 a/testsuite/tests/typecheck/should_compile/T9497a.stderr
+++ b/testsuite/tests/typecheck/should_compile/T9497a.stderr
@@ 2,6 +2,6 @@
T9497a.hs:2:8: warning:
Found hole: _main :: IO ()
Or perhaps ‘_main’ is misspelled, or not in scope
 Relevant bindings include main :: IO () (bound at T9497a.hs:2:1)
In the expression: _main
In an equation for ‘main’: main = _main
+ Relevant bindings include main :: IO () (bound at T9497a.hs:2:1)
diff git a/testsuite/tests/typecheck/should_compile/T9834.stderr b/testsuite/tests/typecheck/should_compile/T9834.stderr
index 534d16d7cb..c49e49bb9d 100644
 a/testsuite/tests/typecheck/should_compile/T9834.stderr
+++ b/testsuite/tests/typecheck/should_compile/T9834.stderr
@@ 11,14 +11,14 @@ T9834.hs:23:10: Warning:
Applicative q =>
Nat (Comp p q) (Comp p q))
> p a0 > p a0
+ In the expression: wrapIdComp
+ In an equation for ‘afix’: afix = wrapIdComp
Relevant bindings include
afix :: (forall (q :: * > *).
Applicative q =>
Comp p q a > Comp p q a)
> p a
(bound at T9834.hs:23:3)
 In the expression: wrapIdComp
 In an equation for ‘afix’: afix = wrapIdComp
T9834.hs:23:10: Warning:
Couldn't match type ‘a’ with ‘p a0’
@@ 37,14 +37,14 @@ T9834.hs:23:10: Warning:
Applicative q =>
Nat (Comp p q) (Comp p q))
> p a0 > p a0
+ In the expression: wrapIdComp
+ In an equation for ‘afix’: afix = wrapIdComp
Relevant bindings include
afix :: (forall (q :: * > *).
Applicative q =>
Comp p q a > Comp p q a)
> p a
(bound at T9834.hs:23:3)
 In the expression: wrapIdComp
 In an equation for ‘afix’: afix = wrapIdComp
T9834.hs:23:10: Warning:
Couldn't match type ‘a’ with ‘a1’
@@ 61,11 +61,11 @@ T9834.hs:23:10: Warning:
at T9834.hs:23:10
Expected type: Comp p q a1 > Comp p q a1
Actual type: Comp p q a > Comp p q a
+ In the expression: wrapIdComp
+ In an equation for ‘afix’: afix = wrapIdComp
Relevant bindings include
afix :: (forall (q :: * > *).
Applicative q =>
Comp p q a > Comp p q a)
> p a
(bound at T9834.hs:23:3)
 In the expression: wrapIdComp
 In an equation for ‘afix’: afix = wrapIdComp
diff git a/testsuite/tests/typecheck/should_compile/holes.stderr b/testsuite/tests/typecheck/should_compile/holes.stderr
index 2eaf8f4d61..5cb341709e 100644
 a/testsuite/tests/typecheck/should_compile/holes.stderr
+++ b/testsuite/tests/typecheck/should_compile/holes.stderr
@@ 3,31 +3,31 @@ holes.hs:3:5: warning:
Found hole: _ :: t
Where: ‘t’ is a rigid type variable bound by
the inferred type of f :: t at holes.hs:3:1
 Relevant bindings include f :: t (bound at holes.hs:3:1)
In the expression: _
In an equation for ‘f’: f = _
+ Relevant bindings include f :: t (bound at holes.hs:3:1)
holes.hs:6:7: warning:
Found hole: _ :: Char
+ In the expression: _
+ In an equation for ‘g’: g x = _
Relevant bindings include
x :: Int (bound at holes.hs:6:3)
g :: Int > Char (bound at holes.hs:6:1)
 In the expression: _
 In an equation for ‘g’: g x = _
holes.hs:8:5: warning:
Found hole: _ :: [Char]
 Relevant bindings include h :: [Char] (bound at holes.hs:8:1)
In the first argument of ‘(++)’, namely ‘_’
In the expression: _ ++ "a"
In an equation for ‘h’: h = _ ++ "a"
+ Relevant bindings include h :: [Char] (bound at holes.hs:8:1)
holes.hs:11:15: warning:
Found hole: _ :: b0
Where: ‘b0’ is an ambiguous type variable
 Relevant bindings include
 y :: [a] (bound at holes.hs:11:3)
 z :: [a] > [a] (bound at holes.hs:11:1)
In the second argument of ‘const’, namely ‘_’
In the expression: const y _
In an equation for ‘z’: z y = const y _
+ Relevant bindings include
+ y :: [a] (bound at holes.hs:11:3)
+ z :: [a] > [a] (bound at holes.hs:11:1)
diff git a/testsuite/tests/typecheck/should_compile/holes2.stderr b/testsuite/tests/typecheck/should_compile/holes2.stderr
index 63891fa273..869cd2d970 100644
 a/testsuite/tests/typecheck/should_compile/holes2.stderr
+++ b/testsuite/tests/typecheck/should_compile/holes2.stderr
@@ 15,7 +15,7 @@ holes2.hs:3:5: warning:
holes2.hs:3:10: warning:
Found hole: _ :: a0
Where: ‘a0’ is an ambiguous type variable
 Relevant bindings include f :: String (bound at holes2.hs:3:1)
In the first argument of ‘show’, namely ‘_’
In the expression: show _
In an equation for ‘f’: f = show _
+ Relevant bindings include f :: String (bound at holes2.hs:3:1)
diff git a/testsuite/tests/typecheck/should_compile/holes3.stderr b/testsuite/tests/typecheck/should_compile/holes3.stderr
index 5770716972..a6e7c6194e 100644
 a/testsuite/tests/typecheck/should_compile/holes3.stderr
+++ b/testsuite/tests/typecheck/should_compile/holes3.stderr
@@ 3,34 +3,34 @@ holes3.hs:3:5: error:
Found hole: _ :: t
Where: ‘t’ is a rigid type variable bound by
the inferred type of f :: t at holes3.hs:3:1
 Relevant bindings include f :: t (bound at holes3.hs:3:1)
In the expression: _
In an equation for ‘f’: f = _
+ Relevant bindings include f :: t (bound at holes3.hs:3:1)
holes3.hs:6:7: error:
Found hole: _gr :: Char
Or perhaps ‘_gr’ is misspelled, or not in scope
+ In the expression: _gr
+ In an equation for ‘g’: g x = _gr
Relevant bindings include
x :: Int (bound at holes3.hs:6:3)
g :: Int > Char (bound at holes3.hs:6:1)
 In the expression: _gr
 In an equation for ‘g’: g x = _gr
holes3.hs:8:5: error:
Found hole: _aa :: [Char]
Or perhaps ‘_aa’ is misspelled, or not in scope
 Relevant bindings include h :: [Char] (bound at holes3.hs:8:1)
In the first argument of ‘(++)’, namely ‘_aa’
In the expression: _aa ++ "a"
In an equation for ‘h’: h = _aa ++ "a"
+ Relevant bindings include h :: [Char] (bound at holes3.hs:8:1)
holes3.hs:11:15: error:
Found hole: _x :: b0
Where: ‘b0’ is an ambiguous type variable
Or perhaps ‘_x’ is misspelled, or not in scope
 Relevant bindings include
 y :: [a] (bound at holes3.hs:11:3)
 z :: [a] > [a] (bound at holes3.hs:11:1)
In the second argument of ‘const’, namely ‘_x’
In the expression: const y _x
In an equation for ‘z’: z y = const y _x
+ Relevant bindings include
+ y :: [a] (bound at holes3.hs:11:3)
+ z :: [a] > [a] (bound at holes3.hs:11:1)
diff git a/testsuite/tests/typecheck/should_compile/tc141.stderr b/testsuite/tests/typecheck/should_compile/tc141.stderr
index 07adbfce6b..933eb03f55 100644
 a/testsuite/tests/typecheck/should_compile/tc141.stderr
+++ b/testsuite/tests/typecheck/should_compile/tc141.stderr
@@ 12,13 +12,13 @@ tc141.hs:11:31:
This (rigid, skolem) type variable is bound by
an expression type signature: a1
at tc141.hs:11:3134
+ In the expression: q :: a
+ In the expression: (q :: a, p)
Relevant bindings include
p :: a (bound at tc141.hs:11:12)
q :: a (bound at tc141.hs:11:17)
x :: (a, a) (bound at tc141.hs:11:3)
f :: (a, a) > (t, a) (bound at tc141.hs:11:1)
 In the expression: q :: a
 In the expression: (q :: a, p)
tc141.hs:13:13:
You cannot bind scoped type variable ‘a’
@@ 38,9 +38,9 @@ tc141.hs:15:18:
This (rigid, skolem) type variable is bound by
the type signature for: v :: a2
at tc141.hs:14:19
+ In the expression: b
+ In an equation for ‘v’: v = b
Relevant bindings include
v :: a2 (bound at tc141.hs:15:14)
b :: t (bound at tc141.hs:13:5)
g :: a > t > a1 (bound at tc141.hs:13:1)
 In the expression: b
 In an equation for ‘v’: v = b
diff git a/testsuite/tests/typecheck/should_fail/FDsFromGivens2.stderr b/testsuite/tests/typecheck/should_fail/FDsFromGivens2.stderr
index a738c7ffa4..a084b303dd 100644
 a/testsuite/tests/typecheck/should_fail/FDsFromGivens2.stderr
+++ b/testsuite/tests/typecheck/should_fail/FDsFromGivens2.stderr
@@ 8,7 +8,7 @@ FDsFromGivens2.hs:14:15: error:
KCC :: C Char Char => () > KCC,
in an equation for ‘bar’
at FDsFromGivens2.hs:14:610
 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
+ Relevant bindings include
+ bar :: KCC > a > a (bound at FDsFromGivens2.hs:14:1)
diff git a/testsuite/tests/typecheck/should_fail/FrozenErrorTests.stderr b/testsuite/tests/typecheck/should_fail/FrozenErrorTests.stderr
index 932ba108d4..b545a10caa 100644
 a/testsuite/tests/typecheck/should_fail/FrozenErrorTests.stderr
+++ b/testsuite/tests/typecheck/should_fail/FrozenErrorTests.stderr
@@ 12,10 +12,10 @@ FrozenErrorTests.hs:26:9:
Occurs check: cannot construct the infinite type: a ~ [a]
Expected type: [a]
Actual type: F a Bool
 Relevant bindings include
 test1 :: a (bound at FrozenErrorTests.hs:26:1)
In the expression: goo1 False undefined
In an equation for ‘test1’: test1 = goo1 False undefined
+ Relevant bindings include
+ test1 :: a (bound at FrozenErrorTests.hs:26:1)
FrozenErrorTests.hs:29:15:
Couldn't match type ‘Int’ with ‘[Int]’
@@ 36,17 +36,17 @@ FrozenErrorTests.hs:45:15:
Couldn't match type ‘T2 c c’ with ‘M (T2 (T2 c c) c)’
Expected type: T2 (M (T2 (T2 c c) c)) (T2 (T2 c c) c)
Actual type: F (T2 (T2 c c) c) Bool
 Relevant bindings include
 test4 :: T2 (T2 c c) c (bound at FrozenErrorTests.hs:45:1)
In the first argument of ‘goo4’, namely ‘(goo3 False undefined)’
In the expression: goo4 (goo3 False undefined)
In an equation for ‘test4’: test4 = goo4 (goo3 False undefined)
+ Relevant bindings include
+ test4 :: T2 (T2 c c) c (bound at FrozenErrorTests.hs:45:1)
FrozenErrorTests.hs:46:9:
Couldn't match type ‘T2 c c’ with ‘M (T2 (T2 c c) c)’
Expected type: T2 (M (T2 (T2 c c) c)) (T2 (T2 c c) c)
Actual type: F (T2 (T2 c c) c) Bool
 Relevant bindings include
 test5 :: T2 (T2 c c) c (bound at FrozenErrorTests.hs:46:1)
In the expression: goo3 False (goo4 undefined)
In an equation for ‘test5’: test5 = goo3 False (goo4 undefined)
+ Relevant bindings include
+ test5 :: T2 (T2 c c) c (bound at FrozenErrorTests.hs:46:1)
diff git a/testsuite/tests/typecheck/should_fail/T10285.stderr b/testsuite/tests/typecheck/should_fail/T10285.stderr
index 8a13daeae2..d14bc3b427 100644
 a/testsuite/tests/typecheck/should_fail/T10285.stderr
+++ b/testsuite/tests/typecheck/should_fail/T10285.stderr
@@ 14,7 +14,7 @@ T10285.hs:8:17: error:
‘b’ is a rigid type variable bound by
the type signature for: oops :: Coercion (N a) (N b) > a > b
at T10285.hs:7:9
 Relevant bindings include
 oops :: Coercion (N a) (N b) > a > b (bound at T10285.hs:8:1)
In the expression: coerce
In an equation for ‘oops’: oops Coercion = coerce
+ Relevant bindings include
+ oops :: Coercion (N a) (N b) > a > b (bound at T10285.hs:8:1)
diff git a/testsuite/tests/typecheck/should_fail/T10495.stderr b/testsuite/tests/typecheck/should_fail/T10495.stderr
index eec1cdb7c0..ee2060017e 100644
 a/testsuite/tests/typecheck/should_fail/T10495.stderr
+++ b/testsuite/tests/typecheck/should_fail/T10495.stderr
@@ 2,6 +2,6 @@
T10495.hs:5:7: error:
Couldn't match representation of type ‘a0’ with that of ‘b0’
arising from a use of ‘coerce’
 Relevant bindings include foo :: a0 > b0 (bound at T10495.hs:5:1)
In the expression: coerce
In an equation for ‘foo’: foo = coerce
+ Relevant bindings include foo :: a0 > b0 (bound at T10495.hs:5:1)
diff git a/testsuite/tests/typecheck/should_fail/T10534.stderr b/testsuite/tests/typecheck/should_fail/T10534.stderr
index 5bb0e40097..41deac7063 100644
 a/testsuite/tests/typecheck/should_fail/T10534.stderr
+++ b/testsuite/tests/typecheck/should_fail/T10534.stderr
@@ 11,7 +11,7 @@ T10534a.hs:10:9: error:
‘b’ is a rigid type variable bound by
the type signature for: silly :: Coercible (DF a) (DF b) => a > b
at T10534a.hs:9:10
 Relevant bindings include
 silly :: a > b (bound at T10534a.hs:10:1)
In the expression: coerce
In an equation for ‘silly’: silly = coerce
+ Relevant bindings include
+ silly :: a > b (bound at T10534a.hs:10:1)
diff git a/testsuite/tests/typecheck/should_fail/T10715b.stderr b/testsuite/tests/typecheck/should_fail/T10715b.stderr
index 47c85bb145..8c7f370273 100644
 a/testsuite/tests/typecheck/should_fail/T10715b.stderr
+++ b/testsuite/tests/typecheck/should_fail/T10715b.stderr
@@ 2,7 +2,7 @@
T10715b.hs:7:7: error:
Occurs check: cannot construct the infinite type: b ~ [b]
arising from a use of ‘coerce’
 Relevant bindings include foo :: [b] > b (bound at T10715b.hs:7:1)
In the first argument of ‘asTypeOf’, namely ‘coerce’
In the expression: coerce `asTypeOf` head
In an equation for ‘foo’: foo = coerce `asTypeOf` head
+ Relevant bindings include foo :: [b] > b (bound at T10715b.hs:7:1)
diff git a/testsuite/tests/typecheck/should_fail/T1899.stderr b/testsuite/tests/typecheck/should_fail/T1899.stderr
index 1702afcafc..d41c96a787 100644
 a/testsuite/tests/typecheck/should_fail/T1899.stderr
+++ b/testsuite/tests/typecheck/should_fail/T1899.stderr
@@ 6,8 +6,8 @@ T1899.hs:14:36: error:
at T1899.hs:9:14
Expected type: [Proposition a0]
Actual type: [a]
+ In the first argument of ‘Auxiliary’, namely ‘varSet’
+ In the first argument of ‘Prop’, namely ‘(Auxiliary varSet)’
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/T2534.stderr b/testsuite/tests/typecheck/should_fail/T2534.stderr
index 157521f953..fe6abae7b8 100644
 a/testsuite/tests/typecheck/should_fail/T2534.stderr
+++ b/testsuite/tests/typecheck/should_fail/T2534.stderr
@@ 3,6 +3,6 @@ T2534.hs:3:13:
Couldn't match type ‘[b]’ with ‘a0 > [b]’
Expected type: [a0] > [b] > [b]
Actual type: [a0] > (a0 > [b]) > [b]
 Relevant bindings include foo :: [b] (bound at T2534.hs:3:1)
In the first argument of ‘foldr’, namely ‘(>>=)’
In the expression: foldr (>>=) [] []
+ Relevant bindings include foo :: [b] (bound at T2534.hs:3:1)
diff git a/testsuite/tests/typecheck/should_fail/T2688.stderr b/testsuite/tests/typecheck/should_fail/T2688.stderr
index 4b28d7da31..1915c41812 100644
 a/testsuite/tests/typecheck/should_fail/T2688.stderr
+++ b/testsuite/tests/typecheck/should_fail/T2688.stderr
@@ 5,9 +5,9 @@ T2688.hs:8:22:
the class declaration for ‘VectorSpace’ at T2688.hs:5:21
‘v’ is a rigid type variable bound by
the class declaration for ‘VectorSpace’ at T2688.hs:5:19
+ In the second argument of ‘(/)’, namely ‘s’
+ In the second argument of ‘(*^)’, namely ‘(1 / s)’
Relevant bindings include
s :: s (bound at T2688.hs:8:10)
v :: v (bound at T2688.hs:8:5)
(^/) :: v > s > v (bound at T2688.hs:8:5)
 In the second argument of ‘(/)’, namely ‘s’
 In the second argument of ‘(*^)’, namely ‘(1 / s)’
diff git a/testsuite/tests/typecheck/should_fail/T2714.stderr b/testsuite/tests/typecheck/should_fail/T2714.stderr
index 65aa78cd90..07a925cc10 100644
 a/testsuite/tests/typecheck/should_fail/T2714.stderr
+++ b/testsuite/tests/typecheck/should_fail/T2714.stderr
@@ 6,10 +6,10 @@ T2714.hs:8:5:
at T2714.hs:7:6
Expected type: ((a > b) > b) > c > a
Actual type: ((a > b) > b) > f0 (a > b) > f0 b
 Relevant bindings include
 f :: ((a > b) > b) > forall c. c > a (bound at T2714.hs:8:1)
In the expression: ffmap
In an equation for ‘f’: f = ffmap
+ Relevant bindings include
+ f :: ((a > b) > b) > forall c. c > a (bound at T2714.hs:8:1)
T2714.hs:8:5:
Couldn't match type ‘c’ with ‘f0 (a > b)’
@@ 18,7 +18,7 @@ T2714.hs:8:5:
at T2714.hs:8:1
Expected type: ((a > b) > b) > c > a
Actual type: ((a > b) > b) > f0 (a > b) > f0 b
 Relevant bindings include
 f :: ((a > b) > b) > forall c. c > a (bound at T2714.hs:8:1)
In the expression: ffmap
In an equation for ‘f’: f = ffmap
+ Relevant bindings include
+ f :: ((a > b) > b) > forall c. c > a (bound at T2714.hs:8:1)
diff git a/testsuite/tests/typecheck/should_fail/T3950.stderr b/testsuite/tests/typecheck/should_fail/T3950.stderr
index 7b4837c8b9..1771e2f5e4 100644
 a/testsuite/tests/typecheck/should_fail/T3950.stderr
+++ b/testsuite/tests/typecheck/should_fail/T3950.stderr
@@ 6,7 +6,7 @@ T3950.hs:15:13:
Sealed :: (* > *) > *
Expected type: w (Id p)
Actual type: Sealed (Id p0 x0)
 Relevant bindings include
 rp :: Bool > Maybe (w (Id p)) (bound at T3950.hs:15:1)
In the first argument of ‘Just’, namely ‘rp'’
In the expression: Just rp'
+ Relevant bindings include
+ rp :: Bool > Maybe (w (Id p)) (bound at T3950.hs:15:1)
diff git a/testsuite/tests/typecheck/should_fail/T5689.stderr b/testsuite/tests/typecheck/should_fail/T5689.stderr
index f8294f4705..6e3777d2ee 100644
 a/testsuite/tests/typecheck/should_fail/T5689.stderr
+++ b/testsuite/tests/typecheck/should_fail/T5689.stderr
@@ 1,8 +1,8 @@
T5689.hs:10:36: error:
Couldn't match expected type ‘Bool’ with actual type ‘t’
+ In the expression: v
+ In the expression: if v then False else True
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
diff git a/testsuite/tests/typecheck/should_fail/T5853.stderr b/testsuite/tests/typecheck/should_fail/T5853.stderr
index 2d5c90284b..231d57dcdd 100644
 a/testsuite/tests/typecheck/should_fail/T5853.stderr
+++ b/testsuite/tests/typecheck/should_fail/T5853.stderr
@@ 10,9 +10,9 @@ T5853.hs:15:52: error:
bound by the RULE "map/map" at T5853.hs:15:257
‘t2’ is a rigid type variable bound by
the RULE "map/map" at T5853.hs:15:2
+ In the expression: (f . g) <$> xs
+ When checking the transformation rule "map/map"
Relevant bindings include
f :: Elem t > Elem t2 (bound at T5853.hs:15:19)
g :: Elem t1 > Elem t (bound at T5853.hs:15:21)
xs :: t1 (bound at T5853.hs:15:23)
 In the expression: (f . g) <$> xs
 When checking the transformation rule "map/map"
diff git a/testsuite/tests/typecheck/should_fail/T7264.stderr b/testsuite/tests/typecheck/should_fail/T7264.stderr
index b2696d41bb..4b5b3557d9 100644
 a/testsuite/tests/typecheck/should_fail/T7264.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7264.stderr
@@ 5,8 +5,8 @@ T7264.hs:13:19:
the inferred type of mkFoo2 :: a > Maybe Foo at T7264.hs:13:1
Expected type: a > Foo
Actual type: (forall r. r > String) > Foo
+ In the first argument of ‘mmap’, namely ‘Foo’
+ In the expression: mmap Foo (Just val)
Relevant bindings include
val :: a (bound at T7264.hs:13:8)
mkFoo2 :: a > Maybe Foo (bound at T7264.hs:13:1)
 In the first argument of ‘mmap’, namely ‘Foo’
 In the expression: mmap Foo (Just val)
diff git a/testsuite/tests/typecheck/should_fail/T7368a.stderr b/testsuite/tests/typecheck/should_fail/T7368a.stderr
index 7ee59e129e..a4f796ce6f 100644
 a/testsuite/tests/typecheck/should_fail/T7368a.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7368a.stderr
@@ 6,7 +6,7 @@ T7368a.hs:8:6: error:
Bad :: (* > *) > *
Expected type: f (Bad f)
Actual type: Bad t0
 Relevant bindings include
 fun :: f (Bad f) > Bool (bound at T7368a.hs:8:1)
In the pattern: Bad x
In an equation for ‘fun’: fun (Bad x) = True
+ Relevant bindings include
+ fun :: f (Bad f) > Bool (bound at T7368a.hs:8:1)
diff git a/testsuite/tests/typecheck/should_fail/T7453.stderr b/testsuite/tests/typecheck/should_fail/T7453.stderr
index 0a0f73d47e..4ca1218772 100644
 a/testsuite/tests/typecheck/should_fail/T7453.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7453.stderr
@@ 5,13 +5,13 @@ T7453.hs:10:30: error:
This (rigid, skolem) type variable is bound by
the type signature for: z :: Id t1
at T7453.hs:8:1619
+ In the first argument of ‘Id’, namely ‘v’
+ In the expression: Id v
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’
@@ 19,13 +19,13 @@ T7453.hs:16:33: error:
This (rigid, skolem) type variable is bound by
the type signature for: z :: () > t2
at T7453.hs:14:1622
+ In the first argument of ‘const’, namely ‘v’
+ In the expression: const v
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’
@@ 33,13 +33,13 @@ T7453.hs:21:15: error:
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
+ 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)
diff git a/testsuite/tests/typecheck/should_fail/T7696.stderr b/testsuite/tests/typecheck/should_fail/T7696.stderr
index 1fc2e43755..73da26c4f4 100644
 a/testsuite/tests/typecheck/should_fail/T7696.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7696.stderr
@@ 6,6 +6,6 @@ T7696.hs:7:6: error:
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
+ Relevant bindings include f2 :: ((), w ()) (bound at T7696.hs:7:1)
diff git a/testsuite/tests/typecheck/should_fail/T7734.stderr b/testsuite/tests/typecheck/should_fail/T7734.stderr
index 3f59340441..9cd71add8d 100644
 a/testsuite/tests/typecheck/should_fail/T7734.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7734.stderr
@@ 1,16 +1,16 @@
T7734.hs:4:13:
Occurs check: cannot construct the infinite type: t2 ~ t2 > t1
+ In the first argument of ‘x’, namely ‘x’
+ In the expression: x x
Relevant bindings include
x :: t2 > t1 (bound at T7734.hs:4:1)
f :: (t2 > t1) > t > t1 (bound at T7734.hs:4:1)
 In the first argument of ‘x’, namely ‘x’
 In the expression: x x
T7734.hs:5:13:
Occurs check: cannot construct the infinite type: t2 ~ t2 > t1
+ In the first argument of ‘x’, namely ‘x’
+ In the expression: x x
Relevant bindings include
x :: t2 > t1 (bound at T7734.hs:5:5)
(&) :: (t2 > t1) > t > t1 (bound at T7734.hs:5:1)
 In the first argument of ‘x’, namely ‘x’
 In the expression: x x
diff git a/testsuite/tests/typecheck/should_fail/T7748a.stderr b/testsuite/tests/typecheck/should_fail/T7748a.stderr
index a8e2921a92..5e546b171a 100644
 a/testsuite/tests/typecheck/should_fail/T7748a.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7748a.stderr
@@ 4,11 +4,6 @@ T7748a.hs:16:24:
with actual type ‘Maybe (Maybe (r > ()))’
‘a’ is a rigid type variable bound by
the type signature for: test :: a > r > () at T7748a.hs:11:9
 Relevant bindings include
 g :: r > () (bound at T7748a.hs:13:16)
 f :: r > () (bound at T7748a.hs:13:8)
 zd :: a (bound at T7748a.hs:12:6)
 test :: a > r > () (bound at T7748a.hs:12:1)
In the pattern: Just (Just p)
In a case alternative: Just (Just p) > p
In the expression:
@@ 16,3 +11,8 @@ T7748a.hs:16:24:
Nothing > const ()
Just Nothing > const ()
Just (Just p) > p }
+ Relevant bindings include
+ g :: r > () (bound at T7748a.hs:13:16)
+ f :: r > () (bound at T7748a.hs:13:8)
+ zd :: a (bound at T7748a.hs:12:6)
+ test :: a > r > () (bound at T7748a.hs:12:1)
diff git a/testsuite/tests/typecheck/should_fail/T7869.stderr b/testsuite/tests/typecheck/should_fail/T7869.stderr
index dd3aabc464..74a483602d 100644
 a/testsuite/tests/typecheck/should_fail/T7869.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7869.stderr
@@ 7,12 +7,12 @@ T7869.hs:3:12:
at T7869.hs:3:527
Expected type: [a1] > b1
Actual type: [a] > b
 Relevant bindings include
 x :: [a1] (bound at T7869.hs:3:7)
 f :: [a] > b (bound at T7869.hs:3:1)
In the expression: f x
In the expression: (\ x > f x) :: [a] > b
In an equation for ‘f’: f = (\ x > f x) :: [a] > b
+ Relevant bindings include
+ x :: [a1] (bound at T7869.hs:3:7)
+ f :: [a] > b (bound at T7869.hs:3:1)
T7869.hs:3:12:
Couldn't match type ‘b’ with ‘b1’
@@ 22,7 +22,7 @@ T7869.hs:3:12:
at T7869.hs:3:527
Expected type: [a1] > b1
Actual type: [a] > b
 Relevant bindings include f :: [a] > b (bound at T7869.hs:3:1)
In the expression: f x
In the expression: (\ x > f x) :: [a] > b
In an equation for ‘f’: f = (\ x > f x) :: [a] > b
+ Relevant bindings include f :: [a] > b (bound at T7869.hs:3:1)
diff git a/testsuite/tests/typecheck/should_fail/T8044.stderr b/testsuite/tests/typecheck/should_fail/T8044.stderr
index 6178ea3d47..78ef035af8 100644
 a/testsuite/tests/typecheck/should_fail/T8044.stderr
+++ b/testsuite/tests/typecheck/should_fail/T8044.stderr
@@ 3,7 +3,7 @@ T8044.hs:16:13:
Couldn't match type ‘Frob a’ with ‘Char’
Expected type: X (Frob a)
Actual type: X Char
 Relevant bindings include
 frob :: X a > X (Frob a) (bound at T8044.hs:15:1)
In the expression: XChar
In an equation for ‘frob’: frob _ = XChar
+ Relevant bindings include
+ frob :: X a > X (Frob a) (bound at T8044.hs:15:1)
diff git a/testsuite/tests/typecheck/should_fail/T8142.stderr b/testsuite/tests/typecheck/should_fail/T8142.stderr
index 43a3a46be0..93b2bf4914 100644
 a/testsuite/tests/typecheck/should_fail/T8142.stderr
+++ b/testsuite/tests/typecheck/should_fail/T8142.stderr
@@ 18,7 +18,7 @@ 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 ((,) 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
+ Relevant bindings include
+ h :: Nu ((,) t) > Nu g (bound at T8142.hs:6:18)
diff git a/testsuite/tests/typecheck/should_fail/T8262.stderr b/testsuite/tests/typecheck/should_fail/T8262.stderr
index 5d77a6cb4a..b6f7ef7711 100644
 a/testsuite/tests/typecheck/should_fail/T8262.stderr
+++ b/testsuite/tests/typecheck/should_fail/T8262.stderr
@@ 4,8 +4,8 @@ T8262.hs:5:15: error:
When matching types
a :: *
Int# :: #
 Relevant bindings include
 foo :: t > Maybe a (bound at T8262.hs:5:1)
In the first argument of ‘Just’, namely ‘(1#)’
In the expression: Just (1#)
In an equation for ‘foo’: foo x = Just (1#)
+ Relevant bindings include
+ foo :: t > Maybe a (bound at T8262.hs:5:1)
diff git a/testsuite/tests/typecheck/should_fail/T8428.stderr b/testsuite/tests/typecheck/should_fail/T8428.stderr
index 49c20a5b8f..cb4724331c 100644
 a/testsuite/tests/typecheck/should_fail/T8428.stderr
+++ b/testsuite/tests/typecheck/should_fail/T8428.stderr
@@ 3,8 +3,8 @@ T8428.hs:11:19:
Couldn't match type ‘(forall s. ST s) a’ with ‘forall s. ST s a’
Expected type: IdentityT (forall s. ST s) a > forall s. ST s a
Actual type: IdentityT (forall s. ST s) a > (forall s. ST s) a
+ In the second argument of ‘(.)’, namely ‘runIdentityT’
+ In the expression: runST . runIdentityT
Relevant bindings include
runIdST :: IdentityT (forall s. ST s) a > a
(bound at T8428.hs:11:1)
 In the second argument of ‘(.)’, namely ‘runIdentityT’
 In the expression: runST . runIdentityT
diff git a/testsuite/tests/typecheck/should_fail/T8450.stderr b/testsuite/tests/typecheck/should_fail/T8450.stderr
index 1416f2aec2..9cc70fa0df 100644
 a/testsuite/tests/typecheck/should_fail/T8450.stderr
+++ b/testsuite/tests/typecheck/should_fail/T8450.stderr
@@ 3,7 +3,7 @@ T8450.hs:8:7:
Couldn't match expected type ‘a’ with actual type ‘()’
‘a’ is a rigid type variable bound by
the type signature for: run :: a at T8450.hs:7:15
 Relevant bindings include run :: a (bound at T8450.hs:8:1)
In the expression: runEffect $ (undefined :: Either a ())
In an equation for ‘run’:
run = runEffect $ (undefined :: Either a ())
+ Relevant bindings include run :: a (bound at T8450.hs:8:1)
diff git a/testsuite/tests/typecheck/should_fail/T9109.stderr b/testsuite/tests/typecheck/should_fail/T9109.stderr
index 1c7e6e5c09..afd77c4f81 100644
 a/testsuite/tests/typecheck/should_fail/T9109.stderr
+++ b/testsuite/tests/typecheck/should_fail/T9109.stderr
@@ 9,6 +9,6 @@ T9109.hs:8:13:
‘t’ is a rigid type variable bound by
the inferred type of foo :: G t1 > t at T9109.hs:8:1
Possible fix: add a type signature for ‘foo’
 Relevant bindings include foo :: G t1 > t (bound at T9109.hs:8:1)
In the expression: True
In an equation for ‘foo’: foo GBool = True
+ Relevant bindings include foo :: G t1 > t (bound at T9109.hs:8:1)
diff git a/testsuite/tests/typecheck/should_fail/T9497d.stderr b/testsuite/tests/typecheck/should_fail/T9497d.stderr
index 7838120ad6..1e99f97ea1 100644
 a/testsuite/tests/typecheck/should_fail/T9497d.stderr
+++ b/testsuite/tests/typecheck/should_fail/T9497d.stderr
@@ 2,6 +2,6 @@
T9497d.hs:2:8: error:
Found hole: _main :: IO ()
Or perhaps ‘_main’ is misspelled, or not in scope
 Relevant bindings include main :: IO () (bound at T9497d.hs:2:1)
In the expression: _main
In an equation for ‘main’: main = _main
+ Relevant bindings include main :: IO () (bound at T9497d.hs:2:1)
diff git a/testsuite/tests/typecheck/should_fail/T9605.stderr b/testsuite/tests/typecheck/should_fail/T9605.stderr
index 4ba1d33382..479899c20f 100644
 a/testsuite/tests/typecheck/should_fail/T9605.stderr
+++ b/testsuite/tests/typecheck/should_fail/T9605.stderr
@@ 3,9 +3,9 @@ T9605.hs:7:6:
Couldn't match type ‘Bool’ with ‘m Bool’
Expected type: t0 > m Bool
Actual type: t0 > Bool
 Relevant bindings include f2 :: m Bool (bound at T9605.hs:7:1)
The function ‘f1’ is applied to one argument,
its type is ‘m0 Bool’,
it is specialized to ‘t0 > Bool’
In the expression: f1 undefined
In an equation for ‘f2’: f2 = f1 undefined
+ Relevant bindings include f2 :: m Bool (bound at T9605.hs:7:1)
diff git a/testsuite/tests/typecheck/should_fail/T9612.stderr b/testsuite/tests/typecheck/should_fail/T9612.stderr
index bffceb0baa..b5e6023664 100644
 a/testsuite/tests/typecheck/should_fail/T9612.stderr
+++ b/testsuite/tests/typecheck/should_fail/T9612.stderr
@@ 5,11 +5,6 @@ T9612.hs:16:9: error:
constraint ‘MonadWriter (Int, a) (WriterT [(Int, a)] Identity)’
arising from a use of ‘tell’
instance ‘MonadWriter w (WriterT w m)’ at T9612.hs:20:1059
 Relevant bindings include
 x :: a (bound at T9612.hs:14:8)
 y :: a (bound at T9612.hs:14:3)
 f :: a > (Int, a) > Writer [(Int, a)] (Int, a)
 (bound at T9612.hs:14:1)
In a stmt of a 'do' block: tell (n, x)
In the expression:
do { tell (n, x);
@@ 18,3 +13,8 @@ T9612.hs:16:9: error:
f y (n, x)
= do { tell (n, x);
return (1, y) }
+ Relevant bindings include
+ x :: a (bound at T9612.hs:14:8)
+ y :: a (bound at T9612.hs:14:3)
+ f :: a > (Int, a) > Writer [(Int, a)] (Int, a)
+ (bound at T9612.hs:14:1)
diff git a/testsuite/tests/typecheck/should_fail/TcCoercibleFail.stderr b/testsuite/tests/typecheck/should_fail/TcCoercibleFail.stderr
index e41d8c1b10..c97acc25a7 100644
 a/testsuite/tests/typecheck/should_fail/TcCoercibleFail.stderr
+++ b/testsuite/tests/typecheck/should_fail/TcCoercibleFail.stderr
@@ 11,11 +11,11 @@ TcCoercibleFail.hs:14:8: error:
arising from a use of ‘coerce’
NB: We cannot know what roles the parameters to ‘m’ have;
we must assume that the role is nominal
 Relevant bindings include
 foo2 :: m Age (bound at TcCoercibleFail.hs:14:1)
In the expression: coerce
In the expression: coerce $ (return one :: m Int)
In an equation for ‘foo2’: foo2 = coerce $ (return one :: m Int)
+ Relevant bindings include
+ foo2 :: m Age (bound at TcCoercibleFail.hs:14:1)
TcCoercibleFail.hs:16:8: error:
Couldn't match type ‘Int’ with ‘Age’ arising from a use of ‘coerce’
diff git a/testsuite/tests/typecheck/should_fail/mc22.stderr b/testsuite/tests/typecheck/should_fail/mc22.stderr
index 9501f93b97..aab0c1bdc3 100644
 a/testsuite/tests/typecheck/should_fail/mc22.stderr
+++ b/testsuite/tests/typecheck/should_fail/mc22.stderr
@@ 16,6 +16,6 @@ mc22.hs:10:26:
a type expected by the context: [a] > [t a] at mc22.hs:9:9
Expected type: [a] > [t a]
Actual type: [t a] > [t a]
 Relevant bindings include foo :: [t [Char]] (bound at mc22.hs:8:1)
In the expression: take 5
In a stmt of a monad comprehension: then group using take 5
+ Relevant bindings include foo :: [t [Char]] (bound at mc22.hs:8:1)
diff git a/testsuite/tests/typecheck/should_fail/mc23.stderr b/testsuite/tests/typecheck/should_fail/mc23.stderr
index 9f4a467a9d..945d1a6db8 100644
 a/testsuite/tests/typecheck/should_fail/mc23.stderr
+++ b/testsuite/tests/typecheck/should_fail/mc23.stderr
@@ 3,7 +3,7 @@ mc23.hs:9:29:
Couldn't match type ‘[a0]’ with ‘[a] > m a’
Expected type: (a > b) > [a] > m a
Actual type: [a0] > [a0]
 Relevant bindings include z :: m b (bound at mc23.hs:9:1)
Possible cause: ‘take’ is applied to too many arguments
In the expression: take 5
In a stmt of a monad comprehension: then take 5 by x
+ Relevant bindings include z :: m b (bound at mc23.hs:9:1)
diff git a/testsuite/tests/typecheck/should_fail/mc24.stderr b/testsuite/tests/typecheck/should_fail/mc24.stderr
index 3260edbcb7..b14fd81162 100644
 a/testsuite/tests/typecheck/should_fail/mc24.stderr
+++ b/testsuite/tests/typecheck/should_fail/mc24.stderr
@@ 3,7 +3,7 @@ mc24.hs:10:31:
Couldn't match type ‘[a0]’ with ‘[a] > m [a]’
Expected type: (a > Integer) > [a] > m [a]
Actual type: [a0] > [a0]
 Relevant bindings include foo :: m Int (bound at mc24.hs:8:1)
Possible cause: ‘take’ is applied to too many arguments
In the expression: take 2
In a stmt of a monad comprehension: then group by x using take 2
+ Relevant bindings include foo :: m Int (bound at mc24.hs:8:1)
diff git a/testsuite/tests/typecheck/should_fail/mc25.stderr b/testsuite/tests/typecheck/should_fail/mc25.stderr
index ec88439e89..0989dbcf70 100644
 a/testsuite/tests/typecheck/should_fail/mc25.stderr
+++ b/testsuite/tests/typecheck/should_fail/mc25.stderr
@@ 13,6 +13,6 @@ 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]
 Relevant bindings include z :: [t1 t] (bound at mc25.hs:9:1)
In the expression: take
In a stmt of a monad comprehension: then group by x using take
+ Relevant bindings include z :: [t1 t] (bound at mc25.hs:9:1)
diff git a/testsuite/tests/typecheck/should_fail/tcfail001.stderr b/testsuite/tests/typecheck/should_fail/tcfail001.stderr
index 3c67882546..b30d995455 100644
 a/testsuite/tests/typecheck/should_fail/tcfail001.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail001.stderr
@@ 1,7 +1,7 @@
tcfail001.hs:9:2:
Couldn't match expected type ‘[t0] > [t1]’ with actual type ‘[a]’
 Relevant bindings include op :: [a] (bound at tcfail001.hs:9:2)
The equation(s) for ‘op’ have one argument,
but its type ‘[a]’ has none
In the instance declaration for ‘A [a]’
+ Relevant bindings include op :: [a] (bound at tcfail001.hs:9:2)
diff git a/testsuite/tests/typecheck/should_fail/tcfail002.stderr b/testsuite/tests/typecheck/should_fail/tcfail002.stderr
index 11e8078a1b..4017239930 100644
 a/testsuite/tests/typecheck/should_fail/tcfail002.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail002.stderr
@@ 1,8 +1,8 @@
tcfail002.hs:4:7:
Occurs check: cannot construct the infinite type: t ~ [t]
+ In the expression: z
+ In an equation for ‘c’: c z = z
Relevant bindings include
z :: [t] (bound at tcfail002.hs:4:3)
c :: [t] > t (bound at tcfail002.hs:3:1)
 In the expression: z
 In an equation for ‘c’: c z = z
diff git a/testsuite/tests/typecheck/should_fail/tcfail004.stderr b/testsuite/tests/typecheck/should_fail/tcfail004.stderr
index 48840e7298..9c51edc5b2 100644
 a/testsuite/tests/typecheck/should_fail/tcfail004.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail004.stderr
@@ 2,8 +2,8 @@
tcfail004.hs:3:9:
Couldn't match expected type ‘(t, t1)’
with actual type ‘(Integer, Integer, Integer)’
+ In the expression: (1, 2, 3)
+ In a pattern binding: (f, g) = (1, 2, 3)
Relevant bindings include
f :: t (bound at tcfail004.hs:3:2)
g :: t1 (bound at tcfail004.hs:3:4)
 In the expression: (1, 2, 3)
 In a pattern binding: (f, g) = (1, 2, 3)
diff git a/testsuite/tests/typecheck/should_fail/tcfail005.stderr b/testsuite/tests/typecheck/should_fail/tcfail005.stderr
index 36f0e738e4..c9d3360243 100644
 a/testsuite/tests/typecheck/should_fail/tcfail005.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail005.stderr
@@ 2,8 +2,8 @@
tcfail005.hs:3:9:
Couldn't match expected type ‘[t]’
with actual type ‘(Integer, Char)’
+ In the expression: (1, 'a')
+ In a pattern binding: (h : i) = (1, 'a')
Relevant bindings include
h :: t (bound at tcfail005.hs:3:2)
i :: [t] (bound at tcfail005.hs:3:4)
 In the expression: (1, 'a')
 In a pattern binding: (h : i) = (1, 'a')
diff git a/testsuite/tests/typecheck/should_fail/tcfail013.stderr b/testsuite/tests/typecheck/should_fail/tcfail013.stderr
index bf567acc2b..2f200abcce 100644
 a/testsuite/tests/typecheck/should_fail/tcfail013.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail013.stderr
@@ 1,6 +1,6 @@
tcfail013.hs:4:3:
Couldn't match expected type ‘[t]’ with actual type ‘Bool’
 Relevant bindings include f :: [t] > a (bound at tcfail013.hs:3:1)
In the pattern: True
In an equation for ‘f’: f True = 2
+ Relevant bindings include f :: [t] > a (bound at tcfail013.hs:3:1)
diff git a/testsuite/tests/typecheck/should_fail/tcfail014.stderr b/testsuite/tests/typecheck/should_fail/tcfail014.stderr
index d133863e34..bf28aa76b7 100644
 a/testsuite/tests/typecheck/should_fail/tcfail014.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail014.stderr
@@ 1,8 +1,8 @@
tcfail014.hs:5:33:
Occurs check: cannot construct the infinite type: t8 ~ t8 > t7
+ In the first argument of ‘z’, namely ‘z’
+ In the expression: z z
Relevant bindings include
z :: t8 > t7 (bound at tcfail014.hs:5:27)
h :: (t8 > t7) > t7 (bound at tcfail014.hs:5:25)
 In the first argument of ‘z’, namely ‘z’
 In the expression: z z
diff git a/testsuite/tests/typecheck/should_fail/tcfail016.stderr b/testsuite/tests/typecheck/should_fail/tcfail016.stderr
index 4180007122..59c8fa4e3d 100644
 a/testsuite/tests/typecheck/should_fail/tcfail016.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail016.stderr
@@ 3,20 +3,20 @@ tcfail016.hs:9:20:
Couldn't match type ‘(t, Expr t)’ with ‘Expr t’
Expected type: Expr t
Actual type: AnnExpr t
+ In the first argument of ‘g’, namely ‘e1’
+ In the first argument of ‘(++)’, namely ‘(g e1)’
Relevant bindings include
e2 :: AnnExpr t (bound at tcfail016.hs:9:11)
e1 :: AnnExpr t (bound at tcfail016.hs:9:8)
g :: Expr t > [[Char]] (bound at tcfail016.hs:8:1)
 In the first argument of ‘g’, namely ‘e1’
 In the first argument of ‘(++)’, namely ‘(g e1)’
tcfail016.hs:9:28:
Couldn't match type ‘(t, Expr t)’ with ‘Expr t’
Expected type: Expr t
Actual type: AnnExpr t
+ In the first argument of ‘g’, namely ‘e2’
+ In the second argument of ‘(++)’, namely ‘(g e2)’
Relevant bindings include
e2 :: AnnExpr t (bound at tcfail016.hs:9:11)
e1 :: AnnExpr t (bound at tcfail016.hs:9:8)
g :: Expr t > [[Char]] (bound at tcfail016.hs:8:1)
 In the first argument of ‘g’, namely ‘e2’
 In the second argument of ‘(++)’, namely ‘(g e2)’
diff git a/testsuite/tests/typecheck/should_fail/tcfail032.stderr b/testsuite/tests/typecheck/should_fail/tcfail032.stderr
index 4d41c103da..90888af1b2 100644
 a/testsuite/tests/typecheck/should_fail/tcfail032.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail032.stderr
@@ 5,8 +5,8 @@ tcfail032.hs:14:8:
This (rigid, skolem) type variable is bound by
an expression type signature: Eq a1 => a1 > Int
at tcfail032.hs:14:830
+ In the expression: (x :: (Eq a) => a > Int)
+ In an equation for ‘f’: f x = (x :: (Eq a) => a > Int)
Relevant bindings include
x :: t (bound at tcfail032.hs:14:3)
f :: t > a > Int (bound at tcfail032.hs:14:1)
 In the expression: (x :: (Eq a) => a > Int)
 In an equation for ‘f’: f x = (x :: (Eq a) => a > Int)
diff git a/testsuite/tests/typecheck/should_fail/tcfail033.stderr b/testsuite/tests/typecheck/should_fail/tcfail033.stderr
index ea517ea7b4..fd2887de60 100644
 a/testsuite/tests/typecheck/should_fail/tcfail033.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail033.stderr
@@ 1,9 +1,9 @@
tcfail033.hs:4:12:
Occurs check: cannot construct the infinite type: t ~ (t, t1)
+ In the expression: x
+ In the expression: [x  (x, y) < buglet]
Relevant bindings include
y :: t1 (bound at tcfail033.hs:4:19)
x :: t (bound at tcfail033.hs:4:17)
buglet :: [(t, t1)] (bound at tcfail033.hs:4:1)
 In the expression: x
 In the expression: [x  (x, y) < buglet]
diff git a/testsuite/tests/typecheck/should_fail/tcfail065.stderr b/testsuite/tests/typecheck/should_fail/tcfail065.stderr
index 02338415d1..ddb40dd491 100644
 a/testsuite/tests/typecheck/should_fail/tcfail065.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail065.stderr
@@ 6,8 +6,8 @@ tcfail065.hs:29:20:
at tcfail065.hs:29:3
‘x’ is a rigid type variable bound by
the instance declaration at tcfail065.hs:28:10
+ In the first argument of ‘X’, namely ‘x’
+ In the expression: X x
Relevant bindings include
x :: x1 (bound at tcfail065.hs:29:8)
setX :: x1 > X x > X x (bound at tcfail065.hs:29:3)
 In the first argument of ‘X’, namely ‘x’
 In the expression: X x
diff git a/testsuite/tests/typecheck/should_fail/tcfail068.stderr b/testsuite/tests/typecheck/should_fail/tcfail068.stderr
index d7c8ed7aba..330b1dceb0 100644
 a/testsuite/tests/typecheck/should_fail/tcfail068.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail068.stderr
@@ 10,12 +10,12 @@ tcfail068.hs:14:9:
at tcfail068.hs:11:10
Expected type: ST s1 (IndTree s a)
Actual type: ST s1 (STArray s1 (Int, Int) a)
 Relevant bindings include
 itgen :: (Int, Int) > a > IndTree s a
 (bound at tcfail068.hs:12:1)
In the first argument of ‘runST’, namely
‘(newSTArray ((1, 1), n) x)’
In the expression: runST (newSTArray ((1, 1), n) x)
+ Relevant bindings include
+ itgen :: (Int, Int) > a > IndTree s a
+ (bound at tcfail068.hs:12:1)
tcfail068.hs:19:21:
Couldn't match type ‘s’ with ‘s1’
@@ 29,12 +29,12 @@ tcfail068.hs:19:21:
at tcfail068.hs:18:9
Expected type: STArray s1 (Int, Int) a
Actual type: IndTree s a
+ In the first argument of ‘readSTArray’, namely ‘arr’
+ In the first argument of ‘(>>=)’, namely ‘readSTArray arr i’
Relevant bindings include
arr :: IndTree s a (bound at tcfail068.hs:17:11)
itiap :: (Int, Int) > (a > a) > IndTree s a > IndTree s a
(bound at tcfail068.hs:17:1)
 In the first argument of ‘readSTArray’, namely ‘arr’
 In the first argument of ‘(>>=)’, namely ‘readSTArray arr i’
tcfail068.hs:24:36:
Couldn't match type ‘s’ with ‘s1’
@@ 48,6 +48,8 @@ tcfail068.hs:24:36:
at tcfail068.hs:24:29
Expected type: ST s1 (IndTree s a)
Actual type: ST s (IndTree s a)
+ In the first argument of ‘runST’, namely ‘(itrap' i k)’
+ In the expression: runST (itrap' i k)
Relevant bindings include
itrap' :: Int > Int > ST s (IndTree s a)
(bound at tcfail068.hs:26:9)
@@ 57,8 +59,6 @@ tcfail068.hs:24:36:
itrap :: ((Int, Int), (Int, Int))
> (a > a) > IndTree s a > IndTree s a
(bound at tcfail068.hs:24:1)
 In the first argument of ‘runST’, namely ‘(itrap' i k)’
 In the expression: runST (itrap' i k)
tcfail068.hs:36:46:
Couldn't match type ‘s’ with ‘s1’
@@ 78,6 +78,8 @@ tcfail068.hs:36:46:
at tcfail068.hs:36:40
Expected type: ST s1 (c, IndTree s b)
Actual type: ST s (c, IndTree s b)
+ In the first argument of ‘runST’, namely ‘(itrapstate' i k s)’
+ In the expression: runST (itrapstate' i k s)
Relevant bindings include
itrapstate' :: Int > Int > c > ST s (c, IndTree s b)
(bound at tcfail068.hs:38:9)
@@ 92,5 +94,3 @@ tcfail068.hs:36:46:
> IndTree s b
> (c, IndTree s b)
(bound at tcfail068.hs:36:1)
 In the first argument of ‘runST’, namely ‘(itrapstate' i k s)’
 In the expression: runST (itrapstate' i k s)
diff git a/testsuite/tests/typecheck/should_fail/tcfail076.stderr b/testsuite/tests/typecheck/should_fail/tcfail076.stderr
index b5ad5cd2d6..869b9472f3 100644
 a/testsuite/tests/typecheck/should_fail/tcfail076.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail076.stderr
@@ 9,8 +9,8 @@ tcfail076.hs:18:82:
at tcfail076.hs:18:64
Expected type: m res1
Actual type: m res
+ In the expression: cont a
+ In the first argument of ‘KContT’, namely ‘(\ cont' > cont a)’
Relevant bindings include
cont' :: b > m res1 (bound at tcfail076.hs:18:73)
cont :: a > m res (bound at tcfail076.hs:18:37)
 In the expression: cont a
 In the first argument of ‘KContT’, namely ‘(\ cont' > cont a)’
diff git a/testsuite/tests/typecheck/should_fail/tcfail099.stderr b/testsuite/tests/typecheck/should_fail/tcfail099.stderr
index cb3008cf7b..9fdccb3335 100644
 a/testsuite/tests/typecheck/should_fail/tcfail099.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail099.stderr
@@ 6,9 +6,9 @@ tcfail099.hs:9:20:
a pattern with constructor: C :: forall a. (a > Int) > DS,
in an equation for ‘call’
at tcfail099.hs:9:79
+ In the first argument of ‘f’, namely ‘arg’
+ In the expression: f arg
Relevant bindings include
arg :: t (bound at tcfail099.hs:9:12)
f :: a > Int (bound at tcfail099.hs:9:9)
call :: DS > t > Int (bound at tcfail099.hs:9:1)
 In the first argument of ‘f’, namely ‘arg’
 In the expression: f arg
diff git a/testsuite/tests/typecheck/should_fail/tcfail103.stderr b/testsuite/tests/typecheck/should_fail/tcfail103.stderr
index 1b57893608..17a434f0ae 100644
 a/testsuite/tests/typecheck/should_fail/tcfail103.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail103.stderr
@@ 7,9 +7,9 @@ tcfail103.hs:15:23:
the type signature for: g :: ST s Int at tcfail103.hs:13:14
Expected type: STRef s Int
Actual type: STRef t Int
+ In the first argument of ‘readSTRef’, namely ‘v’
+ In the expression: readSTRef v
Relevant bindings include
g :: ST s Int (bound at tcfail103.hs:15:9)
v :: STRef t Int (bound at tcfail103.hs:12:5)
f :: ST t Int (bound at tcfail103.hs:11:1)
 In the first argument of ‘readSTRef’, namely ‘v’
 In the expression: readSTRef v
diff git a/testsuite/tests/typecheck/should_fail/tcfail122.stderr b/testsuite/tests/typecheck/should_fail/tcfail122.stderr
index fdd444d1fc..47b391df6d 100644
 a/testsuite/tests/typecheck/should_fail/tcfail122.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail122.stderr
@@ 6,7 +6,6 @@ tcfail122.hs:8:9: error:
a :: * > *
Expected type: a b
Actual type: c0 d0
 Relevant bindings include foo :: [a b] (bound at tcfail122.hs:7:1)
In the expression:
undefined :: forall (c :: (* > *) > *) (d :: * > *). c d
In the expression:
@@ 16,3 +15,4 @@ tcfail122.hs:8:9: error:
foo
= [undefined :: forall a b. a b,
undefined :: forall (c :: (* > *) > *) (d :: * > *). c d]
+ Relevant bindings include foo :: [a b] (bound at tcfail122.hs:7:1)
diff git a/testsuite/tests/typecheck/should_fail/tcfail131.stderr b/testsuite/tests/typecheck/should_fail/tcfail131.stderr
index cb2bd64e5b..3a209ab5e0 100644
 a/testsuite/tests/typecheck/should_fail/tcfail131.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail131.stderr
@@ 3,8 +3,8 @@ tcfail131.hs:7:9:
Couldn't match expected type ‘b’ with actual type ‘Integer’
‘b’ is a rigid type variable bound by
the type signature for: g :: Num b => b > b at tcfail131.hs:6:8
+ In the expression: f x x
+ In an equation for ‘g’: g x = f x x
Relevant bindings include
x :: b (bound at tcfail131.hs:7:5)
g :: b > b (bound at tcfail131.hs:7:3)
 In the expression: f x x
 In an equation for ‘g’: g x = f x x
diff git a/testsuite/tests/typecheck/should_fail/tcfail140.stderr b/testsuite/tests/typecheck/should_fail/tcfail140.stderr
index 6908f1d595..09eb70c588 100644
 a/testsuite/tests/typecheck/should_fail/tcfail140.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail140.stderr
@@ 1,30 +1,30 @@
tcfail140.hs:10:7: error:
Couldn't match expected type ‘Integer > t’ with actual type ‘Int’
 Relevant bindings include bar :: t (bound at tcfail140.hs:10:1)
The function ‘f’ is applied to two arguments,
but its type ‘Int > Int’ has only one
In the expression: f 3 9
In an equation for ‘bar’: bar = f 3 9
+ Relevant bindings include bar :: t (bound at tcfail140.hs:10:1)
tcfail140.hs:12:10: error:
Couldn't match expected type ‘Integer > t1’ with actual type ‘Int’
 Relevant bindings include
 rot :: t > t1 (bound at tcfail140.hs:12:1)
The operator ‘f’ takes two arguments,
but its type ‘Int > Int’ has only one
In the expression: 3 `f` 4
In an equation for ‘rot’: rot xs = 3 `f` 4
+ Relevant bindings include
+ rot :: t > t1 (bound at tcfail140.hs:12:1)
tcfail140.hs:14:15: error:
Couldn't match expected type ‘a > b’ with actual type ‘Int’
 Relevant bindings include
 xs :: [a] (bound at tcfail140.hs:14:5)
 bot :: [a] > [b] (bound at tcfail140.hs:14:1)
The operator ‘f’ takes two arguments,
but its type ‘Int > Int’ has only one
In the first argument of ‘map’, namely ‘(3 `f`)’
In the expression: map (3 `f`) xs
+ Relevant bindings include
+ xs :: [a] (bound at tcfail140.hs:14:5)
+ bot :: [a] > [b] (bound at tcfail140.hs:14:1)
tcfail140.hs:16:8: error:
The constructor ‘Just’ should have 1 argument, but has been given none
diff git a/testsuite/tests/typecheck/should_fail/tcfail153.stderr b/testsuite/tests/typecheck/should_fail/tcfail153.stderr
index aafe8a269a..ec46f782ad 100644
 a/testsuite/tests/typecheck/should_fail/tcfail153.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail153.stderr
@@ 5,12 +5,12 @@ tcfail153.hs:6:7:
the type signature for: f :: a > [a] at tcfail153.hs:5:6
Expected type: [a]
Actual type: [Bool]
 Relevant bindings include
 x :: a (bound at tcfail153.hs:6:3)
 f :: a > [a] (bound at tcfail153.hs:6:1)
In the expression: g x
In an equation for ‘f’:
f x
= g x
where
g y = if y then [] else [...]
+ Relevant bindings include
+ x :: a (bound at tcfail153.hs:6:3)
+ f :: a > [a] (bound at tcfail153.hs:6:1)
diff git a/testsuite/tests/typecheck/should_fail/tcfail174.stderr b/testsuite/tests/typecheck/should_fail/tcfail174.stderr
index 42aa7a91fa..77bc7416b5 100644
 a/testsuite/tests/typecheck/should_fail/tcfail174.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail174.stderr
@@ 13,10 +13,10 @@ tcfail174.hs:13:14:
at tcfail174.hs:13:114
Expected type: Capture (forall x. x > a)
Actual type: Capture (forall a. a > a)
 Relevant bindings include
 h1 :: Capture a (bound at tcfail174.hs:13:1)
In the first argument of ‘Capture’, namely ‘g’
In the expression: Capture g
+ Relevant bindings include
+ h1 :: Capture a (bound at tcfail174.hs:13:1)
tcfail174.hs:16:14:
Couldn't match type ‘a’ with ‘b’
@@ 26,7 +26,7 @@ tcfail174.hs:16:14:
the type signature for: h2 :: Capture b at tcfail174.hs:15:7
Expected type: Capture (forall x. x > b)
Actual type: Capture (forall a. a > a)
 Relevant bindings include
 h2 :: Capture b (bound at tcfail174.hs:16:1)
In the first argument of ‘Capture’, namely ‘g’
In the expression: Capture g
+ Relevant bindings include
+ h2 :: Capture b (bound at tcfail174.hs:16:1)
diff git a/testsuite/tests/typecheck/should_fail/tcfail175.stderr b/testsuite/tests/typecheck/should_fail/tcfail175.stderr
index 8689fd1a6c..50a2424fcc 100644
 a/testsuite/tests/typecheck/should_fail/tcfail175.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail175.stderr
@@ 4,7 +4,7 @@ tcfail175.hs:11:1:
with actual type ‘a’
‘a’ is a rigid type variable bound by
the type signature for: evalRHS :: Int > a at tcfail175.hs:10:12
 Relevant bindings include
 evalRHS :: Int > a (bound at tcfail175.hs:11:1)
The equation(s) for ‘evalRHS’ have three arguments,
but its type ‘Int > a’ has only one
+ Relevant bindings include
+ evalRHS :: Int > a (bound at tcfail175.hs:11:1)
diff git a/testsuite/tests/typecheck/should_fail/tcfail178.stderr b/testsuite/tests/typecheck/should_fail/tcfail178.stderr
index 7ed00156d6..472e133098 100644
 a/testsuite/tests/typecheck/should_fail/tcfail178.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail178.stderr
@@ 3,12 +3,12 @@ tcfail178.hs:15:7:
Couldn't match type ‘()’ with ‘[a]’
Expected type: Bool > [a]
Actual type: Bool > ()
 Relevant bindings include c :: [a] (bound at tcfail178.hs:15:1)
In the first argument of ‘a’, namely ‘y’
In the expression: a y
+ Relevant bindings include c :: [a] (bound at tcfail178.hs:15:1)
tcfail178.hs:18:7:
Couldn't match expected type ‘Bool > [a]’ with actual type ‘()’
 Relevant bindings include d :: [a] (bound at tcfail178.hs:18:1)
In the first argument of ‘a’, namely ‘()’
In the expression: a ()
+ Relevant bindings include d :: [a] (bound at tcfail178.hs:18:1)
diff git a/testsuite/tests/typecheck/should_fail/tcfail179.stderr b/testsuite/tests/typecheck/should_fail/tcfail179.stderr
index 51c66e138b..14d2eae435 100644
 a/testsuite/tests/typecheck/should_fail/tcfail179.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail179.stderr
@@ 8,10 +8,10 @@ tcfail179.hs:14:39:
at tcfail179.hs:14:14
‘s’ is a rigid type variable bound by
the type signature for: run :: T s > Int at tcfail179.hs:12:8
+ In the first argument of ‘g’, namely ‘x’
+ In the expression: g x id
Relevant bindings include
x :: x (bound at tcfail179.hs:14:26)
g :: s > (x > s) > (x, s, Int) (bound at tcfail179.hs:14:16)
ts :: T s (bound at tcfail179.hs:13:5)
run :: T s > Int (bound at tcfail179.hs:13:1)
 In the first argument of ‘g’, namely ‘x’
 In the expression: g x id
diff git a/testsuite/tests/typecheck/should_fail/tcfail182.stderr b/testsuite/tests/typecheck/should_fail/tcfail182.stderr
index 159700512a..4103c3a0fa 100644
 a/testsuite/tests/typecheck/should_fail/tcfail182.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail182.stderr
@@ 4,7 +4,7 @@ tcfail182.hs:9:3: error:
with actual type ‘Maybe t0’
NB: ‘Maybe’ is defined at tcfail182.hs:6:118
‘Prelude.Maybe’ is defined in ‘GHC.Base’ in package ‘base4.9.0.0’
 Relevant bindings include
 f :: Prelude.Maybe a > Int (bound at tcfail182.hs:9:1)
In the pattern: Foo
In an equation for ‘f’: f Foo = 3
+ Relevant bindings include
+ f :: Prelude.Maybe a > Int (bound at tcfail182.hs:9:1)
diff git a/testsuite/tests/typecheck/should_fail/tcfail198.stderr b/testsuite/tests/typecheck/should_fail/tcfail198.stderr
index ea764fc846..58cf260593 100644
 a/testsuite/tests/typecheck/should_fail/tcfail198.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail198.stderr
@@ 5,9 +5,9 @@ tcfail198.hs:6:36: error:
This (rigid, skolem) type variable is bound by
an expression type signature: a2
at tcfail198.hs:6:3641
+ In the expression: x :: a
+ In the second argument of ‘(++)’, namely ‘[x :: a]’
Relevant bindings include
xs :: [a1] (bound at tcfail198.hs:6:21)
x :: a1 (bound at tcfail198.hs:6:19)
f3 :: [a1] > [a1] (bound at tcfail198.hs:6:6)
 In the expression: x :: a
 In the second argument of ‘(++)’, namely ‘[x :: a]’
diff git a/testsuite/tests/typecheck/should_fail/tcfail200.stderr b/testsuite/tests/typecheck/should_fail/tcfail200.stderr
index e5bb82267e..7570047d0c 100644
 a/testsuite/tests/typecheck/should_fail/tcfail200.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail200.stderr
@@ 4,8 +4,8 @@ tcfail200.hs:5:15: error:
When matching types
t1 :: *
Int# :: #
 Relevant bindings include
 x :: (t1, Char) (bound at tcfail200.hs:5:9)
In the expression: 1#
In the expression: (1#, 'c')
In an equation for ‘x’: x = (1#, 'c')
+ Relevant bindings include
+ x :: (t1, Char) (bound at tcfail200.hs:5:9)
diff git a/testsuite/tests/typecheck/should_fail/tcfail201.stderr b/testsuite/tests/typecheck/should_fail/tcfail201.stderr
index 3e67742bc8..0609229ae8 100644
 a/testsuite/tests/typecheck/should_fail/tcfail201.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail201.stderr
@@ 6,10 +6,10 @@ tcfail201.hs:17:58: error:
gfoldl' :: (forall a1 b. c (a1 > b) > a1 > c b)
> (forall g. g > c g) > a > c a
at tcfail201.hs:15:12
+ In the first argument of ‘z’, namely ‘DocEmpty’
+ In the expression: z DocEmpty
Relevant bindings include
hsDoc :: a (bound at tcfail201.hs:16:13)
gfoldl' :: (forall a1 b. c (a1 > b) > a1 > c b)
> (forall g. g > c g) > a > c a
(bound at tcfail201.hs:16:1)
 In the first argument of ‘z’, namely ‘DocEmpty’
 In the expression: z DocEmpty
diff git a/testsuite/tests/typecheck/should_fail/tcfail206.stderr b/testsuite/tests/typecheck/should_fail/tcfail206.stderr
index bd3d90df57..5090ee165f 100644
 a/testsuite/tests/typecheck/should_fail/tcfail206.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail206.stderr
@@ 19,10 +19,10 @@ tcfail206.hs:11:5:
the type signature for: c :: a > (a, Bool) at tcfail206.hs:10:6
Expected type: a > (a, Bool)
Actual type: a > (a, a)
 Relevant bindings include
 c :: a > (a, Bool) (bound at tcfail206.hs:11:1)
In the expression: (True  False,)
In an equation for ‘c’: c = (True  False,)
+ Relevant bindings include
+ c :: a > (a, Bool) (bound at tcfail206.hs:11:1)
tcfail206.hs:14:5:
Couldn't match type ‘Bool’ with ‘Int’
@@ 45,7 +45,7 @@ tcfail206.hs:20:5:
the type signature for: f :: a > (# a, Bool #) at tcfail206.hs:19:6
Expected type: a > (# a, Bool #)
Actual type: a > (# a, a #)
 Relevant bindings include
 f :: a > (# a, Bool #) (bound at tcfail206.hs:20:1)
In the expression: (# True  False, #)
In an equation for ‘f’: f = (# True  False, #)
+ Relevant bindings include
+ f :: a > (# a, Bool #) (bound at tcfail206.hs:20:1)
diff git a/testsuite/tests/typecheck/should_run/T10284.stdout b/testsuite/tests/typecheck/should_run/T10284.stdout
index ea03ec8a1a..82f9518fc7 100644
 a/testsuite/tests/typecheck/should_run/T10284.stdout
+++ b/testsuite/tests/typecheck/should_run/T10284.stdout
@@ 1,5 +1,5 @@
As expected, TypeError: T10284.hs:6:5: error:
 Couldn't match expected type ‘Int’ with actual type ‘Char’
 In the expression: 'a'
 In an equation for ‘a’: a = 'a'
+ • Couldn't match expected type ‘Int’ with actual type ‘Char’
+ • In the expression: 'a'
+ In an equation for ‘a’: a = 'a'
(deferred type error)
diff git a/testsuite/tests/typecheck/should_run/T7861.stderr b/testsuite/tests/typecheck/should_run/T7861.stderr
index 8ed4be26ec..2f8ae153ba 100644
 a/testsuite/tests/typecheck/should_run/T7861.stderr
+++ b/testsuite/tests/typecheck/should_run/T7861.stderr
@@ 6,8 +6,8 @@ T7861: T7861.hs:10:5: error:
at T7861.hs:9:6
Expected type: (forall b. a) > a
Actual type: (forall b. a) > [a]
 Relevant bindings include
 f :: (forall b. a) > a (bound at T7861.hs:10:1)
In the expression: doA
In an equation for ‘f’: f = doA
+ Relevant bindings include
+ f :: (forall b. a) > a (bound at T7861.hs:10:1)
(deferred type error)
diff git a/testsuite/tests/typecheck/should_run/T9497arun.stderr b/testsuite/tests/typecheck/should_run/T9497arun.stderr
index 43f720be7e..9a7ac000ec 100644
 a/testsuite/tests/typecheck/should_run/T9497arun.stderr
+++ b/testsuite/tests/typecheck/should_run/T9497arun.stderr
@@ 1,8 +1,8 @@
T9497arun: T9497arun.hs:2:8: error:
Found hole: _main :: IO ()
Or perhaps ‘_main’ is misspelled, or not in scope
 Relevant bindings include
 main :: IO () (bound at T9497arun.hs:2:1)
In the expression: _main
In an equation for ‘main’: main = _main
+ Relevant bindings include
+ main :: IO () (bound at T9497arun.hs:2:1)
(deferred type error)
diff git a/testsuite/tests/typecheck/should_run/T9497brun.stderr b/testsuite/tests/typecheck/should_run/T9497brun.stderr
index 02fda3473c..432b5fed2c 100644
 a/testsuite/tests/typecheck/should_run/T9497brun.stderr
+++ b/testsuite/tests/typecheck/should_run/T9497brun.stderr
@@ 1,8 +1,8 @@
T9497brun: T9497brun.hs:2:8: error:
Found hole: _main :: IO ()
Or perhaps ‘_main’ is misspelled, or not in scope
 Relevant bindings include
 main :: IO () (bound at T9497brun.hs:2:1)
In the expression: _main
In an equation for ‘main’: main = _main
+ Relevant bindings include
+ main :: IO () (bound at T9497brun.hs:2:1)
(deferred type error)
diff git a/testsuite/tests/typecheck/should_run/T9497crun.stderr b/testsuite/tests/typecheck/should_run/T9497crun.stderr
index 5fe0743d6c..61d8575d2c 100644
 a/testsuite/tests/typecheck/should_run/T9497crun.stderr
+++ b/testsuite/tests/typecheck/should_run/T9497crun.stderr
@@ 1,8 +1,8 @@
T9497crun: T9497crun.hs:2:8: error:
Found hole: _main :: IO ()
Or perhaps ‘_main’ is misspelled, or not in scope
 Relevant bindings include
 main :: IO () (bound at T9497crun.hs:2:1)
In the expression: _main
In an equation for ‘main’: main = _main
+ Relevant bindings include
+ main :: IO () (bound at T9497crun.hs:2:1)
(deferred type error)
diff git a/testsuite/tests/typecheck/should_run/tcrun035.stderr b/testsuite/tests/typecheck/should_run/tcrun035.stderr
index 2eed11d2f3..c72ef618ab 100644
 a/testsuite/tests/typecheck/should_run/tcrun035.stderr
+++ b/testsuite/tests/typecheck/should_run/tcrun035.stderr
@@ 4,8 +4,8 @@ tcrun035.hs:13:7:
with ‘forall (m :: * > *). Monad m => m a’
Expected type: (forall (m :: * > *). Monad m => m a) > IO a
Actual type: IO a > IO a
+ In the expression: id . id
+ In an equation for ‘foo’: foo = id . id
Relevant bindings include
foo :: (forall (m :: * > *). Monad m => m a) > IO a
(bound at tcrun035.hs:13:1)
 In the expression: id . id
 In an equation for ‘foo’: foo = id . id

2.25.4