Show Navigation
Conversation
Notices
-
Had "fun" with .NET today, trying to check if two trees of objects are equal after a serialization roundtrip. Obviously they weren't because forgot that List<T>.Equals() does not call Equals() on the elements of the list but only does reference equality (i.e. the kind that's both fast and rarely what you want). The right one is an extension method called SequenceEqual. Seriously, in some respects Haskell is just godly: "deriving (Eq)", no need for code generation to create equals methods that will subtly break if you add fields and forget to add them.