News for hackers. Stuff that matters.
Re:Function pipelines: Building functional programming into ... by ecoulthard on Tuesday October 19, 2021 @12:02PM (#28919658)
I'm looking for a more efficient way of detecting errors in metrics that store running totals, such as Odometer. I use the delta of Odometer to compute Distance. But decreases in Odometer causes incorrect Distance calculations. Odometer should never decrease. It is an error if Odometer decreases. Would function pipelines be able to help me detect decreases in Odometer?
Re:Function pipelines: Building functional programming into ... by djk447 on Tuesday October 19, 2021 @12:12PM (#28919804)
(NB: Post author here)

Yes! You can use the `delta()` element followed by a `filter()` with a lambda for looking for negative numbers I think!