fantasyland / fantasy-monoids

A collection of monoids
29 stars 8 forks source link

uniform getter #1

Open DrBoolean opened 8 years ago

DrBoolean commented 8 years ago

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?

SimonRichardson commented 8 years ago

I don't mind get, but getVal works!