This is what I understand so far ...
Suppose we have these two values:
a) \x-x + x
b) \x-2 * x
Because these to values are equal, all functions definable in Haskell must
preserve this.
This is why I am not allowed to define a function like
h :: (a-b) - (a-b)
h x = x
The reasons are very
On Dec 18, 2007 1:00 PM, Cristian Baboi [EMAIL PROTECTED] wrote:
This is what I understand so far ...
Suppose we have these two values:
a) \x-x + x
b) \x-2 * x
Because these to values are equal, all functions definable in Haskell must
preserve this.
This is why I am not allowed to define
Extensionality says that the only observable properties of functions
are the outputs they give for particular inputs. Accepting
extensionality as a Good Thing implies that enabling the user to
define a function that can differentiate between f x = x + x and g x =
2 * x is a Bad Thing.
Note that
This is a fine warning you both point out, but I would suggest that it
distracts from the OP's question.
The previous, germane discussion holds if we assume that i) both f and
g have type Integer - Integer, ii) the compiler writer is not out to
get us, and iii) the GMP library, if used by that