On Sat, 22 Dec 2007 17:13:55 +0200, Philippa Cowderoy <[EMAIL PROTECTED]>
wrote:
function's expansion is ... just like macro expansion.
No, it's not. Expanding variables (swapping f1 for \x->x+1) isn't the
evaluation mechanism in haskell, g and h really are semantically
equivalent values and we can't do actual computation just by expanding
variables. Whereas expanding a macro is equivalent to beta-reduction
(evaluating a function application), which isn't required before passing
something in Haskell. We pass functions, not just their results.
Here's a trivial example that does so:
(\x -> x) (\x -> x)
A lambda calculus classic that doesn't typecheck in Haskell:
(\x -> x x) (\x -> x x)
Feel free to try evaluating it!
Thank you for your message.
I tryed and this is what I've got:
ERROR - cannot find "show" function for:
*** Expression : (\x -> x) (\x -> x)
*** Of type : a -> a
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe