FinalizerPtr's foreign function does not have to be restricted to the ccall calling convention, capi is fine too
The documentation says:
Note that the foreign function must use the ccall calling convention.
(https://hackage.haskell.org/package/base-4.18.0.0/docs/GHC-ForeignPtr.html#t:FinalizerPtr)
But we actually can use the capi
calling convention.