#11601: Strict Haskell is not as strict as it probably should be -------------------------------------+------------------------------------- Reporter: simonpj | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.3 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 Simon Peyton Jones <simonpj@…>): In [changeset:"e3f341f334d89c88f388d8e864ed8762d0890a64/ghc" e3f341f/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="e3f341f334d89c88f388d8e864ed8762d0890a64" Fix and refactor strict pattern bindings This patch was triggered by Trac #11601, where I discovered that -XStrict was really not doing the right thing. In particular, f y = let !(Just x) = blah[y] in body[y,x] This was evaluating 'blah' but not pattern matching it against Just until x was demanded. This is wrong. The patch implements a new semantics which ensures that strict patterns (i.e. ones with an explicit bang, or with -XStrict) are evaluated fully when bound. * There are extensive notes in DsUtils: Note [mkSelectorBinds] * To do this I found I need one-tuples; see Note [One-tuples] in TysWiredIn I updated the user manual to give the new semantics }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11601#comment:8> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler