You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This package is great, it really makes working with structs over the FFI easier. In my use-case I want to put a StablePtr inside a struct and return the struct over the FFI. Unfortunately this does not work, as StablePtr a does not instantiate Generic. It results in the following error message if want to create an (orphan) instance.
instanceCStorable (StablePtra)
/home/alex/allscale/insieme/code/analysis/src/cba/haskell/insieme-hat/src/Insieme/Adapter.hs:253:10: error:
• No instance for (Generic (StablePtr a))
arising from a use of ‘c-storable-deriving-0.1.2:Foreign.CStorable.TypeClass.$dmcPeek’
• In the expression:
c-storable-deriving-0.1.2:Foreign.CStorable.TypeClass.$dmcPeek
@StablePtr a
In an equation for ‘cPeek’:
cPeek
= c-storable-deriving-0.1.2:Foreign.CStorable.TypeClass.$dmcPeek
@StablePtr a
In the instance declaration for ‘CStorable (StablePtr a)’
Since Ptr a is an instance of Generic I can cast the StablePtr Ctx.Context to Ptr () and us this as a workaround.
Do you have an idea how I could get a StablePtr into my struct?
The text was updated successfully, but these errors were encountered:
This package is great, it really makes working with structs over the FFI easier. In my use-case I want to put a
StablePtr
inside a struct and return the struct over the FFI. Unfortunately this does not work, asStablePtr a
does not instantiateGeneric
. It results in the following error message if want to create an (orphan) instance.Since
Ptr a
is an instance ofGeneric
I can cast theStablePtr Ctx.Context
toPtr ()
and us this as a workaround.Do you have an idea how I could get a
StablePtr
into my struct?The text was updated successfully, but these errors were encountered: