
#9545: Evaluate Takano Akio's foldrW/buildW fusion framework as a possible replacement for foldr/build -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: Type: task | Status: closed Priority: normal | Milestone: Component: | Version: 7.9 libraries/base | Keywords: Resolution: wontfix | Architecture: Unknown/Multiple Operating System: | Difficulty: Project (more Unknown/Multiple | than a week) Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by dfeuer): Replying to [comment:7 quantheory]:
I did find the issues with scanl and reverse; in fact, even after fixing `reverse . scanl f z $ xs`, I still had issues with `reverse . scanl f z . reverse $ xs`. But I did eventually fix both cases with this change:
https://github.com/quantheory/ww- fusion/commit/74618328c34572270154dbd93eb441f448760e0e
I must admit I'm still nervous about that implementation, for the very simple and unscientific reason that your unwrapper has a `_` in it: {{{#!hs (\u -> Env $ \k b -> unwrap $ \e _ -> u e k b) }}} The fact that it makes me nervous does not mean that it's actually wrong, of course. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9545#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler