[Haskell-cafe] Data.Data and OverlappingInstances

Brandon Allbery allbery.b at gmail.com
Thu Aug 9 16:17:30 CEST 2012


On Thu, Aug 9, 2012 at 6:00 AM, Timo von Holtz <timo.v.holtz at gmail.com>wrote:

> instance Num a => Test a where
>   foo = return 1
>
> instance Test Int where
>   foo = return 2
>
>
Erm, this isn't going to work anyway, is it?  I think the first instance
matches all types and then throws an error if the result isn't an instance
of Num?

-- 
brandon s allbery                                      allbery.b at gmail.com
wandering unix systems administrator (available)     (412) 475-9364 vm/sms
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120809/857e9282/attachment.htm>


More information about the Haskell-Cafe mailing list