I find `reduce` useful for operations where:- arg1, arg2 and return value are all of the same type e.g `ADD`, `MAX`, `CONCAT` etc- and there is an identity value e.g zero for `ADD`, -math.inf for `MAX`I recommend checking this article[1] on how monoids play nicely with reduce.[1] <a href="https://fsharpforfunandprofit.com/posts/monoids-without-tears/#what-use-are-monoids-to-a-programmer" rel="nofollow">https://fsharpforfunandprofit.com/posts/monoids-without-tear...
ducaale · · focus · HN ↗
- arg1, arg2 and return value are all of the same type e.g `ADD`, `MAX`, `CONCAT` etc
- and there is an identity value e.g zero for `ADD`, -math.inf for `MAX`
I recommend checking this article[1] on how monoids play nicely with reduce.
[1] <a href="https://fsharpforfunandprofit.com/posts/monoids-without-tears/#what-use-are-monoids-to-a-programmer" rel="nofollow">https://fsharpforfunandprofit.com/posts/monoids-without-tear...