[Haskell-cafe] Replacement for Ptr () in FFI declaration?

Albert Y. C. Lai trebla at vex.net
Thu Sep 25 04:04:35 UTC 2014


On 14-09-24 05:56 PM, Howard B. Golden wrote:
>      Unacceptable argument type in foreign declaration: Ptr ()
>      When checking declaration:
>        foreign import stdcall safe "dynamic" prim_System_Win32_Com_Automation_TypeLib_setGuid
>          :: Ptr () -> Ptr () -> Ptr GUID -> IO Int32

It is not just 7.8 (I just tried 7.6), and it is not just GHC. It is 
about "dynamic", and it is in Haskell 98 with the FFI Addendum or 
Haskell 2010.

"The type of a dynamic stub has to be of the form (FunPtr ft) -> ft, 
where ft may be any foreign type."

In retrospect, I think you completely mistook the meaning of "dynamic".



More information about the Haskell-Cafe mailing list