
Basically you want to force an argument to be associative yes?
I don't think there's a way to do that in Haskell, but what you could do is
create a datatype:
data Associative a b = Associative (a -> b)
You could then make "Associative" a Category, or perhaps even an Arrow, so
you could combine Associative functions to make new Associative functions.
But it would still be up to the user to ensure they only promote actual
associative functions to "Associative".
On Sat, Oct 24, 2015 at 8:24 AM, Bardur Arantsson
On 10/23/2015 06:07 PM, Charles Durham wrote:
I can think of a few properties that folds can honor:
1. Promises to call f on all data (does not have any guarantees on order)
"Exhaustive"?
... but then that's not really observable in a language like Haskell, except if you monitor CPU heat.
Regards,
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe