
Hi, Am Dienstag, den 01.04.2008, 17:53 +0100 schrieb Claus Reinke:
'Integer -> a' is more concrete, less general than 'i -> a', so it matches fewer types.
'1 :: Num a => a' is more general than 'Integer'.
| No instance for (More (t -> Integer)) | arising from a use of `addd' at test.hs:19:17-22
if nothing forces the parameter (!) to be Integer, the more concrete instance won't match. try type-annotating the numeric literals.
Indeed, printI $ addd (1::Int) (2::Int) (3::Int) does work. 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 too general. 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? Thanks, Joachim -- Joachim "nomeata" Breitner mail: mail@joachim-breitner.de | ICQ# 74513189 | GPG-Key: 4743206C JID: nomeata@joachim-breitner.de | http://www.joachim-breitner.de/ Debian Developer: nomeata@debian.org