Question about circular references
David Alayachew
davidalayachew at gmail.com
Mon Jul 3 22:35:48 UTC 2023
Hello Ron,
Thank you for your response!
> The issue is not immutability
So let me reiterate what I said to Vicente -- I did not and do not take
issue with records being immutable. Immutability is a good thing, and I did
not and do not want that to go away.
> While records represent simple data, not all simple data
> can and should be directly represented as records.
> Records are specifically tuples (i.e. product types), and
> cyclic data structures are not tuples.
???
The dictionary definition of "product type" disagrees with you, correct?
Let me post a snippet of the definition here.
"In programming languages and type theory, a product of types is another,
compounded, type in a structure. The "operands" of the product are types,
and the structure of a product type is determined by the fixed order of the
operands in the product. An instance of a product type retains the fixed
order, but otherwise MAY CONTAIN ALL POSSIBLE INSTANCES OF ITS PRIMITIVE
DATA TYPES."
"If there are only two component types, it can be called a "pair type". For
example, if two component types A and B are THE SET OF ALL POSSIBLE VALUES
OF THAT TYPE, the product type written A × B contains elements that are
pairs (a,b), where "a" and "b" are instances of A and B respectively."
Am I misreading this? Because even after multiple readings of it, the
definition seems clear, obvious, and in direct contradiction to what you
are saying. What am I missing here?
> The issue is[...]that tuples do not
> represent cyclic data, at least not directly
Again, I am struggling to see where you pulling this logic and definition
from. It seems counter to what everyone else calls a product type or a
tuple.
Here is another snippet.
"In type theory a product type of two types A and B is the type whose terms
are ordered pairs (a,b) with a:A and b:B."
"In a model of the type theory in categorical semantics, this is a product.
In set theory, it is a CARTESIAN PRODUCT. In dependent type theory, it is a
special case of a dependent sum."
Help me out here.
Thank you for your time!
David Alayachew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20230703/e435f79c/attachment.htm>
More information about the amber-dev
mailing list