Ruby-like squish in Haskell
I have no complaints about this.

Esthetically it seems that squishOn 'a' "aaabcbcbc" should create the groups:

[ "aaa", "bcbcbc" ]


instead of:

[ "aaa", "b", "c", "b", "c", "b", "c" ]


Due to laziness it may not make any difference. This is something that perhaps should be benchmarked. To form the groups the first way use the groupBy function from Data.List like this:

groupBy (\x y -&gt; x == y || (x /= 'a' &amp;&amp; y /= 'a')) input


So, two characters are in the same group if they are equal or if they are not both the character to be squished. Of course, if you do this you'll have to switch the groups back together differently with something like:

concatMap f (groupBy (\x y -&gt; ...) ...)
  where f ('a':xs) = "a"
        f xs       = xs


(Substitute the literal 'a' with the squishing character.)

This alternate approach probably makes more sense if you were to define squishing on ByteString or Text.