Send Beginners mailing list submissions to beginners@haskell.org To subscribe or unsubscribe via the World Wide Web, visit http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners or, via email, send a message with subject or body 'help' to beginners-requ...@haskell.org
You can reach the person managing the list at beginners-ow...@haskell.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Beginners digest..." Today's Topics: 1. Strange type error with hsc2hs and cabal (PICCA Frederic-Emmanuel) ---------------------------------------------------------------------- Message: 1 Date: Sat, 30 Jan 2016 22:11:31 +0000 From: PICCA Frederic-Emmanuel <frederic-emmanuel.pi...@synchrotron-soleil.fr> To: "beginners@haskell.org" <beginners@haskell.org> Subject: [Haskell-beginners] Strange type error with hsc2hs and cabal Message-ID: <a2a20ec3b8560d408356cac2fc148e53b3033...@sun-dag3.synchrotron-soleil.fr> Content-Type: text/plain; charset="Windows-1252" Hello, I am still playing with FFI. Now I create a real project with cabal end build a library and an executable for my project. ---hkl.cabal--- name: hkl version: 0.1.0.0 executable ghkl main-is: ghkl.hs build-depends: base >=4.8 && <4.9 , containers >=0.5 && <0.6 , filepath , gtk >=0.13 && <0.14 , hkl hs-source-dirs: src default-language: Haskell2010 pkgconfig-depends: hkl build-tools: hsc2hs library exposed-modules: Hkl, Hkl.Types, Hkl.C, Hkl.DArray other-extensions: CPP, ForeignFunctionInterface, EmptyDataDecls, TypeFamilies, FlexibleInstances, FlexibleContexts, RecordWildCards build-depends: base >=4.8 && <4.9, containers >=0.5 && <0.6 hs-source-dirs: src build-tools: hsc2hs default-language: Haskell2010 pkgconfig-depends: hkl --- --- but when I compile my project I get this errormessage which is really strange. $ cabal build Package has never been configured. Configuring with default flags. If this fails, please run configure manually. Warning: The package list for 'hackage.haskell.org' is 17.1 days old. Run 'cabal update' to get the latest list of available packages. Resolving dependencies... Configuring hkl-0.1.0.0... Warning: 'data-files: ../../gui/ghkl.ui' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'. Building hkl-0.1.0.0... Preprocessing library hkl-0.1.0.0... [1 of 4] Compiling Hkl.Types ( src/Hkl/Types.hs, dist/build/Hkl/Types.o ) [2 of 4] Compiling Hkl.C ( src/Hkl/C.hs, dist/build/Hkl/C.o ) [3 of 4] Compiling Hkl.DArray ( dist/build/Hkl/DArray.hs, dist/build/Hkl/DArray.o ) [4 of 4] Compiling Hkl ( src/Hkl.hs, dist/build/Hkl.o ) In-place registering hkl-0.1.0.0... Preprocessing executable 'ghkl' for hkl-0.1.0.0... [1 of 4] Compiling Hkl.Types ( src/Hkl/Types.hs, dist/build/ghkl/ghkl-tmp/Hkl/Types.o ) [2 of 4] Compiling Hkl.C ( src/Hkl/C.hs, dist/build/ghkl/ghkl-tmp/Hkl/C.o ) [3 of 4] Compiling Hkl ( src/Hkl.hs, dist/build/ghkl/ghkl-tmp/Hkl.o ) [4 of 4] Compiling Main ( src/ghkl.hs, dist/build/ghkl/ghkl-tmp/Main.o ) src/ghkl.hs:44:39: Couldn't match expected type ?Hkl.Types.EngineList? with actual type ?Hkl.EngineList? NB: ?Hkl.Types.EngineList? is defined in ?Hkl.Types? in package ?hkl-0.1.0.0? ?Hkl.EngineList? is defined at src/Hkl/Types.hs:22:1-74 In the first argument of ?Hkl.engineListEnginesGet?, namely ?engines? In a stmt of a 'do' block: tmp <- Hkl.engineListEnginesGet engines if I add a other-modules to ghkl an remove the hkl dependecy it work great. so what is wrong with this project. PS: the DArray module is indeed the one using hsc2hs :) Thansk for your help Frederic ------------------------------ Subject: Digest Footer _______________________________________________ Beginners mailing list Beginners@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners ------------------------------ End of Beginners Digest, Vol 91, Issue 38 *****************************************