[Haskell-cafe] Re: Type inference problem

Joel Björnson joel.bjornson at gmail.com
Mon Aug 7 05:49:11 EDT 2006

2006/8/6, Joel Björnson <joel.bjornson at gmail.com>:
> So far, so good... However, problems arises trying to define the function
> :
test = toElem myElem
> Yielding the error message : 'No instance for (Show Elem) arising use of
> `toElem` at ...'
> For some reason it seems like the type checker picks the *wrong* 'toElem',
> and that the type of 'myElem' can't be properly determined (without adding
> explicit type signatures). It seems strange though the the type of myElem
> really can be determined and that the instance (IsElem Elem) is more
> specific then the instance for Show types.

 I've received some information pointing me to that the problem arises due
to the -fallow-incoherent-instances flag, which I´ve been using.
Without this flag the function 'test' above works as expected...

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org//pipermail/haskell-cafe/attachments/20060807/7e3d4b6e/attachment-0001.htm

More information about the Haskell-Cafe mailing list