[GHC] #9368: Add strictly accumulating scanl' to Data.List

#9368: Add strictly accumulating scanl' to Data.List -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: libraries/base | Version: 7.8.3 Keywords: | Operating System: Architecture: Unknown/Multiple | Unknown/Multiple Difficulty: Easy (less than 1 | Type of failure: hour) | None/Unknown Blocked By: | Test Case: Related Tickets: #9345 | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Joachim Breitner wrote a strictly accumulating fusable `scanl'` in a comment on #9345, and demonstrated that it can produce spectacularly good code. Therefore, it seems like a good thing to have in Data.List. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9368 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9368: Add strictly accumulating scanl' to Data.List -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: Type: feature | Status: new request | Milestone: Priority: normal | Version: 7.8.3 Component: | Keywords: libraries/base | Architecture: Unknown/Multiple Resolution: | Difficulty: Easy (less than 1 Operating System: | hour) Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: #9345 None/Unknown | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by nomeata): * cc: nomeata (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9368#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9368: Add strictly accumulating scanl' to Data.List -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: Type: feature | Status: new request | Milestone: Priority: normal | Version: 7.8.3 Component: | Keywords: libraries/base | Architecture: Unknown/Multiple Resolution: | Difficulty: Easy (less than 1 Operating System: | hour) Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: #9345 None/Unknown | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by dfeuer): Based on the structure of the code, I think we probably want a rewrite rule for `tail $ scanl' ...` to avoid adding the first element instead of trying to take it off later, which doesn't work so well. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9368#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9368: Add strictly accumulating scanl' to Data.List -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: Type: feature | Status: patch request | Milestone: Priority: normal | Version: 7.8.3 Component: | Keywords: libraries/base | Architecture: Unknown/Multiple Resolution: | Difficulty: Easy (less than 1 Operating System: | hour) Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: #9345 None/Unknown | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by dfeuer): * status: new => patch Comment: Phab: D314 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9368#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9368: Add strictly accumulating scanl' to Data.List -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: Type: feature | Status: patch request | Milestone: Priority: normal | Version: 7.8.3 Component: Core | Keywords: Libraries | Architecture: Unknown/Multiple Resolution: | Difficulty: Easy (less than 1 Operating System: | hour) Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: #9345 None/Unknown | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by nomeata): * cc: core-libraries-committee@… (added) Comment:
Note: this patch does not add scanl' to Data.List, but only to GHC.List. I don't know that I have enough community support as yet to add it publicly, but I want it for Data.List.inits, and it seems sensible (to me) to put it next to scanl.
I don’t think there will be doubts about it. It has pretty obvious semantics, and it is clear that it’s nice to have it. If you make a proposal you will get affirmative silence and a +1 from me :-) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9368#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9368: Add strictly accumulating scanl' to Data.List -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: Type: feature | Status: new request | Milestone: Priority: normal | Version: 7.8.3 Component: Core | Keywords: Libraries | Architecture: Unknown/Multiple Resolution: | Difficulty: Easy (less than 1 Operating System: | hour) Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: #9345 None/Unknown | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by thomie): * status: patch => new Comment: {{{ commit d45693a5384460d22a6437b9cda463b4ec4b6a37 Author: David Feuer <> Date: Tue Oct 7 20:51:25 2014 +0200 Make scanl fuse; add scanl' Summary: Make scanl a good producer and a good consumer for fold/build fusion. Add strictly-accumulating scanl', which is required for Data.List.inits. Reviewers: nomeata, austin Reviewed By: austin Subscribers: spacekitteh, thomie, carter, ezyang, simonmar Differential Revision: https://phabricator.haskell.org/D314 GHC Trac Issues: #9356 }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9368#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9368: Add strictly accumulating scanl' to Data.List -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: Type: feature | Status: patch request | Milestone: Priority: normal | Version: 7.8.3 Component: Core | Keywords: Libraries | Architecture: Unknown/Multiple Resolution: | Difficulty: Easy (less than 1 Operating System: | hour) Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: #9345 None/Unknown | Test Case: | Blocking: | Differential Revisions: Phab:D498 | -------------------------------------+------------------------------------- Changes (by dfeuer): * status: new => patch * differential: => Phab:D498 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9368#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9368: Add strictly accumulating scanl' to Data.List
-------------------------------------+-------------------------------------
Reporter: dfeuer | Owner:
Type: feature | Status: patch
request | Milestone:
Priority: normal | Version: 7.8.3
Component: Core | Keywords:
Libraries | Architecture: Unknown/Multiple
Resolution: | Difficulty: Easy (less than 1
Operating System: | hour)
Unknown/Multiple | Blocked By:
Type of failure: | Related Tickets: #9345
None/Unknown |
Test Case: |
Blocking: |
Differential Revisions: Phab:D498 |
-------------------------------------+-------------------------------------
Comment (by Austin Seipp

#9368: Add strictly accumulating scanl' to Data.List -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: Type: feature | Status: closed request | Milestone: 7.10.1 Priority: normal | Version: 7.8.3 Component: Core | Keywords: Libraries | Architecture: Unknown/Multiple Resolution: fixed | Difficulty: Easy (less than 1 Operating System: | hour) Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: #9345 None/Unknown | Test Case: | Blocking: | Differential Revisions: Phab:D498 | -------------------------------------+------------------------------------- Changes (by thoughtpolice): * status: patch => closed * resolution: => fixed * milestone: => 7.10.1 Comment: Merged, thanks! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9368#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC