Skip to content

Unreliable set of sets #156

Open
Open
@timjs

Description

As a consequence of universal equality in Unison, making a set of sets does not behave correctly:

s1 = List.range 1 10 |> Set.fromList
s2 = List.range 1 10 |> 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.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions