Is there a way one can get a range in descending order?
Ex
[1..4]
evaluates to
> val it : int list = [1; 2; 3; 4]
But
[4..1]
evaluates to
> val it : int list = []
Is there a different syntax to achive this without having to do a List.Reverse
?
You have to do:
[4..-1..1]
The -1 is the step
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With