Skip to content

Add Data.Sequence.toList#1192

Merged
meooow25 merged 2 commits intohaskell:masterfrom
meooow25:seq-tolist
Apr 3, 2026
Merged

Add Data.Sequence.toList#1192
meooow25 merged 2 commits intohaskell:masterfrom
meooow25:seq-tolist

Conversation

@meooow25
Copy link
Copy Markdown
Contributor

This has been requested, motivated by ergonomics (Seq.toList vs another import), type inference, consistency with other module APIs. A small downside is that it introduces an unnecessary choice for a user.

Closes #1184

This has been requested, motivated by ergonomics (Seq.toList vs another
import), type inference, consistency with other module APIs.
A small downside is that it introduces an unnecessary choice for a user.
Copy link
Copy Markdown
Contributor

@treeowl treeowl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm generally in favor. We've documented for ages that the modules in this package should be imported qualified or restricted, and it's idiomatic across modern packages to request specialized methods by using functions qualified by module.

let n_pr = Prelude.length (toList pr)
let n_sf = Prelude.length (toList sf)
let n_pr = Prelude.length pr
n_sf = Prelude.length sf
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoa... Any idea why we had such a uselessly inefficient length calculation here before?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are Digits so it's up to 4 elements and I don't think it is noticeable. It might even end up the same after inlining and optimizations.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah, I got mixed up. Still better to get it right.

@meooow25 meooow25 merged commit c7ff104 into haskell:master Apr 3, 2026
17 checks passed
@meooow25 meooow25 deleted the seq-tolist branch April 3, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Data.Sequence.toList

2 participants