[Haskell-cafe] Generators? Iterators?
Michael Burge
michaelburge at pobox.com
Sat Apr 23 06:36:52 UTC 2016
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 <mle+hs at mega-nerd.com>
wrote:
> 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 at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20160422/4484ba81/attachment.html>
More information about the Haskell-Cafe
mailing list