MastodonC / kixi.stats

A library of statistical distribution sampling and transducing functions
https://cljdoc.xyz/d/kixi/stats
Eclipse Public License 1.0
355 stars 17 forks source link

count-when #13

Closed sbelak closed 6 years ago

sbelak commented 6 years ago

Adds count when (not entirely sure sure if it's needed as the same functionality can be achieved with (redux/with-xform stats/count (filter pred))), but it's something I use quite often.

henrygarner commented 6 years ago

@sbelak or even with core functions (assuming pred is stateless): ((filter pred) stats/count).

I'm slightly inclined towards this approach since it'll work with all the other reducing functions too, negating the implied requirement for mean-when, etc.

Perhaps the README could be enhanced with a few cookbook-style examples along these lines?

sbelak commented 6 years ago

Sure. That's why I flagged it, as I wasn't entirely sure it's the right way to do it.