Function that returns a list or other sequence of sequential numbers

Is there a function (or standard idiom) within Daml that produces a list of sequential integers? What I’m looking for is something along the lines of:

seq 10

that returns:

[0 1 2 3 4 5 6 7 8 9]
1 Like

The usual way of doing that is via [0..9] which gives you the right thing. Under the hood that desugars to enumFromTo 0 9. You can also do [0,2..10] to only get even numbers for example.

5 Likes