COVARIANCE AND CONTRAVARIANCE: A FRESH LOOK AT AN OLD ISSUE (A PRIMER IN ADVANCED TYPE SYSTEMS FOR LEARNING FUNCTIONAL PROGRAMMERS)

LOGICAL METHODS IN COMPUTER SCIENCE(2020)

引用 3|浏览2
暂无评分
摘要
Twenty years ago, in an article titled "Covariance and contravariance: conflict without a cause", I argued that covariant and contravariant specialization of method parameters in object-oriented programming had different purposes and deduced that, not only they could, but actually they should both coexist in the same language. In this work I reexamine the result of that article in the light of recent advances in (sub-)typing theory and programming languages, taking a fresh look at this old issue. Actually, the revamping of this problem is just an excuse for writing an essay that aims at explaining sophisticated type-theoretic concepts, in simple terms and by examples, to undergraduate computer science students and/or willing functional programmers. Finally, I took advantage of this opportunity to describe some undocumented advanced techniques of type-systems implementation that are known only to few insiders that dug in the code of some compilers: therefore, even expert language designers and implementers may find this work worth of reading.
更多
查看译文
关键词
Object-oriented languages,type theory,subtyping,intersection types,overloading,semantic subtyping
AI 理解论文
溯源树
样例
生成溯源树,研究论文发展脉络
Chat Paper
正在生成论文摘要