fantasy-monoids icon indicating copy to clipboard operation
fantasy-monoids copied to clipboard

uniform getter

Open DrBoolean opened this issue 9 years ago • 1 comments

Something that always irked me about haskell is the getSum/getProduct etc functions. It makes writing functions less generic than just passing in the favored monoid.

const any = xs => xs.foldMap(Any).getAny
const all = xs => xs.foldMap(All).getAll

I had luck with working with a common getter like getVal Thoughts?

DrBoolean avatar Feb 05 '16 16:02 DrBoolean

I don't mind get, but getVal works!

SimonRichardson avatar Feb 05 '16 16:02 SimonRichardson