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)})