
23 Apr
2016
23 Apr
'16
5:47 a.m.
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/