Generating random sequences using n-grams in Haskell