[GHC] #14527: Warn on recursive bindings

GHC ghc-devs at haskell.org
Mon Nov 27 09:00:14 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 simonpj):

 Making it possible to have strict recursive bindings was by-design I
 believe, not accidental.  Mostly, I think, for simplicity and uniformity
 rather than actual use-cases.

 More importantly, not every non-recursive binding should be strict!  And
 putting a bang on every single non-recursive binding would indeed be
 tiresome.  So coupling this warning business with bang patterns would be a
 mistake, I think.

 I rather like the idea of a tilde.  It's allowed right now, but it's
 semantically a no-op.  So using it as a per-binding way of disabling the
 warning would be quite neat.

 It's worth a proposal though.  Make sure you handle recursive pattern
 bindings like
 {{{
 (x,y) = f x
 }}}

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


More information about the ghc-tickets mailing list