Why is f # user operation not allowed in control flow instruction?

Using a custom operation of an expression to evaluate f # inside any control flow statement fails type checking with

error FS3086: A custom operation may not be used in conjunction with 'use',
'try/with', 'try/finally', 'if/then/else' or 'match' operators within this
computation expression

Why is this not allowed? What is in a user operation that does not allow rewriting this:

expr {
    if a then
        custom (x)
    else
        return (y)
}

like that:

expr {
    return! 
        if a then
            expr { custom (x) }
        else
            expr { return (y) }
}
+6
source share

Source: https://habr.com/ru/post/1687893/


All Articles