From 40d90c9fb3dd22f8efb3a57d19948a65167d3f1c Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Fri, 1 Jul 2022 23:19:32 -0400 Subject: [PATCH] Add doc comment for toScalars --- crates/compiler/builtins/roc/Str.roc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/compiler/builtins/roc/Str.roc b/crates/compiler/builtins/roc/Str.roc index 971f601005..b39e55c71f 100644 --- a/crates/compiler/builtins/roc/Str.roc +++ b/crates/compiler/builtins/roc/Str.roc @@ -173,6 +173,11 @@ countGraphemes : Str -> Nat ## single [U32]. You'd need to use `Str.startsWithCodePt "🕊"` instead. startsWithCodePt : Str, U32 -> Bool +## Return a [List] of the [unicode scalar values](https://unicode.org/glossary/#unicode_scalar_value) +## in the given string. +## +## (Strings contain only scalar values, not [surrogate code points](https://unicode.org/glossary/#surrogate_code_point), +## so this is equivalent to returning a list of the string's [code points](https://unicode.org/glossary/#code_point).) toScalars : Str -> List U32 ## Return a [List] of the string's [U8] UTF-8 [code units](https://unicode.org/glossary/#code_unit).