<div dir="ltr">I actually think the terminology may be the issue here: it's not tough to think of cases where one might need to use (sum . fmap (const 1) :: (Functor t, Foldable t) => t a -> Int), and it's also not tough to think of cases where the term "length" doesn't fit everyone's expectation for what that function does. On the other hand, there isn't really any other Foldable-based implementation of 'length' that you can write.</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 24, 2017 at 8:34 AM, <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"><span class=""><br>
<br>
> El 24 abr 2017, a las 03:20, David Thomas <<a href="mailto:davidleothomas@gmail.com">davidleothomas@gmail.com</a>> escribió:<br>
><br>
> One thing that's been missed in this discussion is that constraints<br>
> can propagate.<br>
><br>
> Of course no one is wanting to pass something they know is a tuple<br>
> into a function they know is length. But a function that expects<br>
> something Foldable might want to know length or sum, and it might be<br>
> reasonable to call that function on a tuple.<br>
><br>
<br>
</span>Do you have a real-world example of a case where that's useful, and difficult to achieve in another (non-Foldable) way?<br>
<br>
Genuinely asking, so that when we talk about what's gained/lost we have something concrete to talk about.<br>
<span class="HOEnZb"><font color="#888888"><br>
Tom<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
<br>
> On Sun, Apr 23, 2017 at 11:52 PM, Jonathon Delgado<br>
> <<a href="mailto:voldermort@hotmail.com">voldermort@hotmail.com</a>> wrote:<br>
>> Tony Morris - please could you give a (practical) example of code where the a tuple could realistically be passed to length, but you don't know what the answer will be at compile time?<br>
>><br>
>> Michael Orlitzky - everything in .NET has to descend from Object because of it's OO design. Why does tuple have to implement Foldable if it doesn't provide any useful functions?<br>
>><br>
>> Thank you very much everyone in this thread for helping me understand!<br>
>> ______________________________<wbr>_________________<br>
>> Beginners mailing list<br>
>> <a href="mailto:Beginners@haskell.org">Beginners@haskell.org</a><br>
>> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/beginners</a><br>
> ______________________________<wbr>_________________<br>
> Beginners mailing list<br>
> <a href="mailto:Beginners@haskell.org">Beginners@haskell.org</a><br>
> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/beginners</a><br>
______________________________<wbr>_________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org">Beginners@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/beginners</a><br>
</div></div></blockquote></div><br></div>