Create an ndarray function interface which accepts a callback function and performs multiple dispatch.