Skip to content

More accurate Set and Map size warnings #1010

Open
@meooow25

Description

@meooow25

Set and Map documentation carry warnings that say

The size of the set must not exceed maxBound::Int. Violation of this condition is not detected and if the size limit is exceeded, its behaviour is undefined.

However, we multiple sizes by delta = 3 without caring about overflow when balancing, which means we get violated invariants earlier than that.

I doubt anyone will be running into this in practice, but the limit should be document as maxBound `div` 3 perhaps. Or less, in case there are other potentially troublesome operations I missed.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions