Parametric types: complex use of multiple parameters

This related discussion (although the question is about a more general case) might be useful: