haskell / haskell/containers

Data.Sequence does not check for `Int` overflow

Open
#83 5 comments 0 reactions 0 assignees View on GitHub
Seq
Dominant language
Haskell
Stars
355
Forks
194
Avg merge
3d 4h
Merged PRs (30d)
4

Description

`><`, `replicate`, `replicateA`, `*>`, and maybe other operations are all capable of making sequences that are like the Tardis: bigger on the inside. Any of these (especially when iterated) can easily make a sequence whose size cannot be represented by an `Int`, at which point nothing will work right, and operations will either produce crazy errors or silently give wrong answers. The solution is to check for this in all operations that expand sequences, from `<|` on up. While we're at it, we may also want to switch from `Int` to `Word` size representations internally.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.