Skip to content

Commit

Permalink
Merge pull request #6145 from roc-lang/improve-str-docs
Browse files Browse the repository at this point in the history
Fix Str.walkUtf8 docs
  • Loading branch information
rtfeldman authored Dec 2, 2023
2 parents 14cc154 + 421f8d9 commit a557957
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions crates/compiler/builtins/roc/Str.roc
Original file line number Diff line number Diff line change
Expand Up @@ -880,8 +880,11 @@ walkUtf8WithIndexHelp = \string, state, step, index, length ->
## state for each byte.
##
## ```
## result = walkUtf8 "hello, world!" "" (\state, byte -> state ++ String.fromCodePoint byte)
## expect result == Ok "hello, world!"
## sumOfUtf8Bytes =
## Str.walkUtf8 "Hello, World!" 0 \total, byte ->
## total + byte
##
## expect sumOfUtf8Bytes == 105
## ```
walkUtf8 : Str, state, (state, U8 -> state) -> state
walkUtf8 = \str, initial, step ->
Expand Down

0 comments on commit a557957

Please sign in to comment.