[Haskell-cafe] FunPtr error?
Ryan Ingram
ryani.spam at gmail.com
Mon Jun 9 15:16:25 EDT 2008
> type Notify = Sigval -> IO ()
> foreign import ccall "wrapper" mkNotify :: Notify -> IO (FunPtr Notify)
then
> main = do
> notifyFPtr <- mkNotify notifyFunc
> -- rest of code here
>
> -- then, when you are done and nothing is referencing the pointer any more
> freeHaskellFunPtr notifyFPtr
On 6/9/08, Galchin, Vasili <vigalchin at gmail.com> wrote:
> In any case, what I want to do is store FunPtr in a data type and marshall
> into a C struct as a C function pointer.
>
> Vasili
This will be suitable for that purpose.
-- ryan
More information about the Haskell-Cafe
mailing list