Gabriella439 / foldl

Composable, streaming, and efficient left folds
BSD 3-Clause "New" or "Revised" License
159 stars 51 forks source link

Sort fold #203

Open MMesch opened 10 months ago

MMesch commented 10 months ago

Would it make sense to include a sort container fold to this library? My use case is that I want to compute statistics over a collection (with the Haskell Frames library) and sort it in a single pass.

Gabriella439 commented 9 months ago

You can use fmap sort Control.Foldl.list to get the desired behavior, I think. The main reason I'd want to avoid a separate utility is because then we'd need a way to sort each type of collection that we might assemble using a Fold