Re:Is your programming language unreasonable? (2015)
by Smaug123 on Saturday October 10, 2020 @07:09AM
(#24738115)
Note that F# has the `[<NoEquality>]` attribute for exactly that sort of case.
[ Parent
| on HN ]
Re:Is your programming language unreasonable? (2015)
by masklinn on Saturday October 10, 2020 @08:19AM
(#24738444)
That's the wrong default though.
There is no reason to assume equality is a sensible concept, so objects should not even be equatable by default, and you could have an attribute which gives them structural equality (with a third option of a full-blown custom equality if necessary) as e.g. Haskell or Rust handle it.