Type Class

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 first appeared in the Haskell programming language, and were originally conceived as a way of implementing overloaded arithmetic and equality operators in a principled fashion. 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.

Since their creation, many other applications of type classes have been discovered.

Read more about Type Class:  Overview, Higher-kinded Polymorphism, Multi-parameter Type Classes, Functional Dependencies, Other Approaches To Operator Overloading, Related Notions

Famous quotes containing the words type and/or class:

    Histories of the world omitted China; if a Chinaman invented compass or movable type or gunpowder we promptly “forgot it” and named their European inventors. In short, we regarded China as a sort of different and quite inconsequential planet.
    —W.E.B. (William Edward Burghardt)

    ... in the fierce competition of modern society the only class left in the country possessing leisure is that of women supported in easy circumstances by husband or father, and it is to this class we must look for the maintenance of cultivated and refined tastes, for that value and pursuit of knowledge and of art for their own sakes which can alone save society from degenerating into a huge machine for making money, and gratifying the love of sensual luxury.
    Mrs. H. O. Ward (1824–1899)