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.
The programmer defines a type class by specifying a set of function or constant names, together with their respective types, that must exist for every type that belongs to the class. In Haskell, types can be parameterized; a type class Eq
intended to contain types that admit equality would be declared in the following way:
Type 22 class may refer to:
China first received a single unit of Soviet Osa-class missile boat in January 1965, and four more in 1966 through 1967 and the last two in 1968. Eventually the Hudong Shipyard built the Chinese version as Type 021-class missile boat at a rate of ten boats per year with several different versions. Although majority of this class is being transferred to reserve, several dozens remain active and these active units are being rearmed with C-101 supersonic anti-ship missiles. These boats are effectively used in swarm missile attacks.
Huangfeng-class missile boat is the direct Chinese copy of Soviet Osa-class missile boat, and around 130 were built, including exported units. This class consists of several versions with different armament. Most are armed with twin 25 mm guns, while some are armed with a single AK-230 gun mount. The majority lack the fire control radars but some do have a radar radome aft (between the two missile launchers).
The major improvement of the Huangfeng class over the original Soviet Osa-I class is that the Chinese engine, which is the improvement of the original Soviet M503A diesel engine has been so efficient that the range of the boat is more than doubled without significant proportional increase of fuel consumption. However, due to the limited size of the boat, the actual endurance is not drastically increased because there is not enough extra space to store additional provisions needed for the longer endurance. Other improvements over the original Soviet Osa-I class included a much improved fire extinguishing system and life support system.