Function that returns a list or other sequence of sequential numbers
- Michael_SchaefferOP 1
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 10that returns:
[0 1 2 3 4 5 6 7 8 9] - cocreature 5
The usual way of doing that is via
[0..9]which gives you the right thing. Under the hood that desugars toenumFromTo 0 9. You can also do[0,2..10]to only get even numbers for example.