
23 Oct
2015
23 Oct
'15
3:21 p.m.
On Fri, Oct 23, 2015 at 10:26:08AM -0400, Charles Durham wrote:
Is there a name for a fold that promises to call a function such that only an associative function will always return the same result. Or in other words, it has the property that it promises to call a function "associatively" on a set of data?
I am not sure I am understanding the question correctly. Every Monoid has a single binary operation which happens to be associative and one of the basic fold functions has signature foldMap :: (Foldable t, Monoid m) => (a -> m) -> t a -> m (which does what you expect). Does that answer your question? If not, I'd be grateful if you would provide an example.