Open
Description
I am trying to use this library with a third party C library, but I need to carry some additional context to perform the computations.
My issue boils down to how do I integrate library calls like:
-- Haskell wrapper function signature
zero :: (Int, Int) -> StateT IO Context Matrix
one :: (Int, Int) -> StateT IO Context Matrix
add :: Matrix -> Matrix -> StateT IO Context Matrix
matMul :: Matrix -> Matrix -> StateT IO Context Matrix
-- FFI signature
zero :: Ptr Context -> CInt -> CInt -> IO (Ptr Matrix)
one :: Ptr Context -> CInt -> CInt -> IO (Ptr Matrix)
add :: Ptr Context -> Ptr Matrix -> Ptr Matrix -> IO (Ptr Matrix)
matmul :: Ptr Context -> Ptr Matrix -> Ptr Matrix -> IO (Ptr Matrix)
There are no standalone functions to zero
, one
, or add
a Matrix
without carrying the Context
.
Metadata
Metadata
Assignees
Labels
No labels