<div dir="ltr">Sadly, doing so in Data.List would lead to massive breakage as Data.List is specified by the report and is very, very widely imported unqualified just to get at things like sort.<div><br></div><div>-Edward</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 2, 2017 at 2:28 PM, David Feuer <span dir="ltr"><<a href="mailto:david.feuer@gmail.com" target="_blank">david.feuer@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">Yes. That is an excellent plan. I'd love to call it Data.List, but others will disagree.</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mar 2, 2017 2:17 PM, "Andreas Abel" <<a href="mailto:andreas.abel@ifi.lmu.de" target="_blank">andreas.abel@ifi.lmu.de</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">We could have a module<br>
<br>
Data.List.ReallyJustListsAndNo<wbr>tSomeThingMoreGeneric<br>
<br>
which implements concat and friends just for lists and could be imported if one wants to have the list operations. Currently,<br>
<br>
import qualified Data.List as List<br>
<br>
does not give on the list operations as e.g.<br>
<br>
List.concat<br>
<br>
but the generic ones.<br>
<br>
See also <a href="http://ghc.haskell.org/trac/ghc/ticket/13345" rel="noreferrer" target="_blank">http://ghc.haskell.org/trac/gh<wbr>c/ticket/13345</a><br>
<br>
On 02.03.2017 20:02, Edward Kmett wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
On Thu, Mar 2, 2017 at 11:59 AM, Andreas Abel <<a href="mailto:andreas.abel@ifi.lmu.de" target="_blank">andreas.abel@ifi.lmu.de</a><br>
<mailto:<a href="mailto:andreas.abel@ifi.lmu.de" target="_blank">andreas.abel@ifi.lmu.d<wbr>e</a>>> wrote:<br>
<br>
Ok, Foldable is a formal condition for Traversable, but not actually<br>
used in the implementation of Traversable Either. This still leaves<br>
room to implement Foldable for Either by<br>
<br>
instance Foldable (Either a) where<br>
foldMap _ _ = error "Folding Either? Naah, I don't think this<br>
is a good idea."<br>
<br>
<br>
This would change the semantic of every<br>
<br>
forM_ myeither $ \i -> ....<br>
<br>
in existing code to silent errors.<br>
<br>
Hell no.<br>
<br>
-Edward<br>
<br>
<br>
On 02.03.2017 17:48, David Feuer wrote:<br>
<br>
The problem is that we'd then lose the perfectly good Traversable<br>
instance, which would be sad.<br>
<br>
On Mar 2, 2017 11:23 AM, "Andreas Abel" <<a href="mailto:andreas.abel@ifi.lmu.de" target="_blank">andreas.abel@ifi.lmu.de</a><br>
<mailto:<a href="mailto:andreas.abel@ifi.lmu.de" target="_blank">andreas.abel@ifi.lmu.d<wbr>e</a>><br>
<mailto:<a href="mailto:andreas.abel@ifi.lmu.de" target="_blank">andreas.abel@ifi.lmu.d<wbr>e</a><br>
<mailto:<a href="mailto:andreas.abel@ifi.lmu.de" target="_blank">andreas.abel@ifi.lmu.d<wbr>e</a>>>> wrote:<br>
<br>
Today a student came to me wondering why a certain function<br>
produced<br>
a regular result, where he had expected an error. Turned<br>
out he had<br>
used `concat`, but not on a lists of lists as he had<br>
thought, but on<br>
a lists of `Either a [b]`.<br>
<br>
With the Foldable instance for Either, which considers<br>
Either a b to<br>
be a container of 0-1 elements of b, errors are happily<br>
swallowed.<br>
<br>
I think this instance is harmful and should be deprecated<br>
(and later<br>
removed) from base.<br>
<br>
There are similarly pointless Foldable instances as well.<br>
<br>
See a discussion one year ago, which was heated, but had no<br>
consequences.<br>
<br>
<br>
<a href="https://mail.haskell.org/pipermail/libraries/2016-February/026678.html" rel="noreferrer" target="_blank">https://mail.haskell.org/piper<wbr>mail/libraries/2016-February/0<wbr>26678.html</a><br>
<<a href="https://mail.haskell.org/pipermail/libraries/2016-February/026678.html" rel="noreferrer" target="_blank">https://mail.haskell.org/pipe<wbr>rmail/libraries/2016-February/<wbr>026678.html</a>><br>
<br>
<<a href="https://mail.haskell.org/pipermail/libraries/2016-February/026678.html" rel="noreferrer" target="_blank">https://mail.haskell.org/pipe<wbr>rmail/libraries/2016-February/<wbr>026678.html</a><br>
<<a href="https://mail.haskell.org/pipermail/libraries/2016-February/026678.html" rel="noreferrer" target="_blank">https://mail.haskell.org/pipe<wbr>rmail/libraries/2016-February/<wbr>026678.html</a>>><br>
<br>
<br>
--<br>
Andreas Abel <>< Du bist der geliebte Mensch.<br>
<br>
Department of Computer Science and Engineering<br>
Chalmers and Gothenburg University, Sweden<br>
<br>
<a href="mailto:andreas.abel@gu.se" target="_blank">andreas.abel@gu.se</a> <mailto:<a href="mailto:andreas.abel@gu.se" target="_blank">andreas.abel@gu.se</a>><br>
<mailto:<a href="mailto:andreas.abel@gu.se" target="_blank">andreas.abel@gu.se</a> <mailto:<a href="mailto:andreas.abel@gu.se" target="_blank">andreas.abel@gu.se</a>>><br>
<a href="http://www.cse.chalmers.se/~abela/" rel="noreferrer" target="_blank">http://www.cse.chalmers.se/~ab<wbr>ela/</a><br>
<<a href="http://www.cse.chalmers.se/~abela/" rel="noreferrer" target="_blank">http://www.cse.chalmers.se/~a<wbr>bela/</a>><br>
<<a href="http://www.cse.chalmers.se/~abela/" rel="noreferrer" target="_blank">http://www.cse.chalmers.se/~a<wbr>bela/</a><br>
<<a href="http://www.cse.chalmers.se/~abela/" rel="noreferrer" target="_blank">http://www.cse.chalmers.se/~a<wbr>bela/</a>>><br>
______________________________<wbr>_________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a> <mailto:<a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a>><br>
<mailto:<a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a> <mailto:<a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a>><wbr>><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bi<wbr>n/mailman/listinfo/libraries</a><br>
<<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-b<wbr>in/mailman/listinfo/libraries</a>><br>
<<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-b<wbr>in/mailman/listinfo/libraries</a><br>
<<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-b<wbr>in/mailman/listinfo/libraries</a>><wbr>><br>
<br>
<br>
<br>
--<br>
Andreas Abel <>< Du bist der geliebte Mensch.<br>
<br>
Department of Computer Science and Engineering<br>
Chalmers and Gothenburg University, Sweden<br>
<br>
<a href="mailto:andreas.abel@gu.se" target="_blank">andreas.abel@gu.se</a> <mailto:<a href="mailto:andreas.abel@gu.se" target="_blank">andreas.abel@gu.se</a>><br>
<a href="http://www.cse.chalmers.se/~abela/" rel="noreferrer" target="_blank">http://www.cse.chalmers.se/~ab<wbr>ela/</a> <<a href="http://www.cse.chalmers.se/~abela/" rel="noreferrer" target="_blank">http://www.cse.chalmers.se/~a<wbr>bela/</a>><br>
______________________________<wbr>_________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a> <mailto:<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-bi<wbr>n/mailman/listinfo/libraries</a><br>
<<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-b<wbr>in/mailman/listinfo/libraries</a>><br>
<br>
<br>
</blockquote>
<br>
<br>
-- <br>
Andreas Abel <>< Du bist der geliebte Mensch.<br>
<br>
Department of Computer Science and Engineering<br>
Chalmers and Gothenburg University, Sweden<br>
<br>
<a href="mailto:andreas.abel@gu.se" target="_blank">andreas.abel@gu.se</a><br>
<a href="http://www.cse.chalmers.se/~abela/" rel="noreferrer" target="_blank">http://www.cse.chalmers.se/~ab<wbr>ela/</a><br>
</blockquote></div></div>
</div></div></blockquote></div><br></div>