[GHC] #13290: Data constructors should not have RULES

GHC ghc-devs at haskell.org
Thu Mar 2 20:07:01 UTC 2017


#13290: Data constructors should not have RULES
-------------------------------------+-------------------------------------
        Reporter:  simonpj           |                Owner:  dfeuer
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.2.1
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #7398             |  Differential Rev(s):  Phab:D3169
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by dfeuer):

 Implemented by bc332b3159613190a4dc33a067c1ab31039a8434
 {{{
 Prohibit RULES changing constructors

 Previously, RULES like

 {-# RULES
 "JustNothing" forall x . Just x = Nothing
  #-}

 were allowed. Simon Peyton Jones say this seems to have been a
 mistake, that such rules have never been supported intentionally,
 and that he doesn't know if they can break in horrible ways.
 Furthermore, Ben Gamari and Reid Barton are considering trying to
 detect the presence of "static data" that the simplifier doesn't
 need to traverse at all. Such rules do not play well with that.
 So for now, we ban them altogether. In most cases, it's possible
 to work around the ban using hand-written wrapper functions.

 Reviewers: austin, simonpj, bgamari

 Reviewed By: simonpj, bgamari

 Subscribers: thomie

 Differential Revision: https://phabricator.haskell.org/D3169
 }}}

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


More information about the ghc-tickets mailing list