<div dir="ltr">Yeah, I realize that its probably not conveniently expressible in types or anything. I was more thinking along the lines of how the Monad laws are expressed as a side note in the docs, and not type enforced in Haskell itself.<div><br></div><div>I just thought it was vague to say that a fold takes an associative function instead of indicating what kind of topology a fold honors, as the former is only implying how the fold promises to operate. It would be surprising to me that this hasn't been formalized mathematically in some way.</div><div><br></div><div>Charlie</div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 23, 2015 at 7:01 PM, Clinton Mead <span dir="ltr"><<a href="mailto:clintonmead@gmail.com" target="_blank">clintonmead@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Basically you want to force an argument to be associative yes?<br><br>I don't think there's a way to do that in Haskell, but what you could do is create a datatype:<div><br></div><div>data Associative a b = Associative (a -> b)<br><br>You could then make "Associative" a Category, or perhaps even an Arrow, so you could combine Associative functions to make new Associative functions. </div><div><br></div><div>But it would still be up to the user to ensure they only promote actual associative functions to "Associative". </div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Oct 24, 2015 at 8:24 AM, Bardur Arantsson <span dir="ltr"><<a href="mailto:spam@scientician.net" target="_blank">spam@scientician.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On 10/23/2015 06:07 PM, Charles Durham wrote:<br>
> I can think of a few properties that folds can honor:<br>
><br>
> 1. Promises to call f on all data (does not have any guarantees on order)<br>
<br>
</span>"Exhaustive"?<br>
<br>
... but then that's not really observable in a language like Haskell,<br>
except if you monitor CPU heat.<br>
<br>
Regards,<br>
<div><div><br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
</div></div></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br></div>