[GHC] #14140: Better treatment for dataToTag

GHC ghc-devs at haskell.org
Wed Sep 6 00:27:12 UTC 2017


#14140: Better treatment for dataToTag
-------------------------------------+-------------------------------------
        Reporter:  simonpj           |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.1
      Resolution:                    |             Keywords:  datacon-tags
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by dfeuer):

 For derived instances, might it make sense to write this?

 {{{#!hs
 eqOS :: OS -> OS -> Bool
 eqOS a b | dataToTag a /= dataToTag b = False
 eqOS (OtherOS s1) (OtherOS s2) = s1 == (s2 :: String)
 eqOS _ _ = False
 }}}

 Sometimes this will be better; sometimes it will be worse. But I don't
 think it's likely to do anything silly. Of course, even if we do that, we
 probably want to try to make the compiler cleverer too.

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


More information about the ghc-tickets mailing list