6 Jul 1999 16:02:26 GMT, Marcin 'Qrczak' Kowalczyk <[EMAIL PROTECTED]> pisze:

> Is it possible to give C functions linked into a Haskell module the
> ability to call various Haskell IO functions?

Ah, I think I've found it (foreign export), but it does not work
with ghc-4.02 (the "glibc version" from Simon Marlow - it no longer
crashes on fflush, thanks!):

[qrczak ~/haskell]$ cat M.hs
module M (call_h) where
call_h = putStrLn "Hello\n"
foreign export "call_h" call_h :: IO ()
[qrczak ~/haskell]$ ghc -c M.hs -fglasgow-exts

Name.lhs:369: Non-exhaustive patterns in function nameSortModule


[qrczak ~/haskell]$

As I can't build ghc from sources and fix the problem myself, is
there any workaround?

How is `foreign import' interface related to _ccall_? Is the first
now preferable or they both will be equally continued?

-- 
 __("<    Marcin Kowalczyk * [EMAIL PROTECTED] http://kki.net.pl/qrczak/
 \__/          GCS/M d- s+:-- a22 C+++>+++$ UL++>++++$ P+++ L++>++++$ E-
  ^^                W++ N+++ o? K? w(---) O? M- V? PS-- PE++ Y? PGP->+ t
QRCZAK                  5? X- R tv-- b+>++ DI D- G+ e>++++ h! r--%>++ y-

Reply via email to