Given a list, I would like to produce a second list of elements selected from the first one.
For example:
let l1 = [1..4]
let n = [0; 2]
l1.[n]
should return 1
and 3
, the first and third element of l1
.
Unfortunately, it returns an error:
error FS0001: This expression was expected to have type
int but here has type int list
Now, I wonder, does exist a way to pass an argument n
representing a list or, even better, an expression?