Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: purescript/purescript-strings
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v6.0.1
Choose a base ref
...
head repository: purescript/purescript-strings
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 3 commits
  • 3 files changed
  • 3 contributors

Commits on Oct 30, 2023

  1. Copy the full SHA
    373c44a View commit details
  2. Update CHANGELOG.md

    Fixup bad changelog entry.
    natefaubion authored Oct 30, 2023
    Copy the full SHA
    72bb066 View commit details

Commits on Dec 26, 2024

  1. Update take docstring to match the behaviour (#172)

    nwolverson authored Dec 26, 2024
    Copy the full SHA
    b6654d4 View commit details
Showing with 3 additions and 6 deletions.
  1. +1 −0 CHANGELOG.md
  2. +1 −1 src/Data/String/CodePoints.purs
  3. +1 −5 src/Data/String/NonEmpty/CodeUnits.purs
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@ New features:
Bugfixes:

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

2 changes: 1 addition & 1 deletion src/Data/String/CodePoints.purs
Original file line number Diff line number Diff line change
@@ -314,7 +314,7 @@ lastIndexOf' p i s =

-- | Returns a string containing the given number of code points from the
-- | beginning of the given string. If the string does not have that many code
-- | points, returns the empty string. Operates in constant space and in time
-- | points, returns the entire string. Operates in constant space and in time
-- | linear to the given number.
-- |
-- | ```purescript
6 changes: 1 addition & 5 deletions src/Data/String/NonEmpty/CodeUnits.purs
Original file line number Diff line number Diff line change
@@ -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
@@ -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.
-- |