[jhc] How newStablePtr return un-packable IO ()?

Kiwamu Okabe kiwamu at debian.or.jp
Wed Jun 5 10:37:52 CEST 2013


Hi.

On Wed, Jun 5, 2013 at 1:59 PM, Kiwamu Okabe <kiwamu at debian.or.jp> wrote:
> Now, I am trying create forkOS with  pthread.
> But StablePtr error stops it.
> Jhc's newStablePtr cannot pack IO () for running with unpack.

This is small library for forkOS.

  https://github.com/ajhc/ajhc-dumpyard/tree/master/try_pthread2

But forkOS API is different from GHC's.

> forkOS :: FunPtr (Ptr () -> IO (Ptr ())) -> IO ThreadId

I would like to convert any IO () to FunPtr (IO ()).
Of course, GHC has foreign import ccall “wrapper”, but jhc not.
No idea in me.......

Regards,
--
Kiwamu Okabe



More information about the jhc mailing list