<p dir="ltr">To directly answer the initial proposal, there seems to be little harm in functor instances for n-tuples. Functor instances are usually ok as one must always provide two arguments to fmap which agree with each other. There is little chance of using the wrong instance by accident.</p>
<p dir="ltr">However, I am strongly against adding foldable and traversable instances for n-tuples. I thank Ryan for articulating why he finds them useful but due to the pervasive use of tuples to return multiple values from functions I find even the 2-tuple instance distasteful . </p>
<p dir="ltr">It is very easy to introduce bugs when refactoring with the existence of these instances. If altering a function which returns a useful foldable such as lists to return a pair then if you ever call length on the returned value then you have introduced a difficult to track down bug. Unlike calls to fmap, there is no sanity check to make sure you are using the right instance. </p>
<p dir="ltr">If there are other cases where such instances are useful then I would reconsider my position but I find the arguments for (a canonical instance and for consistency) unconvincing. It should not be the case that we propagate bad behaviour for the sake of consistency. I even think Ryan's use case would be better served by a separate datatype for that purpose. <br><br></p>
<div class="gmail_quote">On 19 Jan 2016 21:04,  <<a href="mailto:amindfv@gmail.com">amindfv@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div></div><div>If the only uses we can imagine for these instances are</div><div>   - Cases where it's not a great design decision</div><div>   - Cases where it's used accidentally and results in a silent runtime failure instead of a compile-time error</div><div><br></div><div>then I'm a strong -1</div><div><br></div><div>Tom</div><div><br>El 19 ene 2016, a las 15:54, Alois Cochard <<a href="mailto:alois.cochard@gmail.com" target="_blank">alois.cochard@gmail.com</a>> escribió:<br><br></div><blockquote type="cite"><div><div dir="ltr">I don't have any use case like that. I'm in favor of this proposal for consistency sake.<div><br></div><div>That last part of my comment about usefulness/discouraging usage was about using Functor instance on tuple in general, no matter the arity. </div></div><div class="gmail_extra"><br><div class="gmail_quote">On 19 January 2016 at 21:32,  <span dir="ltr"><<a href="mailto:amindfv@gmail.com" target="_blank">amindfv@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="auto"><span><div></div><div>El 19 ene 2016, a las 10:24, Alois Cochard <<a href="mailto:alois.cochard@gmail.com" target="_blank">alois.cochard@gmail.com</a>> escribió:<br><br></div><blockquote type="cite"><div><div dir="ltr"><div>+1<br></div><div><br></div>Agree for consistency, I can also see those instances as being useful in some specific context, even if I agree with Andreas that in general they should be discouraged (especially for newcomers).<div><br></div></div></div></blockquote><div><br></div></span><div>Can you give us an example where using e.g. the Functor instance for a 5-tuple would be the correct/best design decision?</div><span><font color="#888888"><div><br></div><div>Tom</div></font></span><div><div><div><br></div><br><blockquote type="cite"><div><div class="gmail_extra"><br><div class="gmail_quote">On 19 January 2016 at 09:20, Herbert Valerio Riedel <span dir="ltr"><<a href="mailto:hvriedel@gmail.com" target="_blank">hvriedel@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On 2016-01-18 at 21:10:07 +0100, David Feuer wrote:<br>
> For some reason I really can't imagine, it seems the only tuple type<br>
> with a Functor instance is (,) a. I was astonished to find that<br>
><br>
> fmap (+1) (1,2,3)<br>
><br>
> doesn't work. Since this is *useful*, and there is *only one way to do<br>
> it*, I propose we add the following:<br>
><br>
> instance Functor ((,,) a b) where<br>
>   fmap f (a,b,c) = (a,b,f c)<br>
> instance Functor ((,,,) a b c) where<br>
>   fmap f (a,b,c,d) = (a,b,c,f d)<br>
> etc.<br>
<br>
</span>As stated elsewhere in this thread already, there is the issue about<br>
consistency. Here's a relevant section from the Haskell 2010 report[1]:<br>
<br>
> 6.1.4 Tuples<br>
><br>
> ...<br>
><br>
> However, every Haskell implementation must support tuples up to size<br>
> 15, together with the instances for Eq, Ord, Bounded, Read, and Show.<br>
<br>
IMO, we either have no `Functor` instances for tuples at all, or we have<br>
them for all tuples up to size 15. The current situations of having them<br>
defined only for 2-tuples is inconsistent.<br>
<br>
<br>
Cheers,<br>
  hvr<br>
<br>
 [1]: <a href="https://www.haskell.org/onlinereport/haskell2010/haskellch6.html#x13-1210006.1.4" rel="noreferrer" target="_blank">https://www.haskell.org/onlinereport/haskell2010/haskellch6.html#x13-1210006.1.4</a><br>
<div><div>_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr"><div><b>Λ\ois</b></div><div><div><a href="http://twitter.com/aloiscochard" target="_blank">http://twitter.com/aloiscochard</a></div><div><a href="http://github.com/aloiscochard" target="_blank">http://github.com/aloiscochard</a></div></div></div></div>
</div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Libraries mailing list</span><br><span><a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a></span><br><span><a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a></span><br></div></blockquote></div></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr"><div><b>Λ\ois</b></div><div><div><a href="http://twitter.com/aloiscochard" target="_blank">http://twitter.com/aloiscochard</a></div><div><a href="http://github.com/aloiscochard" target="_blank">http://github.com/aloiscochard</a></div></div></div></div>
</div>
</div></blockquote></div><br>_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
<br></blockquote></div>