Zulip Chat Archive
Stream: lean4
Topic: How can I generate a list of [0,1,...,n] from n?
Juneyoung Lee (Feb 14 2024 at 17:56):
This is a very naive question: given a nat n, how can I generate a list [0,1,..,n]?
Juneyoung Lee (Feb 14 2024 at 17:57):
Maybe [0,1,...,n-1] will be better, but either is fine.
Adam Topaz (Feb 14 2024 at 18:06):
Kyle Miller (Feb 14 2024 at 18:41):
As a moogle.ai test, I just fed your question directly into it and List.range
came up second, which is neat (thanks AI!)
Eric Wieser (Feb 14 2024 at 19:13):
@loogle Nat -> List Nat
loogle (Feb 14 2024 at 19:13):
:search: List.iota, List.iotaTR, and 26 more
Juneyoung Lee (Feb 14 2024 at 19:23):
Thanks all.
Last updated: May 02 2025 at 03:31 UTC