Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ Bugfixes:

Other improvements:

## [v6.0.2]

Other improvements:
- Redefine `Data.String.NonEmpty.CodeUnits.fromFoldable1` in terms of `singleton` (#168 by @postsolar)

## [v6.0.1](https://github.com/purescript/purescript-strings/releases/tag/v6.0.1) - 2022-08-16

Bugfixes:
Expand Down
6 changes: 1 addition & 5 deletions src/Data/String/NonEmpty/CodeUnits.purs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import Data.String.NonEmpty.Internal (NonEmptyString(..), fromString)
import Data.String.Pattern (Pattern)
import Data.String.Unsafe as U
import Partial.Unsafe (unsafePartial)
import Unsafe.Coerce (unsafeCoerce)

-- For internal use only. Do not export.
toNonEmptyString :: String -> NonEmptyString
Expand Down Expand Up @@ -91,10 +90,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 = F1.foldMap1 singleton

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