<div dir="ltr">Hi,<div><br></div><div>Implementing a short-circuiting fold was already discussed in the haskell-cafe mailing list.<div><br></div><div><a href="https://mail.haskell.org/pipermail/haskell-cafe/2007-April/024171.html">https://mail.haskell.org/pipermail/haskell-cafe/2007-April/024171.html</a><br></div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 2, 2016 at 4:15 PM, Chul-Woong Yang <span dir="ltr"><<a href="mailto:cwyang@aranetworks.com" target="_blank">cwyang@aranetworks.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi, all.<br>
<br>
Can it be possible to do fold with short circuit and accumulator both?<br>
For example, can we find an element which is same value to adjacent one?<br>
<br>
findAdjacent [1,2..n, n, n+1, n+2.......] => n<br>
\__very long__/<br>
<br>
Though there can be many ways to do it, Can we do it with fold[r|l]?<br>
<br>
I'll be happy to receive any comments.<br>
<br>
Chul-Woong<br>
_______________________________________________<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-bin/mailman/listinfo/beginners</a><br>
</blockquote></div><br></div>