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 complicated, but it goes something like this:

- when one put \x->x+x trough the function h, the compiler might change it to \x -> 2*x - when one put \x->2*x trough the function h, the compiler might change it to \x -> x + x

And we all know that \x -> 2*x is not the same as \x->x+x and this is the reason one cannot define h in Haskell
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to