Open vmchale opened 4 years ago
I've looked into this a fair bit and adding the feature itself shouldn't be hard, I'm thinking about a syntax like:
{#pointer *archive as ArchivePtr foreign cfinalizer archive_free #}
The problem is that currently everything is imported qualified under the C2HSImp
namespace and I'm struggling to come up with a solution less ugly than:
import qualified Foreign.Concurrent as C2HSImp_Foreign_Concurrent
and special casing that one newForeignPtr
so it's generated as C2HSImp_Foreign_Concurrent.newForeignPtr
.
I'll mull it over a little more but if I haven't come up with anything better by Sunday I'll just go with something like that. Should be transparent to most users.
I ran into the following error with my libarchive bindings:
Looking at generated code, it looks like
c2hs
usesForeign.newForeignPtr
by default:(This is from
among other things)
Would it be possible to use
Foreign.Concurrent.newForeignPtr
with a new keyword?