Hi

> Other rules that could be interesting are:
>  > forall a b. fromInteger a + fromInteger b = fromInteger (a + b)
>  > forall a b. fromInteger a * fromInteger b = fromInteger (a * b)

This is wrong, since the class function can do what it wants. Imagine:

instance Num String where
   (+) = (++)
   fromInteger x = show x

1 + 2 :: String

this expression now goes from "12" to "3" by applying this rule.

You need to be incredibly careful if there are any classes floating around.

Thanks

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

Reply via email to