internalization/externalization for functions and typed arrays