
There's Foldable for 'things that can be converted to lists', or
Traversable for 'things that can be converted to lists underneath a
Functor'.
https://wiki.haskell.org/Foldable_and_Traversable
On Fri, Apr 22, 2016 at 10:47 PM, Erik de Castro Lopo
Christopher Howard 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?
People generally do this with lists and Haskell's lazy evaluation. For instance:
let x = [1 .. ]
produces the infinite list [1,2,3, .....].
Haskell's lazily evaluated lists allow for incredibly elegant solutions for some sorts of problems, like the spigot algorithm for generating (among other things) the digits of PI:
http://www.cs.ox.ac.uk/people/jeremy.gibbons/publications/spigot.pdf
Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/ _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe