Tuple


noun
1.
(computing) a row of values in a relational database
noun

in a database, an ordered set of data constituting a record; a data structure consisting of comma-separated values passed to a program or operating system
Usage Note

computing

Toyohashi University Parallel Lisp Environment

In functional languages, a data object containing two or more components. Also known as a product type or pair, triple, quad, etc. Tuples of different sizes have different types, in contrast to lists where the type is independent of the length. The components of a tuple may be of different types whereas all elements of a list have the same type. Examples of tuples in Haskell notation are (1,2), (“Tuple”,True), (w,(x,y),z). The degenerate tuple with zero components, written (), is known as the unit type since it has only one possible value which is also written ().
The implementation of tuples in a language may be either “lifted” or not. If tuples are lifted then (bottom,bottom) /= bottom and the evaluation of a tuple may fail to terminate. E.g. in Haskell:
f (x,y) = 1 –> f bottom = bottom f (bottom,bottom) = 1
With lifted tuples, a tuple pattern is refutable. Thus in Haskell, pattern matching on tuples is the same as pattern matching on types with multiple constructors (algebraic data types) – the expression being matched is evaluated as far as the top level constructor, even though, in the case of tuples, there is only one possible constructor for a given type.
If tuples are unlifted then (bottom, bottom) = bottom and evaluation of a tuple will never fail to terminate though any of the components may. E.g. in Miranda:
f (x,y) = 1 –> f bottom = 1 f (bottom,bottom) = 1
Thus in Miranda, any object whose type is compatible with a tuple pattern is assumed to match at the top level without evaluation – it is an irrefutable pattern. This also applies to user defined data types with only one constructor. In Haskell, patterns can be made irrefutable by adding a “~” as in
f ~(x,y) = 1.
If tuple constructor functions were strict in all their arguments then (bottom,x) = (x,bottom) = bottom for any x so matching a refutable pattern would fail to terminate if any component was bottom.

Read Also:

  • Tupling

    A program transformation where several results are returned from a single traversal of a data structure. E.g. mean l = sum l / length l ==> mean l = s/n where (s,n) = sumLen l sumLen [] = (0,0) sumLen (x:xs) = (s+x, n+1) where (s,n) = sumLen xs In procedural languages this technique is […]

  • Tuple space smalltalk

    [“Using Tuple Space Communication in Distributed Object-Oriented Languages”, S. Matsuoka et al, SIGPLAN Notices 23(11):276-284 (Nov 1988)]. (1994-11-08)

  • Tuppence

    noun, British. 1. twopence. noun, plural twopence, twopences for 2–4. 1. (used with a singular or plural verb) British. a sum of two pennies. 2. a bronze coin of the United Kingdom equal to two pennies: issued after decimalization in 1971. 3. a former copper coin of Great Britain, equal to two pennies, issued under […]

  • Tuppenny

    adjective 1. twopenny (defs 1–3). adjective 1. a variant spelling of twopenny

  • Tupper

    noun 1. Sir Charles, 1821–1915, Canadian statesman: prime minister 1896.


Disclaimer: Tuple definition / meaning should not be considered complete, up to date, and is not intended to be used in place of a visit, consultation, or advice of a legal, medical, or any other professional. All content on this website is for informational purposes only.