ビット変化列
http://karetta.jp/article/blog/oneline/009668より。
import Data.List (mapAccumR) gray2 = sequence . flip replicate "01" changes xs = snd $ mapAccumR (\x y -> (y, change x y)) (head xs) xs where change [] _ = 0 change xss@(x:xs) (y:ys) = if x /= y then (length xss) else change xs ys