Conceptually, an IO Int represents an effectful action, which when executed, yields an Int.
The Lua function function() return 5 end seems like something which should have the type IO Int; but as currently implemented, the function has type () -> IO Int.
The probable fix for this is to change the representation of an IO Int from being "an Int which possibly comes with side-effects" into being "a Lua function which takes no arguments, and returns an Int, possibly also causing side-effects".
Basically, in Lua, to "execute an IO action", you do a function call.
Conceptually, an
IO Intrepresents an effectful action, which when executed, yields anInt.The Lua function
function() return 5 endseems like something which should have the typeIO Int; but as currently implemented, the function has type() -> IO Int.The probable fix for this is to change the representation of an
IO Intfrom being "an Int which possibly comes with side-effects" into being "a Lua function which takes no arguments, and returns an Int, possibly also causing side-effects".Basically, in Lua, to "execute an
IOaction", you do a function call.