Typechecker / OverloadedStrings question 7.8 vs. 7.10

Daniel Bergey bergey at teallabs.org
Mon Aug 3 16:47:25 UTC 2015


On 2015-08-03 at 04:43, Phil Ruffwind <rf at rufflewind.com> wrote:
> I think the error message could be made clearer simply by emphasizing the fact
> that type ambiguity over the lack of instances.
>
>     Ambiguous type variable 't0' arising from a use of
>       elem :: a -> t0 a -> Bool
>     caused by the lack of an instance 'Data.String.IsString (t0 Char)'
>     Either add a type annotation to dictate what 't0' should be
>     based on one of the potential instances:
>       instance Foldable (Either a) -- Defined in ‘Data.Foldable’
>       instance Foldable Data.Proxy.Proxy -- Defined in ‘Data.Foldable’
>       instance GHC.Arr.Ix i => Foldable (GHC.Arr.Array i)
>         -- Defined in ‘Data.Foldable’
>       ...plus three others)
>     or define the required instance 'Data.String.IsString (t0 Char)'.

Yes, I think that message would be fine.


More information about the ghc-devs mailing list