pure-c/purec

Move main function into `Effect Int`

felixSchl opened this issue · 1 comments

Either:

  • mandate this for all main functions,
  • or detect at compile time based on the type of main (if that information is even available),
  • or by checking the return value at runtime: if NULL (implying Unit), return 0, else return purs_any_get_int(...) of result.

(3) has been implemented. Programs returning Unit return 0 and programs returning Int return the returned integer. Use --non-strict-main to avoid special handling altogether: the returned value is released and we return 0.