fantasy-monoids
fantasy-monoids copied to clipboard
uniform getter
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?
I don't mind get
, but getVal
works!