In
href="module.php?name=Lexikon&file=search&eid=1&query=functional language">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 w
here t
he type is independent of t
he lengt
h. T
he components of a tuple may be of different types w
hereas all elements of a list
have t
he same type. Examples of tuples in
href="module.php?name=Lexikon&file=search&eid=1&query=haskell">haskell notation are (1,2), ("Tuple",True), (w,(x,y),z). T
he degenerate tuple wit
h zero components, written (), is known as t
he unit type since it
has only one possible value w
hic
h is also written (). T
he implementation of tuples in a language may be eit
her "
href="module.php?name=Lexikon&file=search&eid=1&query=lifted">lifted" or not. If tuples are lifted t
hen (bottom,bottom) /= bottom and t
he evaluation of a tuple may fail to terminate. E.g. in
haskell: f (x,y) = 1 --> f bottom = bottom f (bottom,bottom) = 1 Wit
h lifted tuples, a tuple pattern is refutable. T
hus in
haskell,
href="module.php?name=Lexikon&file=search&eid=1&query=pattern matching">pattern matching on tuples is t
he same as pattern matc
hing on types wit
h multiple constructors ({algebraic data type}s) - t
he expression being matc
hed is evaluated as far as t
he top level constructor, even t
houg
h, in t
he case of tuples, t
here is only one possible constructor for a given type. If tuples are unlifted t
hen (bottom, bottom) = bottom and evaluation of a tuple will never fail to terminate t
houg
h any of t
he components may. E.g. in
href="module.php?name=Lexikon&file=search&eid=1&query=Miranda">Miranda: f (x,y) = 1 --> f bottom = 1 f (bottom,bottom) = 1 T
hus in Miranda, any object w
hose type is compatible wit
h a tuple pattern is assumed to matc
h at t
he top level wit
hout evaluation - it is an
href="module.php?name=Lexikon&file=search&eid=1&query=irrefutable">irrefutable pattern. T
his also applies to user defined data types wit
h only one constructor. In
haskell, patterns can be made irrefutable by adding a "~" as in f ~(x,y) = 1. If tuple constructor functions were
href="module.php?name=Lexikon&file=search&eid=1&query=strict">strict in all t
heir arguments t
hen (bottom,x) = (x,bottom) = bottom for any x so matc
hing a refutable pattern would fail to terminate if any component was bottom.
In addition suitable contents:
[ href="module.php?name=Lexikon&op=content&tid=31">2 ] [ href="module.php?name=Lexikon&op=content&tid=134">= ] [ href="module.php?name=Lexikon&op=content&tid=262">ad ] [ href="module.php?name=Lexikon&op=content&tid=396">ag ] [ href="module.php?name=Lexikon&op=content&tid=411">ai ] [ href="module.php?name=Lexikon&op=content&tid=433">al ] [ href="module.php?name=Lexikon&op=content&tid=464">algebra ] [ href="module.php?name=Lexikon&op=content&tid=466">algebraic ] [ href="module.php?name=Lexikon&op=content&tid=467">algebraic data type ] [ href="module.php?name=Lexikon&op=content&tid=544">am ] [ href="module.php?name=Lexikon&op=content&tid=592">an ] [ href="module.php?name=Lexikon&op=content&tid=683">app ] [ href="module.php?name=Lexikon&op=content&tid=740">ar ] [ href="module.php?name=Lexikon&op=content&tid=743">arc ] [ href="module.php?name=Lexikon&op=content&tid=759">arg ] [ href="module.php?name=Lexikon&op=content&tid=760">argument ] [ href="module.php?name=Lexikon&op=content&tid=800">as ] [ href="module.php?name=Lexikon&op=content&tid=894">at ] [ href="module.php?name=Lexikon&op=content&tid=996">av ] [ href="module.php?name=Lexikon&op=content&tid=1026">b ] [ href="module.php?name=Lexikon&op=content&tid=1181">be ] [ href="module.php?name=Lexikon&op=content&tid=1368">bj ] [ href="module.php?name=Lexikon&op=content&tid=1444">bo ] [ href="module.php?name=Lexikon&op=content&tid=1501">bot ] [ href="module.php?name=Lexikon&op=content&tid=1503">bottom ] [ href="module.php?name=Lexikon&op=content&tid=1535">br ] [ href="module.php?name=Lexikon&op=content&tid=1695">by ] [ href="module.php?name=Lexikon&op=content&tid=1724">ca ] [ href="module.php?name=Lexikon&op=content&tid=1844">case ] [ href="module.php?name=Lexikon&op=content&tid=2001">ch ] [ href="module.php?name=Lexikon&op=content&tid=2247">co ] [ href="module.php?name=Lexikon&op=content&tid=2330">com ] [ href="module.php?name=Lexikon&op=content&tid=2424">compatible ] [ href="module.php?name=Lexikon&op=content&tid=2457">component ] [ href="module.php?name=Lexikon&op=content&tid=2545">con ] [ href="module.php?name=Lexikon&op=content&tid=2606">cons ] [ href="module.php?name=Lexikon&op=content&tid=2630">constructor ] [ href="module.php?name=Lexikon&op=content&tid=3006">data ] [ href="module.php?name=Lexikon&op=content&tid=3091">data type ] [ href="module.php?name=Lexikon&op=content&tid=3136">dd ] [ href="module.php?name=Lexikon&op=content&tid=3151">de ] [ href="module.php?name=Lexikon&op=content&tid=3371">diff ] [ href="module.php?name=Lexikon&op=content&tid=3436">ding ] [ href="module.php?name=Lexikon&op=content&tid=3752">du ] [ href="module.php?name=Lexikon&op=content&tid=3834">E ] [ href="module.php?name=Lexikon&op=content&tid=3865">ec ] [ href="module.php?name=Lexikon&op=content&tid=3896">ed ] [ href="module.php?name=Lexikon&op=content&tid=3946">eg ] [ href="module.php?name=Lexikon&op=content&tid=4008">element ] [ href="module.php?name=Lexikon&op=content&tid=4148">er ] [ href="module.php?name=Lexikon&op=content&tid=4150">era ] [ href="module.php?name=Lexikon&op=content&tid=4171">es ] [ href="module.php?name=Lexikon&op=content&tid=4199">et ] [ href="module.php?name=Lexikon&op=content&tid=4246">evaluation ] [ href="module.php?name=Lexikon&op=content&tid=4317">expression ] [ href="module.php?name=Lexikon&op=content&tid=4497">fi ] [ href="module.php?name=Lexikon&op=content&tid=4520">file ] [ href="module.php?name=Lexikon&op=content&tid=4700">fo ] [ href="module.php?name=Lexikon&op=content&tid=4727">for ] [ href="module.php?name=Lexikon&op=content&tid=4940">function ] [ href="module.php?name=Lexikon&op=content&tid=4941">functional ] [ href="module.php?name=Lexikon&op=content&tid=4945">functional language ] [ href="module.php?name=Lexikon&op=content&tid=5057">ge ] [ href="module.php?name=Lexikon&op=content&tid=5070">gen ] [ href="module.php?name=Lexikon&op=content&tid=5089">generate ] [ href="module.php?name=Lexikon&op=content&tid=5134">gh ] [ href="module.php?name=Lexikon&op=content&tid=5141">gi ] [ href="module.php?name=Lexikon&op=content&tid=5398">gt ] [ href="module.php?name=Lexikon&op=content&tid=5403">gu ] [ href="module.php?name=Lexikon&op=content&tid=5434">h ] [ href="module.php?name=Lexikon&op=content&tid=5656">hing ] [ href="module.php?name=Lexikon&op=content&tid=5722">hose ] [ href="module.php?name=Lexikon&op=content&tid=5768">hr ] [ href="module.php?name=Lexikon&op=content&tid=5791">hu ] [ href="module.php?name=Lexikon&op=content&tid=5931">id ] [ href="module.php?name=Lexikon&op=content&tid=5956">ie ] [ href="module.php?name=Lexikon&op=content&tid=5986">iff ] [ href="module.php?name=Lexikon&op=content&tid=6013">il ] [ href="module.php?name=Lexikon&op=content&tid=6064">in ] [ href="module.php?name=Lexikon&op=content&tid=6068">inc ] [ href="module.php?name=Lexikon&op=content&tid=6413">io ] [ href="module.php?name=Lexikon&op=content&tid=6449">ir ] [ href="module.php?name=Lexikon&op=content&tid=6475">irrefutable ] [ href="module.php?name=Lexikon&op=content&tid=6482">is ] [ href="module.php?name=Lexikon&op=content&tid=6558">it ] [ href="module.php?name=Lexikon&op=content&tid=6789">ke ] [ href="module.php?name=Lexikon&op=content&tid=6861">kn ] [ href="module.php?name=Lexikon&op=content&tid=6918">la ] [ href="module.php?name=Lexikon&op=content&tid=6950">language ] [ href="module.php?name=Lexikon&op=content&tid=7023">ld ] [ href="module.php?name=Lexikon&op=content&tid=7091">Lex ] [ href="module.php?name=Lexikon&op=content&tid=7107">li ] [ href="module.php?name=Lexikon&op=content&tid=7220">list ] [ href="module.php?name=Lexikon&op=content&tid=7225">lists ] [ href="module.php?name=Lexikon&op=content&tid=7399">ls ] [ href="module.php?name=Lexikon&op=content&tid=7410">lt ] [ href="module.php?name=Lexikon&op=content&tid=7415">lu ] [ href="module.php?name=Lexikon&op=content&tid=7441">ly ] [ href="module.php?name=Lexikon&op=content&tid=7457">M ] [ href="module.php?name=Lexikon&op=content&tid=7463">ma ] [ href="module.php?name=Lexikon&op=content&tid=7979">Miranda ] [ href="module.php?name=Lexikon&op=content&tid=8032">mo ] [ href="module.php?name=Lexikon&op=content&tid=8040">mod ] [ href="module.php?name=Lexikon&op=content&tid=8079">module ] [ href="module.php?name=Lexikon&op=content&tid=8167">mp ] [ href="module.php?name=Lexikon&op=content&tid=8258">mu ] [ href="module.php?name=Lexikon&op=content&tid=8386">na ] [ href="module.php?name=Lexikon&op=content&tid=8460">nc ] [ href="module.php?name=Lexikon&op=content&tid=8472">ne ] [ href="module.php?name=Lexikon&op=content&tid=8627">ng ] [ href="module.php?name=Lexikon&op=content&tid=8630">ni ] [ href="module.php?name=Lexikon&op=content&tid=8660">nl ] [ href="module.php?name=Lexikon&op=content&tid=8675">no ] [ href="module.php?name=Lexikon&op=content&tid=8760">ns ] [ href="module.php?name=Lexikon&op=content&tid=8838">object ] [ href="module.php?name=Lexikon&op=content&tid=8964">om ] [ href="module.php?name=Lexikon&op=content&tid=9014">op ] [ href="module.php?name=Lexikon&op=content&tid=9204">pa ] [ href="module.php?name=Lexikon&op=content&tid=9380">pattern matching ] [ href="module.php?name=Lexikon&op=content&tid=9457">pe ] [ href="module.php?name=Lexikon&op=content&tid=9550">ph ] [ href="module.php?name=Lexikon&op=content&tid=9651">pl ] [ href="module.php?name=Lexikon&op=content&tid=9908">pr ] [ href="module.php?name=Lexikon&op=content&tid=10012">product ] [ href="module.php?name=Lexikon&op=content&tid=10222">quad ] [ href="module.php?name=Lexikon&op=content&tid=10253">query ] [ href="module.php?name=Lexikon&op=content&tid=10364">rc ] [ href="module.php?name=Lexikon&op=content&tid=10385">re ] [ href="module.php?name=Lexikon&op=content&tid=10484">refutable ] [ href="module.php?name=Lexikon&op=content&tid=10767">ro ] [ href="module.php?name=Lexikon&op=content&tid=10887">ru ] [ href="module.php?name=Lexikon&op=content&tid=10922">sa ] [ href="module.php?name=Lexikon&op=content&tid=10959">sam ] [ href="module.php?name=Lexikon&op=content&tid=11150">se ] [ href="module.php?name=Lexikon&op=content&tid=11376">si ] [ href="module.php?name=Lexikon&op=content&tid=11510">sk ] [ href="module.php?name=Lexikon&op=content&tid=11651">so ] [ href="module.php?name=Lexikon&op=content&tid=11934">st ] [ href="module.php?name=Lexikon&op=content&tid=12090">strict ] [ href="module.php?name=Lexikon&op=content&tid=12109">struct ] [ href="module.php?name=Lexikon&op=content&tid=12133">su ] [ href="module.php?name=Lexikon&op=content&tid=12165">sum ] [ href="module.php?name=Lexikon&op=content&tid=12359">T ] [ href="module.php?name=Lexikon&op=content&tid=12369">table ] [ href="module.php?name=Lexikon&op=content&tid=12440">tc ] [ href="module.php?name=Lexikon&op=content&tid=12588">th ] [ href="module.php?name=Lexikon&op=content&tid=12721">to ] [ href="module.php?name=Lexikon&op=content&tid=12787">tr ] [ href="module.php?name=Lexikon&op=content&tid=12896">tt ] [ href="module.php?name=Lexikon&op=content&tid=12939">tw ] [ href="module.php?name=Lexikon&op=content&tid=12970">type ] [ href="module.php?name=Lexikon&op=content&tid=12986">ua ] [ href="module.php?name=Lexikon&op=content&tid=13008">ug ] [ href="module.php?name=Lexikon&op=content&tid=13030">um ] [ href="module.php?name=Lexikon&op=content&tid=13146">up ] [ href="module.php?name=Lexikon&op=content&tid=13175">us ] [ href="module.php?name=Lexikon&op=content&tid=13188">user ] [ href="module.php?name=Lexikon&op=content&tid=13252">va ] [ href="module.php?name=Lexikon&op=content&tid=13260">value ] [ href="module.php?name=Lexikon&op=content&tid=13310">ve ] [ href="module.php?name=Lexikon&op=content&tid=14102">zero ] [ href="module.php?name=Lexikon&op=content&tid=14160">~ ]