2008/6/19 jinjing <nfjinjing at gmail.com>: > encode xs = xs.group.map token where token x = (x.length, x.head) Working in this direction is a question of taste, but the choice of the dot for the operator is a pretty bad idea... On the other hand, my favourite would be : encode = map (length &&& head) . group -- Jedaï