[Haskell-cafe] New to Haskell

Benja Fallenstein benja.fallenstein at gmail.com
Tue Dec 18 11:49:19 EST 2007

Hi Paul,

On Dec 18, 2007 5:18 PM, Paul Hudak <paul.hudak at yale.edu> wrote:
>  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.

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

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.

- Benja

More information about the Haskell-Cafe mailing list