[GHC] #9127: Don't warn about pattern-bindings of the form `let !_ = rhs`

GHC ghc-devs at haskell.org
Mon May 26 19:21:07 UTC 2014


#9127: Don't warn about pattern-bindings of the form `let !_ = rhs`
-------------------------------------+------------------------------------
        Reporter:  refold            |            Owner:
            Type:  bug               |           Status:  new
        Priority:  normal            |        Milestone:
       Component:  Compiler          |          Version:  7.8.2
      Resolution:                    |         Keywords:
Operating System:  Unknown/Multiple  |     Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown      |       Difficulty:  Unknown
       Test Case:                    |       Blocked By:
        Blocking:                    |  Related Tickets:
-------------------------------------+------------------------------------

Comment (by refold):

 Replying to [comment:2 igloo]:
 > This sounds a little odd to me. What's the actual use-case here? A test
 that the parameter parser doesn't thrown an exception?

 The code looks like this:

 {{{
 foo :: RequestBuilder
 foo = do rq <- rGet
          let !_ = rqPostParams rq
          ...
          rPut rq
 }}}

 where `RequestBuilder` is a state monad (`StateT ...`). So we're forcing
 some parts of the state before passing it along; `let !_ = rhs` is used as
 a nicer syntax for `seq`. IMO it's a valid idiom.

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


More information about the ghc-tickets mailing list