Matches in DBpedia 2014 for { <http://dbpedia.org/resource/Covariance_and_contravariance_(computer_science)> ?p ?o. }
Showing items 1 to 23 of
23
with 100 items per page.
- Covariance_and_contravariance_(computer_science) abstract "Many programming language type systems support subtyping. For instance, if Cat is subtype of Animal, then an expression of type Cat can be used whenever an expression of type Animal could. Variance refers to how subtyping between more complex types (list of Cats versus list of Animals, function returning Cat versus function returning Animal, ...) relates to subtyping between their components. Depending on the variance of the type constructor, the subtyping relation may be either preserved, reversed, or ignored. For example, in C# : IEnumerable<Cat> is a subtype of IEnumerable<Animal>, because the IEnumerable<out T> type parameter T is covariant. Note how original subtyping of the interface's type parameter is preserved thanks to the out before the T. Action<Cat> is a supertype of Action<Animal>, because the Action<in T> type parameter T is contravariant (an Action<T> represents a first-class function expecting an argument of type T or sub-T). Note how the subtyping of T is reversed while encapsulated by an Action, but preserved once supplied as an argument to the underlying function. This behavior is declared by the in before the T Neither IList<Cat> nor IList<Animal> is a subtype of the other, because the IList<T> type parameter T is invariant because there is neither in nor out before the T.A programming language designer will consider variance when devising typing rules for e.g. arrays, inheritance, and generic datatypes. By making type constructors covariant or contravariant instead of invariant, more programs will be accepted as well-typed. On the other hand, programmers often find contravariance unintuitive, and accurately tracking variance to avoid runtime type errors can lead to complex typing rules. In order to keep the type system simple and allow useful programs, a language may treat a type constructor as invariant even if it would be safe to consider it variant, or treat it as covariant even when that can violate type safety.".
- Covariance_and_contravariance_(computer_science) wikiPageExternalLink default.aspx.
- Covariance_and_contravariance_(computer_science) wikiPageExternalLink wiki?ContraVsCoVariance.
- Covariance_and_contravariance_(computer_science) wikiPageExternalLink closures-v05.html.
- Covariance_and_contravariance_(computer_science) wikiPageID "1104704".
- Covariance_and_contravariance_(computer_science) wikiPageRevisionID "606607991".
- Covariance_and_contravariance_(computer_science) hasPhotoCollection Covariance_and_contravariance_(computer_science).
- Covariance_and_contravariance_(computer_science) subject Category:Object-oriented_programming.
- Covariance_and_contravariance_(computer_science) subject Category:Polymorphism_(computer_science).
- Covariance_and_contravariance_(computer_science) subject Category:Type_theory.
- Covariance_and_contravariance_(computer_science) comment "Many programming language type systems support subtyping. For instance, if Cat is subtype of Animal, then an expression of type Cat can be used whenever an expression of type Animal could. Variance refers to how subtyping between more complex types (list of Cats versus list of Animals, function returning Cat versus function returning Animal, ...) relates to subtyping between their components.".
- Covariance_and_contravariance_(computer_science) label "Covariance and contravariance (computer science)".
- Covariance_and_contravariance_(computer_science) label "Kovarianz und Kontravarianz".
- Covariance_and_contravariance_(computer_science) label "Ковариантность и контравариантность (программирование)".
- Covariance_and_contravariance_(computer_science) label "لاتباين وتباين مرافق وتباين معاكس".
- Covariance_and_contravariance_(computer_science) label "协变与逆变".
- Covariance_and_contravariance_(computer_science) sameAs Kovarianz_und_Kontravarianz.
- Covariance_and_contravariance_(computer_science) sameAs 共変性と反変性_(計算機科学).
- Covariance_and_contravariance_(computer_science) sameAs m.046c29.
- Covariance_and_contravariance_(computer_science) sameAs Q362031.
- Covariance_and_contravariance_(computer_science) sameAs Q362031.
- Covariance_and_contravariance_(computer_science) wasDerivedFrom Covariance_and_contravariance_(computer_science)?oldid=606607991.
- Covariance_and_contravariance_(computer_science) isPrimaryTopicOf Covariance_and_contravariance_(computer_science).