3 ms·
Surprising that F# doesn't have a "chunkBy" function for sequences; it makes the solution in Elixir vastly more readable than the version in the article: "
by al2o3cr 6y ago
Surprising that F# doesn't have a "chunkBy" function for sequences; it makes the solution in Elixir vastly more readable than the version in the article:
"aaaabbbcca" |> String.codepoints() |> Enum.chunk_by(& &1) |> Enum.map(&{hd(&1), length(&1)})
- DanielBMarkham 6y agoThere is a chunkBy, it's just not this nice. This would be a great project for the F#+ guys.