Skip to content

Fix up the semantics of IO #35

@jparoz

Description

@jparoz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugimprovementImproves the way that an existing feature works, in a backwards-compatible way.

    Projects

    Status

    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions