Copyright | © 2019-2022 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.
Synopsis
- data Module e = Module {
- moduleName :: Name
- moduleDescription :: Text
- moduleFields :: [Field e]
- moduleFunctions :: [DocumentedFunction e]
- moduleOperations :: [(Operation, DocumentedFunction e)]
- data Field e = Field {
- fieldName :: Text
- fieldDescription :: Text
- fieldPushValue :: LuaE e ()
- registerModule :: LuaError e => Module e -> LuaE e ()
- preloadModule :: LuaError e => Module e -> LuaE e ()
- preloadModuleWithName :: LuaError e => Module e -> Name -> LuaE e ()
- pushModule :: LuaError e => Module e -> LuaE e ()
- data Operation
Documented module
Named and documented Lua module.
Module | |
|
Self-documenting module field
Field | |
|
registerModule :: LuaError e => Module e -> LuaE e () Source #
Registers a Module
; leaves a copy of the module table on
the stack.
preloadModule :: LuaError e => Module e -> LuaE e () Source #
Preload self-documenting module using the module's default name.
preloadModuleWithName :: LuaError e => Module e -> Name -> LuaE e () Source #
Add the module under a different name to the table of preloaded packages.
pushModule :: LuaError e => Module e -> LuaE e () Source #
Pushes a documented module to the Lua stack.
Lua metadata operation types.
Add | the addition ( |
Sub | the subtraction ( |
Mul | the multiplication ( |
Div | the division ( |
Mod | the modulo ( |
Pow | the exponentiation ( |
Unm | the negation (unary |
Idiv | the floor division ( |
Band | the bitwise AND ( |
Bor | the bitwise OR ( |
Bxor | the bitwise exclusive OR (binary |
Bnot | the bitwise NOT (unary |
Shl | the bitwise left shift ( |
Shr | the bitwise right shift ( |
Concat | the concatenation ( |
Len | the length ( |
Eq | the equal ( |
Lt | the less than ( |
Le | the less equal ( |
Index | The indexing access operation |
Newindex | The indexing assignment |
Call | The call operation |
Tostring | The operation used to create a string representation of the object. |
Pairs | the operation of iterating over the object's key-value pairs. |
CustomOperation Name | a custom operation, with the metamethod name as parameter. |