[GHC] #14527: Warn on recursive bindings

GHC ghc-devs at haskell.org
Sun Nov 26 15:53:10 UTC 2017


#14527: Warn on recursive bindings
-------------------------------------+-------------------------------------
        Reporter:  chrisdone         |                Owner:  (none)
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.1
      Resolution:                    |             Keywords:
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 chrisdone):

 For context, Niklas and I were discussing this problem and I mentioned
 the !x restriction, only to discover that the restriction wasn't
 present on GHC 8. So Niklas digged and found the commit, but we
 weren't sure why.

 However, it's not quite true that GHC had ''this'' feature. Certainly,
 getting {{{!x}}} to disable recursion back into GHC should be much
 easier to convince GHC maintainers to add it back, assuming it was
 removed accidentally. Maybe that belongs in a separate but related
 ticket.

 More generally speaking, self-referential variables in my experience
 are almost always a mistake and ''once in a while'' an intentional
 thing for me. So it would actually be nice if GHC warned about it and
 I had to put an explicit `~` in the ''few times'' I wanted it, rather
 than `!` ''everywhere'', just to avoid the problem.

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


More information about the ghc-tickets mailing list