[GHC] #15696: Derived Ord instance for enumerations with more than 8 elements seems to be incorrect

GHC ghc-devs at haskell.org
Tue Oct 2 18:35:50 UTC 2018


#15696: Derived Ord instance for enumerations with more than 8 elements seems to be
incorrect
-------------------------------------+-------------------------------------
        Reporter:  mrkkrp            |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  highest           |            Milestone:  8.6.2
       Component:  Compiler          |              Version:  8.6.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Incorrect result  |  Unknown/Multiple
  at runtime                         |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by heisenbug):

 Replying to [comment:11 dfeuer]:
 > Didn't we just recently start using some pointer tagging for types with
 more than 7 constructors? I'm thinking something could be a drop off in
 that code.

 Nope. That code is not ripe yet. This summer was very busy for me.

 Another thing: With Peter I discovered last Haskell eXchange (Oct. 2017)
 that enumerated types with derived `Ord` instances could use `getTag` to
 derive a constant-time `compare` (and `(==)` too). We were not aware of
 this optimization already being in the codebase. We'll surely revisit
 this.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15696#comment:20>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list