This is a brain dead duck like comparer. It just tries to compare objects of maybe different types and check if they look alike.
In order to do this, objects are serialized to Json (with ordered fields) and simply compared. That's it.
.net objects (C# and F#) are supported, especially F# collections (Map, Set, List, Seq) and F# anonymous records.
Function | Description | Returns |
---|---|---|
Likeness.Comparer.AreAlike |
Takes 2 parameters. Order is not important. null is valid parameter. |
It returns true if objects are alike, false otherwise. |
- Option.None is same as null
- Enumerables with same contents are alike (
seq
andlist
for eg)
-
Do not use this on production system. It's been done to perform comparison in unit tests.
-
Peformance can't be good since serialization to Json is done.
-
This use Newtonsoft.Json. If your object use attributes, expect impacts.