I am trying to write a list comprehension in F# and can’t get it to compile:
[for x in xs do
let y = f(x)
when g(y) -> y]
Is there any way to save an intermediate computation in the middle of a list comprehension? How can I rework this list comprehension so that it compiles?
I would just skip the list comprehension.
However it is simple enough to get your code working.