[Haskell-cafe] New to Haskell

Paul Hudak paul.hudak at yale.edu
Tue Dec 18 12:01:19 EST 2007



Benja Fallenstein wrote:
> Not so fast :-)
>
> Caveat one, there may be useful ways to for functions to implement
> Show that don't conflict with extensionality (i.e., the property that
> two functions are equal if they yield the same results for all
> inputs).
>   
Sure, and I suppose one way to do this is to put the show function for 
functions into the IO monad -- then you can't inspect the results.  But 
if you want to inspect the result, then I have no idea how to do this.

> Caveat two, we generally assume extensionality when reasoning about
> Haskell, but it's entirely possible to give a semantics for Haskell
> that doesn't assume extensionality. IMHO, a good answer to the
> question why functions aren't showable in Haskell needs to explain why
> we prefer our semantics to be extensional, not say that by god-given
> fiat, Haskell is extensional, so we can't show functions.
>   
Well, my caveat was that the Haskell designers wanted it this way.  So 
you are essentially rejecting my caveat, rather than creating a new one. 
:-)

    -Paul




More information about the Haskell-Cafe mailing list