[A little more about tuples. Bryan O'Sullivan **20070715005216] { hunk ./en/ch03-funcs-types.xml 134 - tuple to be related. + tuple to be related. We write a tuple by enclosing its elements + in parentheses and separating them with commas. We use the same + notation for writing its type. hunk ./en/ch03-funcs-types.xml 140 - We can construct a tuple with any number of elements, - although in practice, they become unwieldy past a handful. Each - tuple encodes the types of its elements in its own type. + We can construct a tuple with any number of elements + (although in practice, a tuple with more than a handful becomes + unwieldy). A tuple's type encodes the number and types of its + elements in its own type, so tuples containing different numbers + or types of elements have different types of their own. hunk ./en/ch03-funcs-types.xml 250 - Alternatives to algebraic data types in other + <title>Analogues to algebraic data types in other hunk ./examples/ch03/tuple.ghci 2 -(True, "hello") +(True, "hello") :: (Bool, String) hunk ./examples/ch03/tuple.ghci 5 -:type (True, "hello") }