Reputation: 307
Is there any short way to check if 2 maps are identical?
For example
map [("a", 10)]
map [("a", 10)]
-> identical
map [("b", 10)]
map [("b", 11)]
-> not identical
Upvotes: 0
Views: 166
Reputation: 3838
F# uses structural comparison in most cases and there in particular your comparision would be true.
Upvotes: 1
Reputation: 25516
The default =
appears to work
> Map.ofArray [| (1,"A");(2,"B") |] = Map.ofArray [| (1,"A");(2,"B") |];;
val it : bool = true
> Map.ofArray [| (1,"A");(2,"B") |] = Map.ofArray [| (1,"A");(3,"B") |];;
val it : bool = false
Upvotes: 5