[Haskell-beginners] Open-ended list comprehension

divyanshu ranjan idivyanshu.ranjan at gmail.com
Wed Mar 25 18:00:54 UTC 2015


Hi martin,

Check dlist (https://hackage.haskell.org/package/dlist-0.7.1.1).

On Wed, Mar 25, 2015 at 11:21 PM, martin <martin.drautzburg at web.de> wrote:

> Hello all,
>
> when I write my own recursions, I often end up with something like
>
> a : b : c : (f x)
>
> where f x returns a list. I assume this avoids the costly (++) function,
> right?
>
> But when I use list comprehensions I always get a complete list and it is
> costly to append something to it. How can I
> use the power of list comprehensions, but return an [a]->[a] instead of an
> [a]?
>
> Is this a good idea at all, or will I pile up thunks?
>
>
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20150325/fec4da7d/attachment.html>


More information about the Beginners mailing list