[GHC] #9127: Don't warn about pattern-bindings of the form `let !_ = rhs`
GHC
ghc-devs at haskell.org
Tue May 27 20:36:29 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 igloo):
Ah, well, it'll ''probably'' do what you want. But if, for example, at a
usage site GHC can see the expression that has been put in `rqPostParams`
and thinks that it is cheap, then it may evaluate a copy of it rather than
sharing the value. #2273 is an example of something similar.
To be sure, I think you'd need something like:
{{{
foo :: RequestBuilder
foo = do rq <- rGet
let !rqPostParams' = rqPostParams rq
...
rPut $! (rq { rqPostParams = rqPostParams' })
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9127#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list