September 22, 1999 | Strong Typing | Slide #15 |
Scalars
17 int 17.3 real "brain d foy" string true bool
Tuples (special case of records)
(17, "foo") int * string (12.5, 13.5, 9) real * real * int (true, false, true) bool * bool * bool
Lists
[true, false, true] bool list [true, false, true, false] bool list [1,2,3,4,5] int list ["brain", "d", "foy"] string list [17, "foo"] ILLEGAL [ [1,2,3], [4,6], [0,233] ] int list list
Polymorphism
[] 'a list [ [1,2,3], [], [] ] int list list [ ["b", "d", "f"], [], [] ] string list list
Type composition:
[ (true, [...]), (false, [...]), (false, [...]) ] (bool * 'a list) list
Next | Copyright © 1999 M-J. Dominus |