[Haskell-cafe] Why is Bool no instance of Num and Bits?

Neil Mitchell ndmitchell at gmail.com
Fri May 8 11:51:10 EDT 2009


> 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?

I didn't at first, then I remembered:

1 + True
=
fromInteger 1 + True

And if we have Num for Bool, it type checks.

Thanks

Neil


More information about the Haskell-Cafe mailing list