[Haskell-cafe] C binding <-> safer haskell API
PICCA Frederic-Emmanuel
frederic-emmanuel.picca at synchrotron-soleil.fr
Wed Feb 9 17:43:39 UTC 2022
Hello, I try to create a binding for a C library
I can find something like this in the c library
merge(HklCube *cube, const HklFrame *frame)
So I create a binding with binding-DSL
#ccall merge, Ptr <HklCube> -> Ptr <HklFrame> -> IO ()
Now I want to create a higher level API whcich encode the fact that the
cube is modified after the merge. So what is the best way to encode this in the type ?
merge :: _
merge c f = do
....
c'merge pc pf
I thought about IORef, but I am not sure thaht this is the right way to have a safer haskell interface for this method.
thanks for your help
Fred
More information about the Haskell-Cafe
mailing list