Haskell Language Tuples (Pairs, Triples, ...) Write tuple types


Use parentheses and commas to write tuple types. Use one comma to write a pair type.

(Int, Int)

Use more commas to write tuple types with more components.

(Int, Int, Int)

(Int, Int, Int, Int)

Tuples can contain values of different types.

(String, Int, Char)

Tuples can contain complex values such as lists or more tuples.

([Int], String, (Char, Int))

(Int, (Int, (Int, Int), Int), Int)