Content deleted Content added
Adds Rust to the languages it inspired. |
m →Features: Fixed typo Tags: canned edit summary Mobile edit Mobile app edit Android app edit |
||
Line 37:
Types can refer to other types, for example a <code>List Int</code>. Types are always capitalized; lowercase names are type variables. For example, a <code>List a</code> is a list of values of unknown type. It is the type of the empty list and of the argument to <code>List.length</code>, which is agnostic to the list's elements. There are a few special types that programmers create to interact with the Elm runtime. For example, <code>Html Msg</code> represents a (virtual) DOM tree whose event handlers all produce messages of type <code>Msg</code>.
Rather than allow any value to be implicitly nullable (such
Elm provides a limited number of built-in [[Type class|type classes]]: <code>number</code> which includes <code>Int</code> and <code>Float</code> to facilitate the use of numeric operators such as <code>(+)</code> or <code>(*)</code>, <code>comparable</code> which includes numbers, characters, strings, lists of comparable things, and tuples of comparable things to facilitate the use of comparison operators, and <code>appendable</code> which includes strings and lists to facilitate concatenation with <code>(++)</code>. Elm does not provide a mechanism to include custom types into these type classes or create new type classes (see Limitations section).
|