Skip to content

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

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

Merged
merged 5 commits into from
Oct 30, 2023
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/Data/String/NonEmpty/CodeUnits.purs
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,7 @@ snoc c s = toNonEmptyString (s <> CU.singleton c)
-- | Creates a `NonEmptyString` from a `Foldable1` container carrying
-- | characters.
fromFoldable1 :: forall f. Foldable1 f => f Char -> NonEmptyString
fromFoldable1 = F1.fold1 <<< coe
where
coe ∷ f Char -> f NonEmptyString
coe = unsafeCoerce
fromFoldable1 = unsafeCoerce <<< F1.foldMap1 CU.singleton

-- | Converts the `NonEmptyString` into an array of characters.
-- |
Expand Down