[Haskell-cafe] Haskell purity and printing

jerzy.karczmarczuk at info.unicaen.fr jerzy.karczmarczuk at info.unicaen.fr
Tue Dec 18 16:29:36 EST 2007

Nicolas Frisby writes: 

> Extensionality says that the only observable properties of functions
> are the outputs they give for particular inputs. Accepting
> extensionality as a Good Thing implies that enabling the user to
> define a function that can differentiate between f x = x + x and g x =
> 2 * x is a Bad Thing.

Provided you subsume what you subsume, in general case there is no reason
that the "standard math" equality x+x == 2*x be true. You may write whatever
Num instances (for some data "x") please you. Your multiplication may have
nothing to do with the addition, and your fromInteger function may do
horrible things. In any case, confusing math and Haskell is not safe. 

Jerzy Karczmarczuk 

More information about the Haskell-Cafe mailing list