Tuple

Tuple #

Syntax. A tuple in Haskell is written in parentheses.

Example. The pair $(\mathit{banana}, 5)$ is written

("banana", 5)

Syntax. The type of a tuple is written in parentheses (like the tuple itself).

Examples.

Haskell tuple Possible type
(5,3) (Int, Int)
("banana", 5) (String, Int)
("banana", 5, "tomato") (String, Int, String)