tag:blogger.com,1999:blog-7094652.post2787681951404526302..comments2024-03-13T10:20:27.668+00:00Comments on Neil Mitchell's Blog (Haskell etc): Progress Reporting in ShakeNeil Mitchellhttp://www.blogger.com/profile/13084722756124486154noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-7094652.post-62568010292392226902013-12-13T19:54:48.331+00:002013-12-13T19:54:48.331+00:00I happen to be lucky that this isn't in any wa...I happen to be lucky that this isn't in any way performance critical, far more important to be concise.<br /><br />I have now renamed Stream to Mealy in my code, to match the machines package.Neil Mitchellhttps://www.blogger.com/profile/13084722756124486154noreply@blogger.comtag:blogger.com,1999:blog-7094652.post-7812978038042079302013-12-13T06:50:54.886+00:002013-12-13T06:50:54.886+00:00You can get GHC to optimize that sort of Stream mu...You can get GHC to optimize that sort of Stream much more efficiently using an explicit existential.<br /><br />I talked a bit about that here: https://www.fpcomplete.com/user/edwardk/cellular-automata/part-2 Edward Kmetthttps://www.blogger.com/profile/16144424873202502715noreply@blogger.comtag:blogger.com,1999:blog-7094652.post-59146841791737274122013-12-12T23:42:21.125+00:002013-12-12T23:42:21.125+00:00I'm not familiar with a package that provides ...I'm not familiar with a package that provides just your Stream abstraction, but variants of it are extremely common. They underlie Yampa and Netwire, for example (it's more apparent in older releases). And for that matter, the iteratee-style packages do something quite similar.<br /><br />The fundamental problem (from my perspective) is that they're recursive data structures, which ghc doesn't optimize as well as one would like. But nevertheless they're a powerful abstraction.Anonymoushttps://www.blogger.com/profile/14086288462709102194noreply@blogger.comtag:blogger.com,1999:blog-7094652.post-27202494652067816752013-12-12T21:31:54.856+00:002013-12-12T21:31:54.856+00:00Brent: Thanks for the pointer, I think their unfol...Brent: Thanks for the pointer, I think their unfoldMealy is a generalisation of my foldStream, which might turn out to be easier to define some of my functions in terms of.Neil Mitchellhttps://www.blogger.com/profile/13084722756124486154noreply@blogger.comtag:blogger.com,1999:blog-7094652.post-40428299965612665122013-12-12T21:17:57.130+00:002013-12-12T21:17:57.130+00:00Cool stuff! Your Streams are also called "me...Cool stuff! Your Streams are also called "mealy machines". See e.g. http://hackage.haskell.org/package/machines-0.2.3.1/docs/Data-Machine-Mealy.html (though I confess I have never been able to figure out how to use the machines package).Brenthttps://www.blogger.com/profile/14440861005012132386noreply@blogger.com