
9 Feb
2022
9 Feb
'22
12:43 p.m.
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