nextElement :: (RandomGen g, Ord a) => 
                   MarkovChain a -> (NGram a, g) -> Maybe (a, (NGram a, g))
    nextElement (MarkovChain m) (n,g) = fmap choose $ Map.lookup n m
        where choose r = (a, (shiftAppend n a, g'))
                  where (g',a) = RandSet.randomChoice g r
nextElement :: (RandomGen g, Ord a) => 
                   MarkovChain a -> (NGram a, g) -> Maybe (a, (NGram a, g))
nextElement (MarkovChain m) (n,g) = fmap choose $ Map.lookup n m
        where choose r = (a, (shiftAppend n a, g'))
                  where (g',a) = RandSet.randomChoice g r
nextElement (MarkovChain m) (n,g) = fmap choose $ Map.lookup n m
        where choose r = (a, (shiftAppend n a, g'))
                  where (g',a) = RandSet.randomChoice g r