Union Types =========== ```Example from 1 languages: TypeScript declare type numOrString = string | number ``` ```Example from 1 languages: GraphQL union SearchResult = Human | Droid | Starship ``` ```Example from 1 languages: Gleam type IntOrFloat { AnInt(Int) AFloat(Float) } fn int_or_float(x: IntOrFloat) { case x { AnInt(1) -> "It's an integer: 1" AFloat(1.0) -> "It's a float: 1.0" } } ``` ```Example from 1 languages: C3 union Foo { int x; float f; struct { char[2] z; } } ``` * Languages *with* Union Types include TypeScript, GraphQL, Gleam, C3, C2 * View all concepts with or missing a *hasUnionTypes* measurement http://pldb.info/../lists/explorer.html#columns=rank~id~appeared~tags~creators~hasUnionTypes&searchBuilder=%7B%22criteria%22%3A%5B%7B%22condition%22%3A%22null%22%2C%22data%22%3A%22hasUnionTypes%22%2C%22origData%22%3A%22hasUnionTypes%22%2C%22type%22%3A%22num%22%2C%22value%22%3A%5B%5D%7D%5D%2C%22logic%22%3A%22AND%22%7D missing http://pldb.info/../lists/explorer.html#columns=rank~id~appeared~tags~creators~hasUnionTypes&searchBuilder=%7B%22criteria%22%3A%5B%7B%22condition%22%3A%22!null%22%2C%22data%22%3A%22hasUnionTypes%22%2C%22origData%22%3A%22hasUnionTypes%22%2C%22type%22%3A%22num%22%2C%22value%22%3A%5B%5D%7D%5D%2C%22logic%22%3A%22AND%22%7D with * Read more about Union Types on the web: 1. https://en.wikipedia.org/wiki/Union_type 1. Built with Scroll v178.2.3