Proposal: add chunksOf to Data.Sequence

Data.List.Split.chunksOf n xs breaks up a list xs into chunks of n elements each. The internal "splitMap" function Data.Sequence uses to implement zipWith supports a simple and efficient implementation of chunksOf. All in favor, say "aye". Also, I'm still waiting for a response (any response) to my "cycleN" proposal. David

Last year, I proposed adding chunksOf to Data.Sequence (mimicking the functionality of Data.List.Split.chunksOf, and taking advantage of internal structure to improve the efficiency beyond anything implementable using the current public API). The proposal was met with deafening silence. I seek advice and consent of anyone who cares. David

+1
On Tue, Apr 26, 2016 at 5:53 AM, David Feuer
Last year, I proposed adding chunksOf to Data.Sequence (mimicking the functionality of Data.List.Split.chunksOf, and taking advantage of internal structure to improve the efficiency beyond anything implementable using the current public API). The proposal was met with deafening silence. I seek advice and consent of anyone who cares.
David _______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries

Hi, again, consent without advice. Don’t be discouraged by silence; Data.Sequence may be a bit below people’s radar, and few have technical insight into it that matches yours’, but that does not make your contributions less worthy. Greetings, Joachim Am Montag, den 25.04.2016, 23:53 -0400 schrieb David Feuer:
Last year, I proposed adding chunksOf to Data.Sequence (mimicking the functionality of Data.List.Split.chunksOf, and taking advantage of internal structure to improve the efficiency beyond anything implementable using the current public API). The proposal was met with deafening silence. I seek advice and consent of anyone who cares.
David _______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
-- Joachim “nomeata” Breitner mail@joachim-breitner.de • https://www.joachim-breitner.de/ XMPP: nomeata@joachim-breitner.de • OpenPGP-Key: 0xF0FBF51F Debian Developer: nomeata@debian.org

On 04/25/2016 11:53 PM, David Feuer wrote:
Last year, I proposed adding chunksOf to Data.Sequence (mimicking the functionality of Data.List.Split.chunksOf, and taking advantage of internal structure to improve the efficiency beyond anything implementable using the current public API). The proposal was met with deafening silence. I seek advice and consent of anyone who cares.
I will provide a general comment about Data.Sequence. I don't care much for it. While I occasionally use the data type, its performance characteristics mean that it's rarely what I need. In particular, its O(log n) complexity of mappend is a killer for many applications. The problem with Data.Sequence may be that it attempts to be a jack-of-all-sequences. I can't recall ever needing a fully symmetric queue. It's nice, I guess, to have a general-purpose data-structure at hand when prototyping, but a more specialized implementation should always win in production. Would you consider adding (and maintaining) a simpler data structure with O(1) mappend to containers, perhaps something like https://github.com/nikita-volkov/bytestring-tree-builder/blob/master/library... ? That is something I'd be reaching for more often that Data.Sequence as it stands.

I will entertain various such suggestions, certainly, but that is quite
orthogonal to this particular question!
On May 1, 2016 12:43 PM, "Mario Blažević"
On 04/25/2016 11:53 PM, David Feuer wrote:
Last year, I proposed adding chunksOf to Data.Sequence (mimicking the functionality of Data.List.Split.chunksOf, and taking advantage of internal structure to improve the efficiency beyond anything implementable using the current public API). The proposal was met with deafening silence. I seek advice and consent of anyone who cares.
I will provide a general comment about Data.Sequence. I don't care much for it.
While I occasionally use the data type, its performance characteristics mean that it's rarely what I need. In particular, its O(log n) complexity of mappend is a killer for many applications. The problem with Data.Sequence may be that it attempts to be a jack-of-all-sequences. I can't recall ever needing a fully symmetric queue. It's nice, I guess, to have a general-purpose data-structure at hand when prototyping, but a more specialized implementation should always win in production.
Would you consider adding (and maintaining) a simpler data structure with O(1) mappend to containers, perhaps something like https://github.com/nikita-volkov/bytestring-tree-builder/blob/master/library... ? That is something I'd be reaching for more often that Data.Sequence as it stands.
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries

On 03/15/2015 05:45 PM, David Feuer wrote:
Data.List.Split.chunksOf n xs breaks up a list xs into chunks of n elements each. The internal "splitMap" function Data.Sequence uses to implement zipWith supports a simple and efficient implementation of chunksOf. All in favor, say "aye".
+1 (as some who needs this at this very moment. I guess I'll have to write my own for now.) ... though it seems a bit odd that List doesn't have this? Would it make sense to add it there too? It seems like this must be at least as commonly used as e.g. 'permutations'.
Also, I'm still waiting for a response (any response) to my "cycleN" proposal.
+0 ... as in: Don't particularly care either way. No sure if that counts as a response :). Regards,
participants (5)
-
Bardur Arantsson
-
David Feuer
-
Joachim Breitner
-
Mario Blažević
-
Thomas Miedema