I\'m attempting to create a Haskell wrapper for a C library. The underlying structs are too complicated to express as explicit types, and I don\'t actually use them other than f
Here's another approach that might work for you. I assume that you have access to all of the C header files that define the objects you need to allocate. If that's true, you could write a thin layer of C code for allocating and freeing the C objects. Your Haskell code can then call these C functions without the Haskell code ever needing to know what's behind the pointers. Haskell can also automatically call the free code when Haskell's garbage collector knows that the objects are no longer needed.