Re:Fundamentals of Garbage Collection
by asplake on Saturday July 12, 2025 @03:55AM
(#44540174)
Even with cyclic relationships between types, immutability makes cycles within instances difficult (without laziness anyway). A syntax tree would be a good example.
[ Parent
| on HN ]
Yes, either is sufficient, I think.
Yes, and the nice thing about doing it with immutability is you can still have recursive types to build linked lists, trees, and/or dags. From there you can build hash-array-mapped-tries, finger-trees, and so on, giving you friendly dict/list or JSON style data structures.