Conway sequence in haskell

by Gregor Uhlenheuer on November 15, 2012

Inspired by a F# snippet on that generated a Conway sequence look-and-say sequence I chose to implement the same using haskell.

The Conway sequence is built by reading the input string/sequence from left to right and returning the number of repeated consecutive elements. Eg. 1211 is converted to 111221 which in turn is processed into 312211.

My pretty straight forward approach looks like the following:

This post is tagged with haskell, programming and math