[Haskell-beginners] which typefor this FFI call

PICCA Frederic-Emmanuel frederic-emmanuel.picca at synchrotron-soleil.fr
Wed Jun 28 14:48:56 UTC 2017


> 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#v:castStablePtrToPtr


More information about the Beginners mailing list