An n-tuple is an ordered sequence of n values written in parenthesis and separated commas as (expr, expr, ..., expr)


For instance, (42, "hello", true) is a 3-tuple that contains the integer 42 as its first component, the string "hello" as its second component, and the boolean value true as its third component

* order is important!

* Notice that types of data in the parenthesis--i.e. 42, "hello", true--are all different. You cannot have different types of data in "List" but it is possible in "Tuple" This may be the most notable difference between them. <- if you are curious about what the difference between them is :)


Note that n can be 0, which gives the empty tuple (). 

This is called "unit" in Ocaml.

 

 




WRITTEN BY
서상호

,