A Functional Approach to Type Constraints of Generic Definitions

Abstract

This paper addresses a frequently encountered problem related to type constraints in many contemporary strongly typed object-oriented languages. The problem is that type parameters are often more strongly constrained than is actually needed. As a consequence, reusability of the whole generic definition is limited even when those constraints are only for a portion of the operations it provides. A useful programming idiom to remedy this problem is proposed. It mitigates the problem by moving some of type constraints from the generic definitions to the clients. The only tool required to aid the idiom is the functional parameter.

DOI: 10.1145/261353.261360

Extracted Key Phrases

Cite this paper

@article{Kim1997AFA, title={A Functional Approach to Type Constraints of Generic Definitions}, author={Myung Ho Kim}, journal={SIGPLAN Notices}, year={1997}, volume={32}, pages={45-52} }