Is there a way to define a procedure so that it takes input with type parameters, and returns output depending on the type parameters?