roc-lang / examples

All kinds of Roc examples

Home Page:https://www.roc-lang.org/examples

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

example suggestion: Avoiding splitting a Str into characters

Anton-4 opened this issue · comments

From the Roc Str reference:

If it seems like a good idea to split a string into "characters" (graphemes), you should definitely stop and reconsider whether this is really the best design. Almost always, doing this is some combination of more error-prone or slower (usually both) than doing something else that does not require taking graphemes into consideration.

It would be good to have several snippets that demonstrate this.