module Data.Number.Flint.Groups.Bool.Mat.Instances where

import System.IO.Unsafe
import Foreign.C.String
import Foreign.Marshal.Alloc ( free )

import Data.Number.Flint.Groups.Bool.Mat

instance Show BoolMat where
  show :: BoolMat -> String
show BoolMat
x = forall a. IO a -> a
unsafePerformIO forall a b. (a -> b) -> a -> b
$ do
    (BoolMat
_, CString
cs) <- forall {a}. BoolMat -> (Ptr CBoolMat -> IO a) -> IO (BoolMat, a)
withBoolMat BoolMat
x Ptr CBoolMat -> IO CString
bool_mat_get_str
    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