Skip to content

Update Array.match to return NonEmptyArray when given Array - #5496

Closed
OliverJAsh wants to merge 2 commits into
Effect-TS:mainfrom
OliverJAsh:array-match
Closed

OliverJAsh wants to merge 2 commits into
Effect-TS:mainfrom
OliverJAsh:array-match

Conversation

@OliverJAsh

@OliverJAsh OliverJAsh commented Sep 12, 2025 •

Copy link
Copy Markdown
Contributor

Type

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

Related

@changeset-bot

changeset-bot Bot commented Sep 12, 2025

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 1a1ead9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@cyberixae

Copy link
Copy Markdown
Contributor

I believe Array.match gives you a read-only array on purpose when matching a mutable array. This guarantees that the onNonEmpty function doesn't accidentally modify the input. Effect usually only returns a mutable array when it has created a copy, so the original input would not be affected by the mutation.

@fubhy

fubhy commented Jul 9, 2026

Copy link
Copy Markdown
Member

Closing this inactive draft/WIP PR. Please open a fresh PR when the change is ready for review.

@fubhy fubhy closed this Jul 9, 2026
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.

Array.match should return NonEmptyArray when given Array

3 participants