[Haskell-cafe] Medical Instruments -> Jason

Jason Dusek jason.dusek at gmail.com
Wed Nov 11 20:26:13 EST 2009

  First of all, I find it striking that you are using the

    foreign import ccall unsafe "rs232.h closecport" c_closecport ::
CInt -> CInt

  and that it actually works. I would think the only workable
  declaration would be:

    foreign import stdcall unsafe "rs232.h closecport" closecport :: IO ()

  You've tried the signature with `stdcall` and `IO ()` and it
  doesn't work at all?

  Likewise, your signature for `c_sendmsg` strikes me as
  perilous. It should result in a value in `IO`.

  However, let's ignore all that for now. I wonder, does the
  Haskell always call `closecport`? Maybe you could put in a
  print statement in the C to find out?

Jason Dusek

More information about the Haskell-Cafe mailing list