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?
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.I had luck with working with a common getter like
getVal
Thoughts?