Purescript FFI with runtime-type-checking in the style of Data.Function