Hi,

I'm continuing to experiment with HDirect and the ihc compiler. Trying the "huge" type libraries from Office applications (Word, Excel...), I've met the following issue: some Haskell stubs do not compile out of the box, essentially because of type mismatch between the type signature generated by the ihc compiler and the stub's code.
For instance:

> Excel.hs:32:25:
No instance for (Automation.Variant a0)
arising from use of `Automation.outVariant' at Excel.hs:32:25-45
Possible fix:
add (Automation.Variant a0)
to the type signature(s) for `global_getActiveCell'

The faulty declaration is indeed :
global_getActiveCell :: Global a1 -> Prelude.IO a0
global_getActiveCell = Automation.propertyGet "ActiveCell" [] Automation.outVariant

whereas the correct type is (Automation.Variant a0) => Global a1 -> Prelude.IO a0

There are also some cases where there is a type mismatch between "Int64" and "Automation.Date" type, but the essence of the error is the same : the type signature does not
match the method's stub's code.

I've looked for an option in the compiler that would help (for instance, I suppose that removing all type signatures from the haskell file would allow to compile it), but I haven't found one.

NB : the ihc command line was "../src/ihc.exe --tlb -fautomation -fprefix-interface-name -fmaybe-optional-params -v XL5EN32.OLB
(where the OLB file is Excel's type library).

Did anyone experienced similar issue ?

Thanks in advance,

sL

PS: the COM library (without Automation) works well.


Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses.