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.
We currently implement
takeWhile
in terms of a funnyfoldWhileFB
function, which Louis Wasserman commented was a better producer thanData.List.takeWhile
. That was in 2015. The code for implementing list fusion ofData.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 useData.List.takeWhile
, which would be a rather nicer thing to do.