-- | Picks a random element of a list, which better not be empty!
pick :: [a] -> IO a
pick xs = do
  idx <- randomRIO (0, length xs - 1) -- choose a random index
  return (xs !! idx)                  -- return that element of the list

-- | An implementation of GetNextToken based on a Transitions map.
pick :: [a] -> IO a
pick xs = do
  idx <- randomRIO (0, length xs - 1) -- choose a random index
  return (xs !! idx)                  -- return that element of the list

-- | An implementation of GetNextToken based on a Transitions map.
pick xs = do
  idx <- randomRIO (0, length xs - 1) -- choose a random index
  return (xs !! idx)                  -- return that element of the list

-- | An implementation of GetNextToken based on a Transitions map.