Stream: beginners

Topic: List comprehension


view this post on Zulip Sky (Aug 13 2025 at 01:40):

I was wondering how I would go about doing list comprehension in roc. As a problem I was working on would benifit from describing a list where i can pull items off it.

view this post on Zulip Brendan Hansknecht (Aug 13 2025 at 01:44):

Wouldn't list comprehensions be some form of List.map?

view this post on Zulip Sky (Aug 13 2025 at 01:52):

True! Maybe a map with index?

view this post on Zulip Sky (Aug 13 2025 at 02:37):

I realize the error in my explanation, what i was looking for was building lazy lists.

view this post on Zulip Anton (Aug 13 2025 at 09:54):

Hi @Sky,
We don't have builtin lazy list support but you can construct your own. Can you share what specifically you are trying to do? I may be able to recommend a non lazy solution.


Last updated: Aug 17 2025 at 12:14 UTC