Stream: beginners

Topic: List of range


view this post on Zulip Nick Hallstrom (Feb 13 2023 at 05:05):

Is there a simple way to generate a List of a range of numbers? Right now I just have pins = [0, 1, 2, 3, 4, 5, 6] which is mostly fine but I'm just wondering if there's something like List.range(0, 6) that I'm missing.

view this post on Zulip Brendan Hansknecht (Feb 13 2023 at 05:08):

https://www.roc-lang.org/builtins/List#range

view this post on Zulip Nick Hallstrom (Feb 13 2023 at 05:17):

Oh perfect, not sure how I missed that :sweat_smile: Is there a reason why some of the docs for builtin functions show their type annotation and others, like range, do not?

view this post on Zulip Brendan Hansknecht (Feb 13 2023 at 05:17):

bug?

view this post on Zulip Brendan Hansknecht (Feb 13 2023 at 05:18):

weird

view this post on Zulip Richard Feldman (Feb 13 2023 at 05:20):

yeah seems like a docs bug! Can you open an issue for that one?

view this post on Zulip Nick Hallstrom (Feb 13 2023 at 05:25):

https://github.com/roc-lang/roc/issues/5023

view this post on Zulip Richard Feldman (Feb 13 2023 at 05:38):

awesome, thanks!


Last updated: Jul 05 2025 at 12:14 UTC