As far as I know, F # does not actually implement / does not use / does not open the filter handlers available in MSIL (ECMA-335, 5th ed., Section I, section 12.4.2 "Exception Handling"). According to section 6.9.21 of the F # 3.0 specification, the compiler must compile the whole with clause into a catch ; the "reset" case is added to the compiled code, so if the excluded catch does not match any of the patterns in the with clause, it is re-raised (via the rethrow IL rethrow ).
However, I would really like F # to support lower-level IL / CLR constructs - they are often not used, but sometimes they provide the only way to implement something correctly or avoid the need for complex workarounds; and, as with the OP, it is important that F # supports them to ensure compatibility. For example, try...fault will actually be convenient for logging, and this will simplify some bits of code that try...finally should use with additional logic (for example, the implementation of lock in FSharp.Core ).
UPDATE: I was just looking for information on a completely different topic and came across this post since 2006 on the blog Don: F # 1.1.13 is now available! (also see accompanying release notes ). Of course, F # 1.1.13 was a very early version of the language, and at that time it was quite experimental, but it is interesting to see that the compiler had a switch --generate-filter-blocks .
Jack P.
source share