Skip to content

Commit

Permalink
yield needs to be this way for tail-recursion
Browse files Browse the repository at this point in the history
  • Loading branch information
Thorium committed Jul 7, 2024
1 parent 7698437 commit d83b5a0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/FSharpAux.Core/String.fs
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,9 @@ module String =
| Lower _ when not takeUpper -> consume from takeUpper (i + 1)
| Upper _ when takeUpper -> consume from takeUpper (i + 1)
| _ ->
let r1 = struct (from, i)
let r2 = restart i
seq {
yield r1
yield! r2 }
yield struct (from, i)
yield! restart i }

// Split string into segments and turn them to PascalCase
seq { for i1, i2 in restart 0 do
Expand Down

0 comments on commit d83b5a0

Please sign in to comment.