
There were quite a few responses to you so far, but no one seemed to mention that what you actually asked for are called anamorphisms. https://en.wikipedia.org/wiki/Anamorphism https://en.wikipedia.org/wiki/Anamorphism They’re not a *class* per se (as in… they’re not a typeclass), but rather they’re a kind of higher-order function which we call unfold (the kind-of “opposite" action to a fold). Here’s a nice little thing I found which is quite helpful as an explanation: https://gist.github.com/CMCDragonkai/b586ee9ecce297ceeeb3 and Data.List has unfoldr: http://hackage.haskell.org/package/base-4.8.2.0/docs/Data-List.html#v:unfold... http://hackage.haskell.org/package/base-4.8.2.0/docs/Data-List.html#v:unfold... If you google around for either "anamorphism Haskell” or “unfold Haskell” you’ll find some nice explanatory resources. Hope that helps! Julian http://www.happylearnjavascripttutorial.com/ http://www.happylearnjavascripttutorial.com/ - begin programming with JavaScript today using our awesome new method! http://www.happylearnhaskelltutorial.com/ http://www.happylearnhaskelltutorial.com/ - begin programming with Haskell today using our awesome new method!
On 23 Apr 2016, at 10:00 PM, haskell-cafe-request@haskell.org wrote:
Hi. I'm more in the shallow end of the Haskell pool right now, so forgive me if this is really basic... In Haskell, what is the class for things that can provide an infinite sequence? I mean, things that produce a value as well as function for producing the next value? Clearly RandomGen does this, but what is the next level of abstraction above RandomGen (i.e., RandomGen minus the randomness aspect).