Global Information Lookup Global Information

Intersection type information


In type theory, an intersection type can be allocated to values that can be assigned both the type and the type . This value can be given the intersection type in an intersection type system.[1] Generally, if the ranges of values of two types overlap, then a value belonging to the intersection of the two ranges can be assigned the intersection type of these two types. Such a value can be safely passed as argument to functions expecting either of the two types. For example, in Java the class Boolean implements both the Serializable and the Comparable interfaces. Therefore, an object of type Boolean can be safely passed to functions expecting an argument of type Serializable and to functions expecting an argument of type Comparable.

Intersection types are composite data types. Similar to product types, they are used to assign several types to an object. However, product types are assigned to tuples, so that each tuple element is assigned a particular product type component. In comparison, underlying objects of intersection types are not necessarily composite. A restricted form of intersection types are refinement types.

Intersection types are useful for describing overloaded functions.[2] For example, if number => number is the type of function taking a number as an argument and returning a number, and string => string is the type of function taking a string as an argument and returning a string, then the intersection of these two types can be used to describe (overloaded) functions that do one or the other, based on what type of input they are given.

Contemporary programming languages, including Ceylon, Flow, Java, Scala, TypeScript, and Whiley (see comparison of languages with intersection types), use intersection types to combine interface specifications and to express ad hoc polymorphism. Complementing parametric polymorphism, intersection types may be used to avoid class hierarchy pollution from cross-cutting concerns and reduce boilerplate code, as shown in the TypeScript example below.

The type theoretic study of intersection types is referred to as the intersection type discipline.[3] Remarkably, program termination can be precisely characterized using intersection types.[4]

  1. ^ Barendregt, Henk; Coppo, Mario; Dezani-Ciancaglini, Mariangiola (1983). "A filter lambda model and the completeness of type assignment". Journal of Symbolic Logic. 48 (4): 931–940. doi:10.2307/2273659. JSTOR 2273659. S2CID 45660117.
  2. ^ Palsberg, Jens (2012). "Overloading is NP-Complete". Logic and Program Semantics. Lecture Notes in Computer Science. Vol. 7230. pp. 204–218. doi:10.1007/978-3-642-29485-3_13. ISBN 978-3-642-29484-6.
  3. ^ Henk Barendregt; Wil Dekkers; Richard Statman (20 June 2013). Lambda Calculus with Types. Cambridge University Press. pp. 1–. ISBN 978-0-521-76614-2.
  4. ^ Ghilezan, Silvia (1996). "Strong normalization and typability with intersection types". Notre Dame Journal of Formal Logic. 37 (1): 44–52. doi:10.1305/ndjfl/1040067315.

and 22 Related for: Intersection type information

Request time (Page generated in 0.9007 seconds.)

Intersection type

Last Update:

In type theory, an intersection type can be allocated to values that can be assigned both the type σ {\displaystyle \sigma } and the type τ {\displaystyle...

Word Count : 2388

Data type

Last Update:

which the type depends on the first value. An intersection type is a type containing those values that are members of two specified types. For example...

Word Count : 3433

Intersection type discipline

Last Update:

mathematical logic, the intersection type discipline is a branch of type theory encompassing type systems that use the intersection type constructor ( ∩ ) {\displaystyle...

Word Count : 2302

Type system

Last Update:

hierarchy, the intersection of a type and an ancestor type (such as its parent) is the most derived type. The intersection of sibling types is empty. The...

Word Count : 7252

Intersectionality

Last Update:

Intersectionality is a sociological analytical framework for understanding how groups' and individuals' social and political identities result in unique...

Word Count : 11594

TypeScript

Last Update:

"Announcing TypeScript 0.9". TypeScript Language team blog. Microsoft. "Generics in Typescript". Microsoft. "Handbook - Unions and Intersection Types". www...

Word Count : 3196

Intersection

Last Update:

lines are parallel). Other types of geometric intersection include: Line–plane intersection Line–sphere intersection Intersection of a polyhedron with a line...

Word Count : 802

Seagull intersection

Last Update:

seagull intersection or continuous green T-intersection (also known as a turbo-T (in Florida) or High-T intersection (in Nevada and Utah)) is a type of three-way...

Word Count : 842

Roundabout

Last Update:

traffic circle are all, with certain distinctions between them, a type of circular intersection or junction in which road traffic is permitted to flow in one...

Word Count : 11708

Jughandle

Last Update:

A jughandle is a type of ramp or slip road that changes the way traffic turns left at an at-grade intersection (in a country where traffic drives on the...

Word Count : 1790

Protected intersection

Last Update:

A protected intersection or protected junction, also known as a Dutch-style junction, is a type of at-grade road junction in which cyclists and pedestrians...

Word Count : 2866

Michigan left

Last Update:

type of intersection on its two- and three-lane, median-separated throughways instead of using traffic lights. Larger junctions use this intersection...

Word Count : 3157

Intersection algorithm

Last Update:

return failure instead of an interval. The intersection algorithm begins by creating a table of tuples <offset, type>. For each interval there are three entries:...

Word Count : 527

Intersection graph

Last Update:

graphs can be defined by the types of sets that are used to form an intersection representation of them. Formally, an intersection graph G is an undirected...

Word Count : 1144

Intersection assistant

Last Update:

monitors cross traffic in an intersection/road junction. If this anticipatory system detects a hazardous situation of this type, it prompts the driver to...

Word Count : 174

Conical intersection

Last Update:

In quantum chemistry, a conical intersection of two or more potential energy surfaces is the set of molecular geometry points where the potential energy...

Word Count : 1869

PHP

Last Update:

Retrieved 2021-11-26. "PHP: rfc:pure-intersection-types". wiki.php.net. Retrieved 2021-11-26. "PHP: rfc:noreturn_type". wiki.php.net. Retrieved 2021-11-26...

Word Count : 12021

Private set intersection

Last Update:

Private set intersection is a secure multiparty computation cryptographic technique that allows two parties holding sets to compare encrypted versions...

Word Count : 704

The Einstein Intersection

Last Update:

The Einstein Intersection is a 1967 science fiction novel by Samuel R. Delany. The title is a reference to Einstein's Theory of Relativity connecting to...

Word Count : 370

Type 2 diabetes

Last Update:

Type 2 diabetes (T2D), formerly known as adult-onset diabetes, is a form of diabetes mellitus that is characterized by high blood sugar, insulin resistance...

Word Count : 12151

Intersection theory

Last Update:

In mathematics, intersection theory is one of the main branches of algebraic geometry, where it gives information about the intersection of two subvarieties...

Word Count : 2209

Uncontrolled intersection

Last Update:

An uncontrolled intersection is a road intersection where no traffic lights, road markings or signs are used to indicate the right of way. They are found...

Word Count : 391

PDF Search Engine © AllGlobal.net