This article is about polymorphic type systems in computer science. For the mathematical class of order-types of a given cardinality, see Glossary of set theory § T.
Not to be confused with class (computer programming).
In computer science, a type class is a type system construct that supports ad hoc polymorphism. This is achieved by adding constraints to type variables in parametrically polymorphic types. Such a constraint typically involves a type class T and a type variable a, and means that a can only be instantiated to a type whose members support the overloaded operations associated with T.
Type classes were first implemented in the Haskell programming language after first being proposed by Philip Wadler and Stephen Blott as an extension to "eqtypes" in Standard ML,[1][2] and were originally conceived as a way of implementing overloaded arithmetic and equality operators in a principled fashion.[3][2]
In contrast with the "eqtypes" of Standard ML, overloading the equality operator through the use of type classes in Haskell does not require extensive modification of the compiler frontend or the underlying type system.[4]
^Morris, John G. (2013). Type Classes and Instance Chains: A Relational Approach(PDF) (PhD). Department of Computer Science, Portland State University. doi:10.15760/etd.1010.
^ abWadler, P.; Blott, S. (1989). "How to make ad-hoc polymorphism less ad hoc". Proceedings of the 16th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL '89). Association for Computing Machinery. pp. 60–76. doi:10.1145/75277.75283. ISBN 0897912942. S2CID 15327197.
^Kaes, Stefan (March 1988). "Parametric overloading in polymorphic programming languages". Proc. 2nd European Symposium on Programming Languages. doi:10.1007/3-540-19027-9_9.
^Appel, A.W.; MacQueen, D.B. (1991). "Standard ML of New Jersey". In Maluszyński, J.; Wirsing, M. (eds.). Programming Language Implementation and Logic Programming. PLILP 1991. Lecture Notes in Computer Science. Vol. 528. Springer. pp. 1–13. CiteSeerX 10.1.1.55.9444. doi:10.1007/3-540-54444-5_83. ISBN 3-540-54444-5.
computer science, a typeclass is a type system construct that supports ad hoc polymorphism. This is achieved by adding constraints to type variables in parametrically...
A, F, G, K, and M, a sequence from the hottest (O type) to the coolest (M type). Each letter class is then subdivided using a numeric digit with 0 being...
The Type 037 corvette is a series 400–500 ton corvette typeclasses in service with the People's Liberation Army Navy. Unlike western navies, the People's...
The Type 212A is a class of diesel-electric submarine developed by Howaldtswerke-Deutsche Werft AG (HDW) for the German Navy (German: U-Boot-Klasse 212...
The Type 23 frigate or Duke class is a class of frigates built for the United Kingdom's Royal Navy. The ships are named after British Dukes, thus leading...
The Type 094 (Chinese: 09-IV型核潜艇; Chinese designation: 09-IV; NATO reporting name: Jin class) is a class of nuclear ballistic missile submarines developed...
The Type 31 frigate, also known as the Inspiration class, and formerly known as the Type 31e frigate or General Purpose Frigate (GPF), is a class of five...
Type 062 gunboat is a class of gunboat of the People's Liberation Army Navy first developed and constructed in the 1950s. This unsophisticated class is...
The Type 42 or Sheffield class, was a class of fourteen guided-missile destroyers that served in the Royal Navy. A further two ships of this class were...
The Type 22 frigate also known as the Broadsword class was a class of frigates built for the British Royal Navy. Fourteen were built in total, with production...
The Type 055 destroyer (NATO/OSD designation Renhai-class cruiser) is a class of stealth guided-missile destroyers (rated as guided-missile cruisers per...
Shandong's class was initially suspected to be designated Type 001A (as Liaoning received the designation Type 001) but was revealed to be Type 002 at its...
The Type 093 submarine (NATO reporting name: Shang class) is a class of nuclear-powered attack submarines constructed by the People's Republic of China...
The British Rail Class 37 is a diesel-electric locomotive. Also known as the English Electric Type 3, the class was ordered as part of the British Rail...
The Type 092 (Chinese designation: 09-II; NATO reporting name: Xia class) submarine was the first nuclear-powered ballistic missile submarine (SSBN) deployed...
The Type 1936A destroyers, also known as the Z23 class, were a group of fifteen destroyers built for the Nazi Germany's Kriegsmarine from 1938 to 1943...
exclusively for export by Howaldtswerke-Deutsche Werft of Germany. Five class variants (Types 209/1100, 209/1200, 209/1300, 209/1400 and 209/1500), including...
generalized algebraic data type (GADT, also first-class phantom type, guarded recursive datatype, or equality-qualified type) is a generalization of parametric...
The Type 22 (NATO designation: Houbei class) missile boat is a ship class in the Chinese People's Liberation Army Navy. The first boat was launched in...
The Type 039A submarine (NATO reporting name: Yuan class) is a class of diesel-electric submarine in China's People's Liberation Army Navy. It is China's...
individuals or objects Class (philosophy), an analytical concept used differently from such group phenomena as "types" or "kinds" Class (set theory), a collection...
The Type 054 (NATO Codename Jiangkai I) is a class of Chinese multi-role frigates that were commissioned in the People's Liberation Army Navy Surface Force...
The Type 056 corvette (NATO reporting name: Jiangdao-class corvette) is a class of littoral combat-oriented corvette (designated natively as "light frigate")...
The Type 074 landing ship (NATO reporting name: Yuhai-class) is a class of landing ship medium (LSM) of the People's Liberation Army Navy. They were built...
The Type 212CD class (for Common Design) is a submarine class developed by ThyssenKrupp Marine Systems (TKMS) for the Norwegian and German navies. The...