JasonShin / fp-core.rs

A library for functional programming in Rust
MIT License
1.34k stars 66 forks source link

Feature request:: add fold to Monoid #70

Closed bbarker closed 3 years ago

bbarker commented 3 years ago

One nice thing for Monoids is that we can call a fold directly on a monoidal structure without needing to specify the empty element manually when calling fold. It might be nice to have this added in as a trait method for monoid.

bbarker commented 3 years ago

(I'd be happy to implement this at some point, but have quite a lot of Rust/Rust+FP reading to do first before I really want to dig in on this awesome library)

bbarker commented 3 years ago

Oops, I had a moment ... forgot that should be part of Foldable.