<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hi everyone,</p>
<p>I confess to being a bit befuddled at the somewhat terse and
elusive definition given by the reference manual on Type types
(3.1.2.2):</p>
<blockquote>
<p><font face="monospace">"The tuple types are {}, {T}, {T1, T2},
. . .<br>
A tuple type is equivalent to a discriminated union type (see
Section 3.2.1 [Discriminated<br>
unions], page 33) with declaration<br>
:- type {Arg1, Arg2, ..., ArgN}<br>
---> { {Arg1, Arg2, ..., ArgN} }."</font></p>
</blockquote>
<p>The equivalence with discriminated union types is clear; the type
declaration is a bit less so.</p>
<p>My understanding of tuples would rather be as follows:</p>
<blockquote>
<p>:- type {Arg1, Arg2, ..., ArgN}<br>
---> {} (Arg1, Arg2, ..., ArgN).<br>
</p>
</blockquote>
In other words, tuple terms look to me as (instantiated)
discriminated union types with anonymous constructors '{}' of arity
N consisting of the two joined tokens '{' and '}'. <br>
<p>This is evidenced among others by <span
style="font-family:monospace"><span
style="color:#000000;background-color:#ffffff;">tests/hard_coded/tuple_test.m:30.</span></span></p>
<p><span style="font-family:monospace"><span
style="color:#000000;background-color:#ffffff;"></span></span>I
think the reference manual could perhaps rephrase its explanation
in a more convincing and clear-cut way as above. <br>
</p>
<p>I honestly do not understand the manual definition; to me it
irresistibly smacks of infinite recursion. Something vaguely
Chomskian in me, against all odds, keeps rewriting this
declaration as follows:</p>
<p><font face="monospace"> :- type {Arg1, Arg2, ..., ArgN}<br>
---> { { { Arg1, Arg2, ..., ArgN} } }.</font></p>
<p><font face="monospace"> :- type {Arg1, Arg2, ..., ArgN}<br>
---> { { { { Arg1, Arg2, ..., ArgN} } } }.</font></p>
<p><font face="monospace"> :- type {Arg1, Arg2, ..., ArgN}<br>
---> { { { { { Arg1, Arg2, ..., ArgN} } } } }.</font></p>
<p><font face="monospace">(... to Infinity ...)<br>
</font></p>
<p>somewhat hellishly.<br>
</p>
<p>
</p>
<p>But there must be something I missed there; I would be grateful
for any principled denial of these misconceptions of mine (while
we are all still alive).<br>
<br>
Fabrice<span style="font-family:monospace"><br>
</span></p>
</body>
</html>