Now I am experimenting with F # evaluation expressions. The general idea is to return a control mechanism for the actions performed after each step of the recursive assembly of a function call from a calculation expression. The whole example can be seen here .
Using the following example:
let rec loop () =
actor {
let! msg = m.Receive ()
match msg with
| "stop" -> return 0
| "unhandled" -> unhandled
| x ->
mailbox.Sender() <! x
return! loop ()
}
loop ()
Unfortunately, this ends with a compile-time error on unhandled
: the user operation may not be used in conjunction with 'use', 'try / with', 'try / finally', 'if / then / else' or 'match' in this calculation expression.
Is there any way to use custom operators inside matching operators?