Skip to content

Better definition for Data.String.NonEmpty.CodeUnits.fromFoldable1#168

Merged
natefaubion merged 5 commits into
purescript:masterfrom
postsolar:remove-unsafeCoerce
Oct 30, 2023
Merged

Better definition for Data.String.NonEmpty.CodeUnits.fromFoldable1#168
natefaubion merged 5 commits into
purescript:masterfrom
postsolar:remove-unsafeCoerce

Conversation

@postsolar
Copy link
Copy Markdown
Contributor

Current definition of Data.String.CodeUnits.NonEmpty.fromFoldable1 uses unsafeCoerce to coerce an array of characters into array of non-empty strings. This is 1) unsuitable for some backends; 2) could be redefined via singleton :: Char -> String.

I also slipped in a small doc comment update.

Checklist:

  • Added the change to the changelog's "Unreleased" section with a reference to this PR (e.g. "- Made a change (#0000)")
  • Linked any existing issues or proposals that this pull request should close
  • Updated or added relevant documentation
  • Added a test for the contribution (if applicable)

Comment thread src/Data/String/CodeUnits.purs Outdated
Reason: unrelated.
This reverts commit c9464f6.
@postsolar postsolar changed the title Better definition for Data.String.NonEmpty.CodeUnits.fromFoldable1 and an updated doc comment Better definition for Data.String.NonEmpty.CodeUnits.fromFoldable1 Oct 29, 2023
@natefaubion
Copy link
Copy Markdown
Contributor

While this is a small internal change, I think we should still add a changelog entry.

Comment thread src/Data/String/NonEmpty/CodeUnits.purs Outdated
@natefaubion natefaubion merged commit 373c44a into purescript:master Oct 30, 2023
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.

3 participants