[Haskell-cafe] 'Associative' order of calling
Francesco Ariis
fa-ml at ariis.it
Fri Oct 23 15:21:57 UTC 2015
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.
More information about the Haskell-Cafe
mailing list