purescript/purescript-strings

Rename `Data.String.CodePoints.singleton` to `fromCodePoint`

menelaos opened this issue · 2 comments

What do you think about renaming the singleton function in Data.String.CodePoints to fromCodePoint?
I believe this would increase discoverability for people coming from JavaScript and also be closer to fromCodePointArray that is defined in the same module.

I agree that it may be more discoverable for JavaScript programmers, but those familiar with Haskell and similarly-styled libraries would expect singleton. We could add an alias, but I don't really think it's worth it. Besides, we have Pursuit, which allows searching by types.

It might make sense to add to the Data.String.CodePoints.singleton function docs something like Names of similar functions in other languages: fromCodePoint.