gameParse = do
  skipSpace
  tagsTups <- many1 parseTag
  let tags = fromList tagsTups
  let gameResult = case tags ! "Result" of
        "1/2-1/2" -> Just Draw
        "1-0"     -> Just WhiteWon
        "0-1"     -> Just BlackWon
        _         -> Nothing
  moves <- many parseMove
  many uselessStuff
  endResult
  return $ PGN (unpack $ tags ! "Event")
               (unpack $ tags ! "Site")
               (unpack $ tags ! "Date")
               (unpack $ tags ! "Round")
               (unpack $ tags ! "White")
               (unpack $ tags ! "Black")
               gameResult
               Nothing
               moves

-- todo: handle escaping
gameParse = do
  skipSpace
  tagsTups <- many1 parseTag
  let tags = fromList tagsTups
  let gameResult = case tags ! "Result" of
        "1/2-1/2" -> Just Draw
        "1-0"     -> Just WhiteWon
        "0-1"     -> Just BlackWon
        _         -> Nothing
  moves <- many parseMove
  many uselessStuff
  endResult
  return $ PGN (unpack $ tags ! "Event")
               (unpack $ tags ! "Site")
               (unpack $ tags ! "Date")
               (unpack $ tags ! "Round")
               (unpack $ tags ! "White")
               (unpack $ tags ! "Black")
               gameResult
               Nothing
               moves

-- todo: handle escaping
gameParse = do
  skipSpace
  tagsTups <- many1 parseTag
  let tags = fromList tagsTups
  let gameResult = case tags ! "Result" of
        "1/2-1/2" -> Just Draw
        "1-0"     -> Just WhiteWon
        "0-1"     -> Just BlackWon
        _         -> Nothing
  moves <- many parseMove
  many uselessStuff
  endResult
  return $ PGN (unpack $ tags ! "Event")
               (unpack $ tags ! "Site")
               (unpack $ tags ! "Date")
               (unpack $ tags ! "Round")
               (unpack $ tags ! "White")
               (unpack $ tags ! "Black")
               gameResult
               Nothing
               moves

-- todo: handle escaping