
#15696: Derived Ord instance for enumerations with more than 8 elements seems to be incorrect -------------------------------------+------------------------------------- Reporter: mrkkrp | Owner: osa1 Type: bug | Status: patch 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: #14677, #15155 | Differential Rev(s): Phab:D5196, Wiki Page: | Phab:D5201 -------------------------------------+------------------------------------- Comment (by osa1): I'm probably missing the big picture, but I think it makes sense to give evaluated things `evaldUnfolding` and if that breaks something else then we should fix that something else. In (3) of comment:60, perhaps the thing to fix is the binder-swapping transform rather than the id unfolding, so that it avoids swapping binders with different evaluated-ness (or maybe only avoid it if doing so will break the let/app invariant -- not sure how hard would it be to check this though). I don't know enough about demand analysis to comment on Secondly. I'll try it. Re Thirdly, the demand type does not make too much sense to me (how can an id have strict demand but unused cardinality? Sounds like a hack to make some transformations possible) but I can see how the current code changes cardinality incorrectly. I'll update. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15696#comment:78 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler