[Haskell-cafe] Markov chain algorithm (from "The Practice of Programming", Kernighan/Pike)