You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a consequence of universal equality in Unison, making a set of sets does not behave correctly:
s1 =List.range 110|>Set.fromList
s2 =List.range 110|>List.reverse|>Set.fromList
> s1 === s2 -- These are not equal, because the internal representation is different...
ss =Set.fromList [s1, s2]
> ss |>Set.size -- ... and therefore this returns `true`!
I know there is no easy solution for it now, but maybe we could add to the documentation of Set (and Map) that creating a set of sets won't work the way people expect due to implementation details.
The text was updated successfully, but these errors were encountered:
If you use Set.== instead of Universal.===, then s1 Set.== s2 does return true. However, I don't think that there's currently a good workaround for Set.fromList [s1, s2] returning a set with two elements.
As a consequence of universal equality in Unison, making a set of sets does not behave correctly:
I know there is no easy solution for it now, but maybe we could add to the documentation of
Set
(andMap
) that creating a set of sets won't work the way people expect due to implementation details.The text was updated successfully, but these errors were encountered: