Implement mapping to generic types.