On 12-07-10 11:35 PM, Brandon Allbery wrote:
Quoth the Fine Manual (8.2.1.1. Using your own main()
<http://www.haskell.org/ghc/docs/latest/html/users_guide/ffi-ghc.html#using-own-main>):

There can be multiple calls to |hs_init()|, but each one should be
matched by one (and only one) call to |hs_exit()|^[14
<http://www.haskell.org/ghc/docs/latest/html/users_guide/ffi-ghc.html#ftn.id740774>]
.

So this should theoretically work.

Except that [14] says: the outermost hs_exit() de-initialises, and afterwards, cannot reliably re-initialise in current implementations.

So the currently working use-case is just:
Prog ::= nop | hs_init(); Prog; hs_exit()

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to