<div>Agreed. There's better ways of integrating linear types into core. <br><div class="gmail_quote"><div>On Wed, Jan 25, 2017 at 10:56 PM David Feuer <<a href="mailto:david.feuer@gmail.com">david.feuer@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I do not like the idea of linearity being a *syntactic* construct<br class="gmail_msg">
rather than part of the type system. It seems likely to end up<br class="gmail_msg">
limiting us in confusing ways. Also, I like types. But that's really<br class="gmail_msg">
not relevant to this discussion.<br class="gmail_msg">
<br class="gmail_msg">
On Wed, Jan 25, 2017 at 10:31 PM, Joe Hillenbrand <<a href="mailto:joehillen@gmail.com" class="gmail_msg" target="_blank">joehillen@gmail.com</a>> wrote:<br class="gmail_msg">
> Would you care to elaborate?<br class="gmail_msg">
><br class="gmail_msg">
> On Wed, Jan 25, 2017 at 6:34 PM, David Feuer <<a href="mailto:david.feuer@gmail.com" class="gmail_msg" target="_blank">david.feuer@gmail.com</a>> wrote:<br class="gmail_msg">
>> I doubt it very much, and some of us have serious doubts about the<br class="gmail_msg">
>> extension as it stands.<br class="gmail_msg">
>><br class="gmail_msg">
>> On Wed, Jan 25, 2017 at 8:58 PM, Joe Hillenbrand <<a href="mailto:joehillen@gmail.com" class="gmail_msg" target="_blank">joehillen@gmail.com</a>> wrote:<br class="gmail_msg">
>>> Would the (hopeful) imminent linear types extension help here?<br class="gmail_msg">
>>><br class="gmail_msg">
>>> On Wed, Jan 25, 2017 at 4:24 PM, Edward Kmett <<a href="mailto:ekmett@gmail.com" class="gmail_msg" target="_blank">ekmett@gmail.com</a>> wrote:<br class="gmail_msg">
>>>> The current intent based on the ghc ticket traffic is to switch the<br class="gmail_msg">
>>>> implementation to foldl1 for the next release as a stopgap, but leave the<br class="gmail_msg">
>>>> door open to do something smarter in the future.<br class="gmail_msg">
>>>><br class="gmail_msg">
>>>> The current foldr1 implementation is simply never a win, and a monoidal<br class="gmail_msg">
>>>> version devolves to a right fold for lists with the same bad behavior.<br class="gmail_msg">
>>>><br class="gmail_msg">
>>>> If we later on figure out a way to efficiently exploit a strict monoidal<br class="gmail_msg">
>>>> accumulator for monoids that don't benefit from short-circuiting then a<br class="gmail_msg">
>>>> number of current Foldable combinators could benefit including this one, so<br class="gmail_msg">
>>>> we definitely want to leave the door open to doing things better in the<br class="gmail_msg">
>>>> future, but for now the left fold is an easy improvement over the status<br class="gmail_msg">
>>>> quo.<br class="gmail_msg">
>>>><br class="gmail_msg">
>>>> -Edward<br class="gmail_msg">
>>>><br class="gmail_msg">
>>>> On Wed, Jan 25, 2017 at 6:50 PM, David Laing <<a href="mailto:dave.laing.80@gmail.com" class="gmail_msg" target="_blank">dave.laing.80@gmail.com</a>><br class="gmail_msg">
>>>> wrote:<br class="gmail_msg">
>>>>><br class="gmail_msg">
>>>>> Hi all,<br class="gmail_msg">
>>>>><br class="gmail_msg">
>>>>> I'm proposing that the implementations of minimumBy and maximumBy be<br class="gmail_msg">
>>>>> changed from using foldl1 to foldr1.<br class="gmail_msg">
>>>>><br class="gmail_msg">
>>>>> I found this in a GHC trac ticket[0] labelled 'Newcomer' that has more<br class="gmail_msg">
>>>>> details / discussion on that.<br class="gmail_msg">
>>>>><br class="gmail_msg">
>>>>> The points that stand out to me are:<br class="gmail_msg">
>>>>> - the Haskell report says that those methods should be implemented in<br class="gmail_msg">
>>>>> terms of foldl1 (although as instance methods of Foldable there might be<br class="gmail_msg">
>>>>> some wiggle room there)<br class="gmail_msg">
>>>>> - it helps solves a space leak (which at first glance feels like it might<br class="gmail_msg">
>>>>> be a more common problem than the options that foldl1 removes)<br class="gmail_msg">
>>>>> - from the discussion on the ticket, it seemed to be an agreeable middle<br class="gmail_msg">
>>>>> ground<br class="gmail_msg">
>>>>><br class="gmail_msg">
>>>>> As a side note: there have been a few proposals in the past to switch<br class="gmail_msg">
>>>>> these functions to use foldl', which seemed to have stalled. I don't know<br class="gmail_msg">
>>>>> what the etiquette is around bringing up minor variations on old proposals<br class="gmail_msg">
>>>>> again, so I apologise if I've breached some kind of protocol here.<br class="gmail_msg">
>>>>><br class="gmail_msg">
>>>>> Although I guess I've already breached one protocol by pushing a patch to<br class="gmail_msg">
>>>>> Phabricator for review without getting sign-off from the Core Libraries<br class="gmail_msg">
>>>>> Committee, so at least I'm being even handed with my clumsiness :)<br class="gmail_msg">
>>>>><br class="gmail_msg">
>>>>> Cheers,<br class="gmail_msg">
>>>>><br class="gmail_msg">
>>>>> Dave<br class="gmail_msg">
>>>>><br class="gmail_msg">
>>>>> [0] <a href="https://ghc.haskell.org/trac/ghc/ticket/10830" rel="noreferrer" class="gmail_msg" target="_blank">https://ghc.haskell.org/trac/ghc/ticket/10830</a><br class="gmail_msg">
>>>>><br class="gmail_msg">
>>>>><br class="gmail_msg">
>>>>> _______________________________________________<br class="gmail_msg">
>>>>> Libraries mailing list<br class="gmail_msg">
>>>>> <a href="mailto:Libraries@haskell.org" class="gmail_msg" target="_blank">Libraries@haskell.org</a><br class="gmail_msg">
>>>>> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" class="gmail_msg" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br class="gmail_msg">
>>>>><br class="gmail_msg">
>>>><br class="gmail_msg">
>>>><br class="gmail_msg">
>>>> _______________________________________________<br class="gmail_msg">
>>>> Libraries mailing list<br class="gmail_msg">
>>>> <a href="mailto:Libraries@haskell.org" class="gmail_msg" target="_blank">Libraries@haskell.org</a><br class="gmail_msg">
>>>> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" class="gmail_msg" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br class="gmail_msg">
>>>><br class="gmail_msg">
>>> _______________________________________________<br class="gmail_msg">
>>> Libraries mailing list<br class="gmail_msg">
>>> <a href="mailto:Libraries@haskell.org" class="gmail_msg" target="_blank">Libraries@haskell.org</a><br class="gmail_msg">
>>> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" class="gmail_msg" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br class="gmail_msg">
_______________________________________________<br class="gmail_msg">
Libraries mailing list<br class="gmail_msg">
<a href="mailto:Libraries@haskell.org" class="gmail_msg" target="_blank">Libraries@haskell.org</a><br class="gmail_msg">
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" class="gmail_msg" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br class="gmail_msg">
</blockquote></div></div>