[GHC] #14527: Warn on recursive bindings

GHC ghc-devs at haskell.org
Tue Nov 28 16:46:41 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):

 Right, I was aiming for {{{ones = 1 : ones}}} to be a warning.

 How about we rephrase it as "function-like":

 * The RHS is not a function-like: either a lambda or a lambda-case.

 (If the RHS is a literal then by-definition it's not recursive and
 wouldn't trigger the warning, I think.)

 With an ad-hoc bit like that, I'm more convinced that this could be
 practical. I'll consider making a proposal for it. A draft implementation
 could be run against Stackage to see how many false-positives it flags up.
 Here and reddit provided enough concerns

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


More information about the ghc-tickets mailing list