lspitzner / pqueue

Haskell priority queue package
Other
15 stars 13 forks source link

Remove foldWhileFB in favor of Data.List.takeWhile? #98

Closed treeowl closed 1 year ago

treeowl commented 1 year ago

We currently implement takeWhile in terms of a funny foldWhileFB function, which Louis Wasserman commented was a better producer than Data.List.takeWhile. That was in 2015. The code for implementing list fusion of Data.List.takeWhile was written in 2014 (and therefore may not have been released when Louis wrote that comment). Additionally, Takano Akio add an inlining pragma to make that work better in 2017. As a result of all these changes, I suspect we can probably just use Data.List.takeWhile, which would be a rather nicer thing to do.

konsumlamm commented 1 year ago

If there are no performance regressions, I see no reason not to simply use Data.List.takeWhile.

treeowl commented 1 year ago

Benchmarking is not my forte.