-- |
-- Parse a 'Word8' stream into an SGF collection.  A collection is a list of
-- games; the documentation for 'Game' has more details.  There are generally
-- two kinds of errors in SGF files: recoverable ones (which will be
-- accumulated in the ['Warning'] return) and unrecoverable ones (which will
-- result in parse errors).
collection :: Stream s m Word8 => ParsecT s u m (Collection, [Warning])
collection = second concat . unzip <$> (mapM (translate gameTree) =<< Raw.collection)
collection :: Stream s m Word8 => ParsecT s u m (Collection, [Warning])
collection = second concat . unzip <$> (mapM (translate gameTree) =<< Raw.collection)
collection = second concat . unzip <$> (mapM (translate gameTree) =<< Raw.collection)