On 9/9/05, Keean Schupke <[EMAIL PROTECTED]> wrote:
> Just noticed the 1+[1,2] case...  I am not certain whether this is
> possible - it is outside the
> scope of the formal definiton of Haskell and may rely on implementation
> details of the compiler/interpreter.

While this is outside the scope of the current Num class, if we adopt
the suggestion to redefine the standard classes using functional
dependencies (which is, I think, a useful addition to the standard
prelude anyway), we have, for example:

class Plus a b c | a b -> c
 where (+) :: a -> b -> c

instance (Plus a b c, Functor f) => a -> f b -> f c
 where a + fb = fmap (a +) fb

and so forth.  However, this doesn't generalize obviously (in any way
that I see) to generic two argument functions, which seemed to be what
Frederik wanted.

 /g
_______________________________________________
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to