
28 Jun
2017
28 Jun
'17
2:48 p.m.
Yes it's strange that `castStablePtrToPtr` returns `Ptr ()` instead of `Ptr a`. You can use `castPtr` to get the type back:
the type signature of castStablePtrTOPtr is :: StablePtr a -> Ptr () So yes we loose the type. I will check if this work
let opData = InOut $ castPtr $ castStablePtrToPtr statePtr
Thanks Frederic ps: http://hackage.haskell.org/package/base-4.9.1.0/docs/Foreign-StablePtr.html#...