{
  "aliases": [
    "comparison-of-languages-with-intersection-types",
    "comparison-of-programming-languages-intersection-types"
  ],
  "backlinks": null,
  "body": "\n## Summary\n\nIn type theory, an **intersection type** can be allocated to values that can be assigned both the type $\\sigma$ and the type $\\tau$. This value can be given the intersection type $\\sigma \\cap \\tau$ in an intersection type system. 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.\n",
  "commit": "4a3290d299c8b2cd6493fce2296920ba7f82d942",
  "front": {
    "aliases": [
      "comparison-of-languages-with-intersection-types",
      "comparison-of-programming-languages-intersection-types"
    ],
    "inventory": [
      "3DJY288JJQ"
    ],
    "kind": "concept",
    "name": "Intersection type",
    "same_as": {
      "wikidata": "Q85769734",
      "wikipedia": "Intersection type"
    },
    "sources": [
      {
        "locator": "Intersection type",
        "mention": "wikipedia://en/24140211",
        "note": "adopted",
        "sections": [
          "Summary"
        ],
        "wikipedia": "en:24140211@r1374885617"
      }
    ],
    "tag": "R4PQ6VXER6"
  },
  "kind": "concept",
  "link": "https://math2.tamnd.com/node/R4PQ6VXER6/",
  "links": null,
  "markdown": "https://math2.tamnd.com/node/R4PQ6VXER6.md",
  "msc": null,
  "name": "Intersection type",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/R4P/R4PQ6VXER6.md",
  "status": null,
  "tag": "R4PQ6VXER6",
  "uri": "m2://R4PQ6VXER6",
  "url": "https://math2.tamnd.com/wiki/intersection-type/",
  "writing": {
    "tag": "R4PQ6VXER6",
    "kind": "concept",
    "level": "W1",
    "next": [
      {
        "what": "edge defines in",
        "note": "at least one definition",
        "have": 0,
        "want": 1
      },
      {
        "what": "edge instance_of in",
        "note": "at least two examples",
        "have": 0,
        "want": 2
      },
      {
        "what": "edge not_instance_of in",
        "note": "at least one non-example",
        "have": 0,
        "want": 1
      },
      {
        "what": "edge specializes both",
        "note": "the more general notions and the special cases",
        "have": 0,
        "want": 1
      }
    ]
  }
}
