Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yes. You can use stable pointers for this purpose.

A stable pointer is a reference to a Haskell expression that is guaranteed not to be affected by garbage collection, i.e., it will neither be deallocated nor will the value of the stable pointer itself change during garbage collection (ordinary references may be relocated during garbage collection). Consequently, stable pointers can be passed to foreign code, which can treat it as an opaque reference to a Haskell value.

https://hackage.haskell.org/package/base-4.7.0.1/docs/Foreig...



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: