
#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 michaelt): If I add a monad instance, then I can give the customary definition `await = Await Done`. If I delay inlining, then the standard use of `await` works fine in the presence of this rule {{{ {-# RULES "await hack" forall f . await >>= f = Await (oneShot f) #-} }}} In a library for your `Sink` type, this would I think get rid of the problem. See the attached https://ghc.haskell.org/trac/ghc/attachment/ticket/12620/awaithack.hs -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12620#comment:29 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler