Generic Data.List.partition

evan@evan-borden.com evan at evanrutledgeborden.dreamhosters.com
Thu Oct 20 19:12:32 UTC 2016


I've been curious in the past why Data.List.partition has not found a more
generic implementation. I always assumed this was because of performance.

I've given the performance hypothesis a test and it seems that a generic
implementation outperforms the list implementation. I'm not terribly sure
why this is the case, but I also haven't dumped core.

Implementation and bench: https://github.com/eborden/partition

Should this function be made generic? This implementation is surely
leveraging the perf characteristics of the Monoid instance of List. Other
types could have terrible performance.


- Evan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20161020/9818dd01/attachment.html>


More information about the Libraries mailing list