Err, I'm not seeing the danger of this

(+) :: forall a. (Num a) => a -> a -> a

Doesn't this require the two parameters to be the same instance of Num?

On Fri, May 8, 2009 at 10:51 AM, Sittampalam, Ganesh <ganesh.sittampalam@credit-suisse.com> wrote:
Stephan Friedrichs wrote:

> When looking for an xor function, I found one in Data.Bits but
> couldn't use it for Bool, because Bool is no instance of Bits and of
> Num (which would be necessary, because it's "class (Num b) => Bits
> b"). My question is: Why not?
>
> [...]
> quite trivial... Why is this not part of base? Or am I missing
> something?

One reason would be that we don't want 1 + True to typecheck, even if it
does have a sensible interpretation.

Ganesh

===============================================================================
 Please access the attached hyperlink for an important electronic communications disclaimer:
 http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
 ===============================================================================

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe