tag:blogger.com,1999:blog-8130326826065983217.post2714239774002286245..comments2014-04-29T08:47:45.508+02:00Comments on splonderzoek: Incremental fold, a design patternAnonymoushttp://www.blogger.com/profile/02951502639017426632noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-8130326826065983217.post-11978758250789576732009-04-02T12:29:00.000+02:002009-04-02T12:29:00.000+02:00@Leon:You're right. Thanks for your persistence. I...@Leon:<BR/><BR/>You're right. Thanks for your persistence. I fixed it in the <A HREF="http://github.com/spl/splonderzoek/blob/ca2f7ee3c2cce215809ab24418a52f836390debf/IncrementalTreeFold.lhs" REL="nofollow">code</A>.<BR/><BR/>I wonder how it got there. I thought I checked 'filter'. Oh well. I'm not quite willing to put the effort forth of write QuickCheck tests for blog posts. ;)Anonymoushttps://www.blogger.com/profile/02951502639017426632noreply@blogger.comtag:blogger.com,1999:blog-8130326826065983217.post-46481704591559289682009-04-02T03:06:00.000+02:002009-04-02T03:06:00.000+02:00Hmm, when I type this into ghci:> if True the...Hmm, when I type this into ghci:<BR/><BR/>> if True then [1] else [2] ++ [3]<BR/><BR/>It spits out<BR/><BR/>[1]<BR/><BR/>not<BR/><BR/>[1,3]<BR/><BR/>as you would like.<BR/><BR/>(In all fairness, I did have to run that experiment myself before I commented, so I wasn't sure off the top of my head.)Unknownhttps://www.blogger.com/profile/06462854866941248768noreply@blogger.comtag:blogger.com,1999:blog-8130326826065983217.post-22022787889629797442009-03-13T10:41:00.000+01:002009-03-13T10:41:00.000+01:00@Leon: There are multiple ideas about the meaning ...@Leon: There are multiple ideas about the meaning of "incremental," of course. This is just one.<BR/><BR/>I don't think the if-then-else needs parentheses. It appears okay to me. The (++) has lower precedence, so it evaluates to [x] ++ lr ++ rr (for f x == True) or [] ++ lr ++ rr (for f x == False).Anonymoushttps://www.blogger.com/profile/02951502639017426632noreply@blogger.comtag:blogger.com,1999:blog-8130326826065983217.post-39761437314648963272009-03-13T07:03:00.000+01:002009-03-13T07:03:00.000+01:00Nice article. You use a slightly different notio...Nice article. You use a slightly different notion of "incremental" than I tend to use, but it's a useful notion.<BR/><BR/>I think you have a bug in your definition of filter. Don't you need parentheses around your if-then-else?Unknownhttps://www.blogger.com/profile/06462854866941248768noreply@blogger.comtag:blogger.com,1999:blog-8130326826065983217.post-10984781947981135962009-03-03T20:22:00.000+01:002009-03-03T20:22:00.000+01:00Interesting, I wonder if the notion of Measurement...Interesting, I wonder if the notion of <I>Measurements</I> in the Finger Trees of Hinze and Paterson satisfies as the general implementation of you design pattern. It was trivial to implement my incremental map using them.dfplacehttps://www.blogger.com/profile/16613008230060088658noreply@blogger.com