The combinator I think you want is sepEndBy
. Using it gives you
-- I'm using the type synonym
-- type Parser = GenParser Char ()
-- from Text.ParseCombinator.Parsec.Prim
parseRow :: Parser (String, [Int])
parseRow = do
string "set" >> many1 whitespace
name <- many1 alphaNum
spaces >> char '=' >> spaces
values <- many1 digit `sepEndBy` many1 whitespace
char ';'
return (name, map read values)
where spaces = many whitespace