@wrap function in @singledispatch decorator