3 ms·
It's not structs in C, it's more like records in Haskell. If you have two records {a: 1, b: 2}, those are equal because they are the same. If you have two str
by namelosw 7y ago
It's not structs in C, it's more like records in Haskell.
If you have two records {a: 1, b: 2}, those are equal because they are the same.
If you have two structs {a: 1, b: 2}, those are also equal but they are separate instances that consume more space. The comparison is recursive.
It's more like how string works in Java and most modern languages with constant pools - behaves like values but only takes constant space.
- deleted 7y ago[deleted]