ghc fails to find the right instance
claus.reinke at talk21.com
Tue Apr 1 15:11:52 EDT 2008
|But I can’t follow your explanation completely. When I use the variant
|with Integer, ghc will not use the instance because (1::Num a => a) is
|But why does it use the Integral i-Instance in the working variant?
|(1::Num a=> a) is also more general than (1::Integral i => i), isn’t it?
because instance selection does not take instance contexts
into account (a frequent source of feature requests;-):
so, the match is against 'i', and the 'Integral i' is added
to the constraints needing proof *after* that instance
has been chosen.
More information about the Glasgow-haskell-users