#5858: type inference of an OverloadedString for a class instance with type
parameters
---------------------------------+------------------------------------------
Reporter: GregWeber | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.4.1
Keywords: | Os: Unknown/Multiple
Architecture: Unknown/Multiple | Failure: None/Unknown
Difficulty: Unknown | Testcase:
Blockedby: | Blocking:
Related: |
---------------------------------+------------------------------------------
Comment(by GregWeber):
{{{
T5858.hs:11:7:
Cannot resolve the instance for InferOverloaded ([a0], [a1])
arising from a use of `infer'
Possible fix:
add an instance declaration for (InferOverloaded ([a0], [a1]))
Possible fix: add a type signature to instantiate `a0, a1'
There is a potential instance available:
instance t1 ~ String => InferOverloaded (t1, t1)
Defined at T5858.hs:8:10
In the expression: infer ([], [])
In an equation for `foo': foo = infer ([], [])
}}}
I think the above would be idea: mention both fixes as before.
The expansion of the suggestion here is great. My favorite aspect of 7.4
is how it suggests alternatives functions when you mis-spell one. These
help me, but I think better messages are perhaps the biggest improvement
for new users. If we wanted to go for the gold on this we would actually
spell out the fixed code in the possible fix:
{{{
infer ([]::String, []::String)
}}}
But I could definitely imagine that this might be problematic in certain
circumstances.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5858#comment:6>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs