Grouping consecutive integers in F# and Haskell

Let's look at what F# and Haskell can offer us while reimplementing grouping consecutive integers in C# algorithm.

F#:

Haskell:

For my current taste, the Haskell version is more readable due to the awesome separate type annotation and to the lovely Erlang-style pattern matching on function arguments.

Comments

Popular posts from this blog

Computing cryptography hashes: Rust, F#, D and Scala

Upcoming F# struct tuples: are they always faster?

Composing custom error types in F#