3 ms·
It isn't entirely false. Haskell's GC can take some shortcuts when dealing with immutable objects as they can't reference objects older than themselves, includi
by __s 7y ago
It isn't entirely false. Haskell's GC can take some shortcuts when dealing with immutable objects as they can't reference objects older than themselves, including referencing themselves
- hope-striker 7y agoReally? I have no experience with Haskell's internals, but self-referential objects are fairly common in Haskell thanks to its non-strictness. The simplest one is probably the list with one element repeated forever. ones = 1:ones
- kccqzy 7y agoIf objects can't reference themselves, do you think recursion is impossible in Haskell? powersOf2 = 0 : scanl (+) 1 (tail powersOf2) fibonacci = 0 : scanl (+) 1 fibonacci As I have already explained, immutable objects in Haskell often use laziness. And laziness requires mutability.
- __s 7y agoI'm an idiot. I meant that objects can't reference objects newer than themselves