Copyright | © 2019-2021 Albert Krewinkel |
---|---|
License | MIT |
Maintainer | Albert Krewinkel <albert+hslua@zeitkraut.de> |
Stability | alpha |
Portability | Requires GHC 8 or later. |
Safe Haskell | None |
Language | Haskell2010 |
Utility functions for HsLua modules.
Documentation
requirehs :: LuaError e => Name -> LuaE e () -> LuaE e () Source #
Load a module, defined by a Haskell action, under the given name.
Similar to luaL_required
: After checking "loaded" table,
calls pushMod
to push a module to the stack, and registers
the result in package.loaded
table.
The pushMod
function must push exactly one element to the top
of the stack. This is not checked, but failure to do so will
lead to problems. Lua's package
module must have been loaded
by the time this function is invoked.
Leaves a copy of the module on the stack.