John Hughes <[EMAIL PROTECTED]> writes:

> As far as the power of the optimizer is concerned, my guess is programmers
> very rarely write x==x (unless they MEAN to force x!), so the loss of
> optimization doesn't matter. Of course, in principle, an optimizer *could*
> replace x==x by x`seq`True (if x is known to be of base type), and the x`seq`
> might well be removed by later transformations (if x can be shown to be
> defined, something compilers do analyses to discover). Who knows, maybe this
> happens in the innards of ghc...

Or the compiler could internally create its own HyperStrict class and
replace x==x by x`hyperSeq`True, if all the Eq instances involved in
the type of x are known to be reflexive (which is the case if they
were all automatically derived). :-)

Carl Witty

Reply via email to