Unacceptable result type in FFI

Neal Alexander wqeqweuqy at hotmail.com
Mon Nov 17 18:28:30 EST 2008


> Hm, if you don't turn on GeneralizedNewtypeDeriving with GHC,
> shouldn't it fail earlier on the definition of the newtype that you
> are deriving things for?
> 

Yea, it looks like it does honor -XForeignFunctionInterface. The 
"Monad.hs" below defines the newtypes, and haddock doesn't seem to have 
a problem with it.

> You should not pass --haddock-options to haddock itself. It's used to
> tell Cabal which options to give to Haddock. So the right line would
> be:
> 
>> haddock --optghc=-XGeneralizedNewtypeDeriving

Sorry, was a bad paste, i was running it through Cabal's Setup.hs.


Heres the output from running haddock directly on the two files:

------------------

$ haddock.exe -v \
	--optghc=-XGeneralizedNewtypeDeriving \
	--optghc=-DCALLCONV=ccall \
	--optghc=-XCPP
	--optghc=-XForeignFunctionInterface \
	Graphics/Rendering/OGL/GL/FlushFinish.hs


Graphics\Rendering\OGL\GL\FlushFinish.hs:39:0:
     Unacceptable result type in foreign declaration: GL ()
     When checking declaration:
         foreign import ccall unsafe "static  &glFlush" flush :: GL ()

Graphics\Rendering\OGL\GL\FlushFinish.hs:47:0:
     Unacceptable result type in foreign declaration: GL ()
     When checking declaration:
         foreign import ccall unsafe "static  &glFinish" finish :: GL ()

haddock: Failed to check module: Graphics.Rendering.OGL.GL.FlushFinish

------------------

$ haddock.exe -v \
	--optghc=-XGeneralizedNewtypeDeriving
	--optghc=-DCALLCONV=ccall
	--optghc=-XCPP
	--optghc=-XForeignFunctionInterface
	Graphics/Rendering/OGL/Monad.hs

Warning: main:Graphics.Rendering.OGL.Monad: could not find link 
destinations for:
     GHC.IOBase.IO Control.Arrow.Kleisli GHC.Base.Monad GHC.Base.Functor 
Control.Monad.Trans.MonadIO

### looks ok.

-----------------





More information about the HaskellDoc mailing list