Okay, for now I have figured out a working solution to the original problem I was facing .....
I just forkIO another IO action that does the actual network work and in addition, it opens a server socket and waits for commands.
The calls from C reach Haskell, from where a connection is made to the server and command is sent. A little convoluted but works. I have the whole implementation here -
https://github.com/ckkashyap/gmail
So now I am able to create a standalone, self sufficient DLL that I can just hand off to the folks in my org and they can write a C program and connect to gmail!!!!
Hey Donn ... when you say, implement the IO in C, you also imply implementing the SSL stuff too right? ... that's one thing I wanted to avoid - and I was also reluctant to use something like openSSL because that would come in the way of making standalone, self - sufficient DLL.
I really have to see what kind of performance hit my DLL has ...
Regards,
Kashyap