[GHC] #7074: Way too long, and unhelpful, error message
GHC
cvs-ghc at haskell.org
Mon Jul 16 18:04:57 CEST 2012
#7074: Way too long, and unhelpful, error message
-------------------------------+--------------------------------------------
Reporter: ksf | Owner:
Type: bug | Status: closed
Priority: normal | Milestone:
Component: Compiler | Version: 7.4.2
Resolution: fixed | Keywords:
Os: Unknown/Multiple | Architecture: Unknown/Multiple
Failure: None/Unknown | Difficulty: Unknown
Testcase: | Blockedby:
Blocking: | Related:
-------------------------------+--------------------------------------------
Changes (by simonpj):
* status: new => closed
* difficulty: => Unknown
* resolution: => fixed
Comment:
Good point. An easy fix the pretty printer yields this
{{{
T7074.hs:65:5:
No instance for (Control.Monad.Fix.MonadFix m0)
arising from a do statement
The type variable `m0' is ambiguous
Possible fix: add a type signature that fixes these type variable(s)
Note: there are several potential instances:
instance Control.Monad.Fix.MonadFix ((->) r)
-- Defined in `Control.Monad.Fix'
instance Control.Monad.Fix.MonadFix (Either e)
-- Defined in `Control.Monad.Fix'
instance Control.Monad.Fix.MonadFix IO
-- Defined in `Control.Monad.Fix'
...plus three others
In a stmt of an 'mdo' block:
rec { words <- newRule
$ optional pause ->> cmany (word <<- optional pause);
word <- newRule $ lojbanWord // nonLojbanWord;
lojbanWord <- newRule $ cmene // cmavo // brivla;
brivla <- newRule $ gismu // fuhivla // lujvo;
cmene <- newRule $ jbocme // zifcme;
.... }
In the expression:
mdo { rec { words <- newRule
$ optional pause ->> cmany (word <<- optional
pause);
word <- newRule $ lojbanWord // nonLojbanWord;
lojbanWord <- newRule $ cmene // cmavo // brivla;
.... };
return words }
In an equation for `parser':
parser
= mdo { rec { words <- newRule
$ optional pause ->> cmany (word <<-
optional pause);
word <- newRule $ lojbanWord // nonLojbanWord;
.... };
return words }
}}}
in place of the monster error. Since I didn't have `Text.Parsers.Frisby`
I had to add a lot of error-bindings with bogus types, which is why the
message is different. But I can confirm that the massive output is gone.
I can't comment on the line number reported without a reproducible test
case. If you think it's important, maybe you can make another ticket for
it? Thanks for pointing out the pretty-printing problem.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7074#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list