B.9 Declaring Types

The reader may have noticed in the previous examples that ML infers the types of values (e.g., lists, tuples, and functions) that have not been explicitly declared by the programmer to be of a particular type with the : operator.

B.9.1 Inferred or Deduced

The following transcript demonstrates type inference.

A set of six code lines in M L demonstrating type inference.
Description

B.9.2 Explicitly Declared

The following transcript demonstrates the use of explicitly declared types.

A set of three code lines in M L for demonstrating the use of explicitly declared types.
Description
Continuation of the code in M L for demonstrating the use of explicitly declared types, consisting of 33 lines.
Description
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.234.188