文档介绍:An Introduction to Generics of a Higher Kind in Scala Lukas Felber January 8, 2010 Abstract Scala is a general purpose programming language designed to ex- mon programming patterns in a concise, elegant, and type- safe way. It smoothly integrates features of object-oriented and func- tional languages. Compared to languages like Java, C# or C++, there are many new noteworthy features. In this article, one of those, namelygenerics of a higher Kind, will be introduced to you. This Scala feature introducesgeneric types as?rst class types. This is done by implementingtype constructor polymorphism. We discuss the limitations of other languages which are solved in Scala withtype constructor polymorphism, by explaining its basic con- cepts and providing signi?cant examples in Scala and Java. 1 Introduction This article contains code sequences in the programming language Scala and Java. I do expect that the reader has a basic knowledge of those two languages. Thus I will not give any language introduction and refer for un- experienced readers to [8] for Scala and [6] for Java language introductions. The information found in this paper origins mainly form the papers [5] and [4] which where both (co-) authored by Martin Odersky who is the creator of the Scala language at theSwiss Federal Institute of Technology (EPFL) in Lausanne, Switzerland. When looking at other literature which also discusseshigher kind gener- ics, there are cases where, what we here refer to asgeneric types, is called abstract type. These terms imply the same construct. Almost any papers which concerns itself withgenerics of a higher kind (. [5, 4]) uses as code example an implementation ofIterable. Since the subject at hand requires very speci?c code patterns, there is no other useful construct which pete againstIterablein means pactness, simplicity and high pro?le. This is the reason why also here in this paper, the example code will be a strongly simpli?edIterableimplementation. 1 In Section