ForeignPtr's - why can't they be passed directly to foreignfunctions?

Brian Hulley brianh at metamilk.com
Wed Mar 15 12:09:16 EST 2006


Brian Hulley wrote:
> Hi -
> I've got the beginnings of an API for a GUI system as follows:

> foreign import ccall duma_createEdit :: IO (Ptr (Edit a))
>
> createEdit :: IO (ForeignPtr (Edit a))

These should of course be:

       foreign import ccall duma_createEdit :: IO (Ptr (Edit ()))
and
      createEdit :: IO (ForeignPtr (Edit ()))

(just in case anyone else new to phantom types reads this email before 
writing a GUI)

Regards, Brian. 



More information about the Glasgow-haskell-users mailing list