Skip to content

Commit

Permalink
Merge branch 'master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
thomashoneyman authored Nov 14, 2023
2 parents f03b02c + 72bb066 commit 8b0c9db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
5 changes: 2 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ New features:
Bugfixes:

Other improvements:
- `split` (#165)
- Add more examples.
- Fix typo in documentation.
- Add more examples to `Data.String.split` and fix a typo in documentation (#165 by @gasi)
- 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

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

0 comments on commit 8b0c9db

Please sign in to comment.