
#12364: Demand analysis for sum types -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: task | 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: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by nomeata): Work in progress on branch wip/T12354, just a quick experiment that might be able to tell us if this is worth pursuing. But it is possibly less useful than I thought: {{{ let foo a b = ... either return Left foobar .... or return Right foobaz in ... case foo a b of Left x [Demand=1*U] -> ... ; Right y [Demand=1*U] -> }}} Because the demand analyzer is a backwards analysis, the information on the usage of `foo` does not propagate into the definition of `foo` and into `foobar` and `foobaz`. For functions returning a product, a product demand is simply assumed `[Product demands for function body]` (but even there, not with single-use information). So I doubt that this is a direction worth pursuing. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12364#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler