If we look at swap from the standpoint of the laws/RULES it should support, viewing Hask over (,) as a symmetric monoidal category you get something like:<div><font class="Apple-style-span" face="'courier new', monospace"><br>
</font></div><div><font class="Apple-style-span" face="'courier new', monospace">{-# RULES</font><div><font class="Apple-style-span" face="'courier new', monospace">"swap . swap = id" forall x. swap (swap x) = x</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">"fst . swap = snd" forall x. fst (swap x) = snd x</font></div><div><font class="Apple-style-span" face="'courier new', monospace">"snd . swap = fst" forall x. snd (swap x) = fst x</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> #-}</font></div><div><br></div><div>That seems to argue for the lazy definition being the default to avoid the strict pattern match in swap breaking the latter very pleasing equalities.</div>
<div><br></div><div>-Edward Kmett</div><div><br><div class="gmail_quote">On Wed, Jun 17, 2009 at 8:52 PM, <span dir="ltr"><<a href="mailto:roconnor@theorem.ca">roconnor@theorem.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
How about this: swap should be lazy because that is how H98 defines uncurry:<br>
<br>
uncurry :: (a -> b -> c) -> ((a, b) -> c)<br>
uncurry f p = f (fst p) (snd p)<div class="im"><br>
<br>
-- <br>
Russell O'Connor <<a href="http://r6.ca/" target="_blank">http://r6.ca/</a>><br>
``All talk about `theft,''' the general counsel of the American Graphophone<br>
Company wrote, ``is the merest claptrap, for there exists no property in<br>
ideas musical, literary or artistic, except as defined by statute.''<br>
_______________________________________________<br></div><div><div></div><div class="h5">
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/libraries" target="_blank">http://www.haskell.org/mailman/listinfo/libraries</a><br>
</div></div></blockquote></div><br></div></div>