|
If the semantics of a language says that a function
f is equivalent to a function g, but there is a function h such that
h(f) is not equivalent to h(g), then h cannot be a function. Therefore
that language cannot be a (purely) functional language. That is the pure and simple reason why functions are not Showable in Haskell. This doesn't mean that it isn't possible to show functions -- even compiled code can usually be reverse-engineered to yield some printable version of an equivalent function -- but if the language is to remain pure, such facilities should be relegated to the development tools (debugger, etc.). -Paul Benja Fallenstein wrote: Hi Henning, On Dec 18, 2007 3:53 PM, Henning Thielemann <[EMAIL PROTECTED]> wrote:Since this was discussed already here, I summed it up in: http://www.haskell.org/haskellwiki/Show_instance_for_functionsI find the discussion under "theoretical answer" unsatisfying. The property that a Show instance for functions would break is extensionality, and while extensionality is a desirable trait and matches the common mathematical intuitions, a system with intensional functions certainly isn't "unmathematical" or impure. |
_______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
