setCallback :: Parser -> Callback a -> a -> IO ()
setCallback parser which callback = do
  case which of
    CallbackBeginDocument -> do
      writeIORef (parserBeginDocumentCallback parser) $ Just callback
    CallbackEndDocument -> do
      writeIORef (parserEndDocumentCallback parser) $ Just callback
    CallbackBeginElement -> do
      writeIORef (parserBeginElementCallback parser) $ Just callback
    CallbackEndElement -> do
      writeIORef (parserEndElementCallback parser) $ Just callback
    CallbackCharacters -> do
      writeIORef (parserCharactersCallback parser) $ Just callback
    CallbackComment -> do
      writeIORef (parserCommentCallback parser) $ Just callback
    CallbackInstruction -> do
      writeIORef (parserInstructionCallback parser) $ Just callback
    CallbackDoctype -> do
      writeIORef (parserDoctypeCallback parser) $ Just callback
setCallback :: Parser -> Callback a -> a -> IO ()
setCallback parser which callback = do
  case which of
    CallbackBeginDocument -> do
      writeIORef (parserBeginDocumentCallback parser) $ Just callback
    CallbackEndDocument -> do
      writeIORef (parserEndDocumentCallback parser) $ Just callback
    CallbackBeginElement -> do
      writeIORef (parserBeginElementCallback parser) $ Just callback
    CallbackEndElement -> do
      writeIORef (parserEndElementCallback parser) $ Just callback
    CallbackCharacters -> do
      writeIORef (parserCharactersCallback parser) $ Just callback
    CallbackComment -> do
      writeIORef (parserCommentCallback parser) $ Just callback
    CallbackInstruction -> do
      writeIORef (parserInstructionCallback parser) $ Just callback
    CallbackDoctype -> do
      writeIORef (parserDoctypeCallback parser) $ Just callback
setCallback parser which callback = do
  case which of
    CallbackBeginDocument -> do
      writeIORef (parserBeginDocumentCallback parser) $ Just callback
    CallbackEndDocument -> do
      writeIORef (parserEndDocumentCallback parser) $ Just callback
    CallbackBeginElement -> do
      writeIORef (parserBeginElementCallback parser) $ Just callback
    CallbackEndElement -> do
      writeIORef (parserEndElementCallback parser) $ Just callback
    CallbackCharacters -> do
      writeIORef (parserCharactersCallback parser) $ Just callback
    CallbackComment -> do
      writeIORef (parserCommentCallback parser) $ Just callback
    CallbackInstruction -> do
      writeIORef (parserInstructionCallback parser) $ Just callback
    CallbackDoctype -> do
      writeIORef (parserDoctypeCallback parser) $ Just callback