How to use functions in dll file in Haskell program?

Derek Elkins ddarius@hotpop.com
Fri, 18 Jul 2003 13:34:30 -0400


On Fri, 18 Jul 2003 18:29:35 +0800
"Liu Junfeng" <liujf@softhome.net> wrote:

> Hi__
> If there is a function named "func" with type a->b in a win32 dll
> file. In Hugs use the primitive declaration:
> -------------------------------
> primitive prim_func :: a -> b  
> func = prim_func
> -------------------------------
> Then the func can be exported to be used in other modules.
> 
> The question is how to do it in GHC?

There's now an effectively standard FFI mechanism that you should be
using for any implementation.  According to the FFI page, Hugs conforms
to the standard, so you should be using it in Hugs as well.

http://www.cse.unsw.edu.au/~chak/haskell/ffi/

As far as DLLs go it's certainly possible to do with GHC.  Read the FFI
addendum and perhaps search this mailinglist for some details.