Gabriella439 / foldl

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

Add `Control.Foldl.NonEmpty.toFold` #191

Closed Gabriella439 closed 1 year ago

Gabriella439 commented 1 year ago

Fixes https://github.com/Gabriella439/foldl/issues/190

Profpatsch commented 1 year ago

Wow, this is tricky! No wonder I couldn’t write it in like 10 minutes yesterday.

Profpatsch commented 1 year ago

Shouldn’t the Either be a strict Either? Or is that not relevant for the step function?

Gabriella439 commented 1 year ago

Yeah, at least the Right branch should probably be strict