{-# OPTIONS_HADDOCK hide, prune, ignore-exports #-} module Data.Number.Flint.Arb.Mat.Instances where import System.IO.Unsafe import Foreign.C.String import Foreign.Marshal.Alloc ( free ) import Foreign.Storable import Data.Number.Flint.Arb import Data.Number.Flint.Arb.Mat instance Show ArbMat where show :: ArbMat -> String show ArbMat x = forall a. IO a -> a unsafePerformIO forall a b. (a -> b) -> a -> b $ do (ArbMat _, CString cs) <- forall {a}. ArbMat -> (Ptr CArbMat -> IO a) -> IO (ArbMat, a) withArbMat ArbMat x forall a b. (a -> b) -> a -> b $ \Ptr CArbMat x -> do Ptr CArbMat -> CLong -> ArbStrOption -> IO CString arb_mat_get_strn Ptr CArbMat x CLong 16 ArbStrOption arb_str_no_radius String s <- CString -> IO String peekCString CString cs forall a. Ptr a -> IO () free CString cs forall (m :: * -> *) a. Monad m => a -> m a return String s