<div dir="ltr">+1 from me.</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 29, 2014 at 3:08 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="ltr"><div>We currently have (in Data.Foldable)<br><br>    foldr1 :: (a -> a -> a) -> t a -> a<br>    foldr1 f xs = fromMaybe (error "foldr1: empty structure")<br>                    (foldr mf Nothing xs)<br>      where<br>        mf x Nothing = Just x<br>        mf x (Just y) = Just (f x y)<br><br>and something similar for foldl1. This is strict in the entire spine, unlike the list version, because it has to get all the way to the end of the list before it starts laying down Justs. I propose we change this to the obvious:<br><br>    foldr1 :: (a -> a -> a) -> t a -> a<br>    foldr1 f xs = fromMaybe (error "foldr1: empty structure")<br>                    (foldr mf Nothing xs)<br>      where<br>        mf x r = Just $ case r of<br>                          Nothing -> x<br>                          Just y  -> f x y<br><br></div>Since GHC 7.10.1 is fast approaching, I doubt we have the usual two weeks to discuss this, so please speak up as soon as you can if you have concerns.<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888">

<p></p>

-- <br>
You received this message because you are subscribed to the Google Groups "haskell-core-libraries" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:haskell-core-libraries+unsubscribe@googlegroups.com" target="_blank">haskell-core-libraries+unsubscribe@googlegroups.com</a>.<br>
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank">https://groups.google.com/d/optout</a>.<br>
</font></span></blockquote></div><br></div>