Open o1lo01ol1o opened 4 years ago
One approach in to add instance
instance StatMonoid m a => StatMonoid (Const m x) a
Whenever I want to turn *
into * -> *
I usually reach for Const.
What about the newtype
s themselves? Do those warrant inclusion in monoid-statistics
?
I've written variations of the following types enough times to now raise an issue:
The problem they look to solve is to get a "functorial" representation of the underlaying monoid so that it can be used in higher-kinded types (ie,
barbies
orvinyl
).And easily access monoidal statistics:
etc.
I'm happy to open a PR if you have a good notion of how the above should be implemented.
(Bonus points for providing "accessors" to the various components in a generic way. This might have to be done using some of the machinery that already exists in
barbies
orvinyl
though).