toVector :: FMPZPoly -> Vector FMPZ
toVector a = unsafePerformIO $ fmap snd $
  withFMPZPoly a $ \aptr -> do
  deg <- fromIntegral <$> fmpz_poly_degree aptr
  V.generateM (deg+1) $ \ix ->
    withNewFMPZ_ $ \bptr ->
    fmpz_poly_get_coeff_fmpz bptr aptr (fromIntegral ix)
  where
toVector :: FMPZPoly -> Vector FMPZ
toVector a = unsafePerformIO $ fmap snd $
  withFMPZPoly a $ \aptr -> do
  deg <- fromIntegral <$> fmpz_poly_degree aptr
  V.generateM (deg+1) $ \ix ->
    withNewFMPZ_ $ \bptr ->
    fmpz_poly_get_coeff_fmpz bptr aptr (fromIntegral ix)
  where
toVector a = unsafePerformIO $ fmap snd $
  withFMPZPoly a $ \aptr -> do
  deg <- fromIntegral <$> fmpz_poly_degree aptr
  V.generateM (deg+1) $ \ix ->
    withNewFMPZ_ $ \bptr ->
    fmpz_poly_get_coeff_fmpz bptr aptr (fromIntegral ix)
  where