[GHC] #12620: Allow the user to prevent floating and CSE
GHC
ghc-devs at haskell.org
Fri Sep 30 02:26:41 UTC 2016
#12620: Allow the user to prevent floating and CSE
-------------------------------------+-------------------------------------
Reporter: nomeata | Owner:
Type: feature request | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.0.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: #9520, #8457 | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by edsko):
Fair enough, that's an easier workaround. But the idea is to have
something a little more compositional. For example, in the case of
conduits, we probably ''never'' want to share a conduit value. So it would
be great if we could annotate the conduit constructors with a noupdate
annotation, and then users of the conduit library don't have to worry
about this problem anymore. After all, in the list example, it's not
obvious that
{{{#!hs
main :: IO ()
main = retry $ runConduit someConduit
}}}
has a space leak; even less so when that retry and the runConduit are in
different places:
{{{#!hs
go :: IO ()
go = runConduit someConduit
main :: IO ()
main = retry go
}}}
We'd need to have the foresight to write
{{{#!hs
main :: IO ()
main = retry $ return () >>= \_ -> go
}}}
The situation really is very close to strictness; do we want to make sure
every single function using a datatype has the right seqs in the right
place, or we just put some strictness annotations on the datatype?
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12620#comment:13>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list