Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sequencing is incompatible with array.map #1921

Open
hesxenon opened this issue Jan 7, 2024 · 0 comments
Open

Sequencing is incompatible with array.map #1921

hesxenon opened this issue Jan 7, 2024 · 0 comments

Comments

@hesxenon
Copy link

hesxenon commented Jan 7, 2024

🐛 Bug report

Current Behavior

Using task sequencing yields a readonly array which is incompatible with array mapping

Expected behavior

Sequencing Tasks should work with Array mapping.

Reproducible example

https://codesandbox.io/p/sandbox/fp-ts-sequencing-readonly-kndpz5?file=%2Fsrc%2Findex.ts

Suggested solution(s)

Either make it so that task sequencing does not produce readonly arrays or make the array module compatible with readonly arrays.

Additional context

It seems that there's an effort going on to move sequencing logic to use readonly arrays. While I'm ofc in favor of immutability where possible I don't think using readonly here adds any benefit to fp-ts. Even if I wanted to mutate the returned array, that should be my prerogative as a dev and it should not impact fp-ts in any way.

Your environment

Which versions of fp-ts are affected by this issue? Did this work in previous versions of fp-ts?

Software Version(s)
fp-ts 2.16.2
TypeScript 5.3.3
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

No branches or pull requests

1 participant