F# Equivalent of Destructor
问题 I am translating a C# class that wraps an unmanaged library to F#. I have run into the seemingly simple problem of rewriting the destructor that follows. class Wrapper { // P/Invoke ellided private SomeType x; public Wrapper() { x = new SomeType(); Begin(); } public ~Wrapper() { End(); } The simplified F# code I have at this point is as follows: type Wrapper() = [<Literal>] static let wrappedDll = "Library.dll" [<DllImport(wrappedDll , EntryPoint = "Begin")>] static extern void Begin() [