I have some questions about the ffi in haskell.
first of all i'm trying to work with c structs in haskell.
there i have some questions: i have a struct like
struct foo{int a; float b;};
- when could i use
data Foo = Foo { a :: Int, b :: Float } deriving (Show, Eq) - when i have to implement a storable with peek and poke?
okay now a question about FunPtr
- i dont know when to use
FunPtrwhy a normal definition likePtr CInt -> IO CIntis not enough?