HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulelua-2.3.2Haskell2010

Lua.Ersatz.Functions

Ersatz functions for Lua API items which may, directly or indirectly, throw a Lua error.

  • 9 values
  • Packagelua-2.3.2
  • Exports9
  • LanguageHaskell2010
  • LicenceMIT
  • SourceFunctions.hs
valuehslua_arith
  1. :: State
  2. -> ArithOPCode

    op

  3. -> Ptr StatusCode
  4. -> IO ()
#

Performs an arithmetic or bitwise operation over the two values (or one, in the case of negations) at the top of the stack, with the value at the top being the second operand, pops these values, and pushes the result of the operation. The function follows the semantics of the corresponding Lua operator (that is, it may call metamethods).

The value of op must be one of the following constants:

  • LUA_OPADD: performs addition (+)

  • LUA_OPSUB: performs subtraction (-)

  • LUA_OPMUL: performs multiplication (*)

  • LUA_OPDIV: performs float division (/)

  • LUA_OPIDIV: performs floor division (//)

  • LUA_OPMOD: performs modulo (%)

  • LUA_OPPOW: performs exponentiation (^)

  • LUA_OPUNM: performs mathematical negation (unary -)

  • LUA_OPBNOT: performs bitwise NOT (~)

  • LUA_OPBAND: performs bitwise AND (&)

  • LUA_OPBOR: performs bitwise OR (|)

  • LUA_OPBXOR: performs bitwise exclusive OR (~)

  • LUA_OPSHL: performs left shift (<<)

  • LUA_OPSHR: performs right shift (>>)

This function wraps lua_arith and takes an additional parameter status; if it is not NULL, then the return value is set to the status after calling lua_arith.

valuehslua_compare
  1. :: State
  2. -> StackIndex

    index 1

  3. -> StackIndex

    index 2

  4. -> OPCode

    operator

  5. -> Ptr StatusCode

    status

  6. -> IO LuaBool
#

Compares two Lua values. Returns 1 if the value at index index1 satisfies op when compared with the value at index index2, following the semantics of the corresponding Lua operator (that is, it may call metamethods). Otherwise returns 0. Also returns 0 if any of the indices is not valid.

The value of op must be one of the following constants:

This function wraps lua_compare and takes an additional parameter status; if it is not NULL, then the return value is set to the status after calling lua_compare.

Get functions (Lua -> stack)

2 declarations

Set functions (stack -> Lua)

2 declarations

Misc

3 declarations