#3744: Comparisons against minBound/maxBound not optimised
---------------------------------+------------------------------------------
Reporter: rl | Owner:
Type: bug | Status: new
Priority: normal | Milestone: 7.0.1
Component: Compiler | Version: 6.13
Keywords: | Testcase:
Blockedby: | Difficulty:
Os: Unknown/Multiple | Blocking:
Architecture: Unknown/Multiple | Failure: Runtime performance bug
---------------------------------+------------------------------------------
Changes (by daniel.is.fischer):
* cc: daniel.is.fisc...@… (added)
Comment:
A global
{{{
{-# RULES
"(<)/minBound" forall x. x < minBound = False
"(>)/minBound" forall x. minBound > x = False
etc.
#-}
}}}
would eliminate those checks in many (almost all, hopefully) cases.
However, it would break user code relying on incompatible Ord and Enum
instances (it should not break local bindings for minBound/maxBound since
the rule refers to GHC.Enum.minBound).
Alternatively, one could add those rules for every pertinent type, but I'd
prefer a more general solution.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3744#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs