[Haskell-beginners] foldr with short circuit and accumulator

KwangYul Seo kwangyul.seo at gmail.com
Tue Feb 2 09:03:00 UTC 2016


Implementing a short-circuiting fold was already discussed in the
haskell-cafe mailing list.


On Tue, Feb 2, 2016 at 4:15 PM, Chul-Woong Yang <cwyang at aranetworks.com>

> Hi, all.
> Can it be possible to do fold with short circuit and accumulator both?
> For example, can we find an element which is same value to adjacent one?
> findAdjacent [1,2..n, n, n+1, n+2.......] => n
>                          \__very long__/
> Though there can be many ways to do it, Can we do it with fold[r|l]?
> I'll be happy to receive any comments.
> Chul-Woong
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20160202/ac929659/attachment.html>

More information about the Beginners mailing list