Add helper to find out whether type is a functor type and fetch its return type and arguments.