h$Ҷ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~          2007@2012 Gracjan Polak;  2012@2016 mer Sinan Aacan;  2017-2022 Albert KrewinkelMIT,Albert Krewinkel betanon-portable (depends on GHC)None 86lua2The number of results returned by a function call.lua8The number of arguments consumed curing a function call.lua A stack index luaGarbage-collection options. luaInteger code used to signal the status of a thread or computation. luaArithmetic operator code.luaRelational operator code.lua4Integer code used to encode the type of a Lua value.lua:Boolean value returned by a Lua C API function. This is a  and should be interpreted as  iff the value is 0,  otherwise.luaThe type of floats in Lua.By default this type is , but that can be changed in Lua to a single float or a long double. (See LUA_FLOAT_TYPE in  luaconf.h.)See  5https://www.lua.org/manual/5.4/manual.html#lua_Number lua_Number.luaThe type of integers in Lua.By default this type is <, but that can be changed to different values in Lua. (See  LUA_INT_TYPE in  luaconf.h.)See  6https://www.lua.org/manual/5.4/manual.html#lua_Integer lua_Integer.luaThe type of warning functions, called by Lua to emit warnings. The first parameter is an opaque pointer set by  lua_setwarnf. The second parameter is the warning message. The third parameter is a boolean that indicates whether the message is to be continued by the message in the next call.See  3https://www.lua.org/manual/5.4/manual.html#pdf-warnwarn" for more details about warnings.luaThe reader function used by  . Every time it needs another piece of the chunk, lua_load calls the reader, passing along its data parameter. The reader must return a pointer to a block of memory with a new piece of the chunk and set size to the block size. The block must exist until the reader function is called again. To signal the end of the chunk, the reader must return NULL or set size to zero. The reader function may return pieces of any size greater than zero.See  5https://www.lua.org/manual/5.4/manual.html#lua_Reader lua_Reader.lua>Type of Haskell functions that can be turned into C functions.#This is the same as a dereferenced .luaType for C functions.In order to communicate properly with Lua, a C function must use the following protocol, which defines the way parameters and results are passed: a C function receives its arguments from Lua in its stack in direct order (the first argument is pushed first). So, when the function starts,   returns the number of arguments received by the function. The first argument (if any) is at index 1 and its last argument is at index  . To return values to Lua, a C function just pushes them onto the stack, in direct order (the first result is pushed first), and returns the number of results. Any other value in the stack below the results will be properly discarded by Lua. Like a Lua function, a C function called by Lua can also return many results.See  8https://www.lua.org/manual/5.4/manual.html#lua_CFunction lua_CFunction.luaAn opaque structure that points to a thread and indirectly (through the thread) to the whole state of a Lua interpreter. The Lua library is fully reentrant: it has no global variables. All information about a state is accessible through this structure. Synonym for  lua_State *. See  )https://www.lua.org/manual/5.4/#lua_State lua_State.      2007@2012 Gracjan Polak;  2012@2016 mer Sinan Aacan;  2017-2022 Albert KrewinkelMIT,Albert Krewinkel betaForeignFunctionInterface, CPPNone "Tlua0Pointer to function opening the package library.Ulua.Pointer to function opening the debug library.Vlua-Pointer to function opening the math library.Wlua/Pointer to function opening the string library.Xlua+Pointer to function opening the os library.Ylua+Pointer to function opening the io library.Zlua.Pointer to function opening the table library.[lua-Pointer to function opening the base library.TUVWXYZ[[ZYXWVUT 2007@2012 Gracjan Polak;  2012@2016 mer Sinan Aacan;  2017-2022 Albert KrewinkelMIT,Albert Krewinkel betaForeignFunctionInterface, CPPNone $ \luaWrapper around  1https://lua.org/manual/5.4/manual.html#lua_concat lua_concat which catches any Lua errors.]luaWrapper around  /https://lua.org/manual/5.4/manual.html#lua_nextlua_next which catches any Lua errors.^luaReplacement for  0https://lua.org/manual/5.4/manual.html#lua_error lua_error; it uses the HsLua error signaling convention instead of raw Lua errors._lua Behaves like , but prevents unrecoverable program crashes by calling that function through  . Takes an additional status code pointer that is set to the status returned by  lua_pcall.`lua Behaves like , but prevents unrecoverable program crashes by calling that function through  . Takes an additional status code pointer that is set to the status returned by  lua_pcall.alua Behaves like , but prevents unrecoverable program crashes by calling that function through  . Takes an additional status code pointer that is set to the status returned by  lua_pcall.blua Behaves like , but prevents unrecoverable program crashes by calling that function through  . Takes an additional status code pointer that is set to the status returned by  lua_pcall.clua!Compares two Lua values. Returns 1 if the value at index index15 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.7The value of op must be one of the following constants:: compares for equality (==): compares for less than (<)!: compares for less or equal (<=)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.dluaPerforms 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.cluaindex 1luaindex 2luaoperatorluastatusdluaop \]^_`abcd dcba`_^]\ 2007@2012 Gracjan Polak;  2012@2016 mer Sinan Aacan;  2017-2022 Albert KrewinkelMIT,Albert Krewinkel betanon-portable (depends on GHC)None (~eluaConverts object to string, respecting any metamethods; returns NULL if an error occurs.fluaIf modname is not already present in package.loaded. calls function openf with string modname- as an argument and sets the call result in package.loaded[modname]0, as if that function has been called through  6https://www.lua.org/manual/5.4/manual.html#pdf-requirerequire.If glb- is true, also stores the module into global modname.)Leaves a copy of the module on the stack.gluaCreates a new Lua state and set extra registry values for error bookkeeping.fluamodnameluaopenfluaglbefggfe 2007@2012 Gracjan Polak;  2012@2016 mer Sinan Aacan;  2017-2022 Albert KrewinkelMIT,Albert Krewinkel betaForeignFunctionInterface, CPPNone hluaEmits a warning with the given message. A message in a call with tocont; true should be continued in another call to this function.See  3https://www.lua.org/manual/5.4/manual.html#pdf-warnwarn" for more details about warnings. 6https://www.lua.org/manual/5.4/manual.html#lua_warningiluaReturns the address of the version number (a C static variable) stored in the Lua core. When called with a valid , returns the address of the version used to create that state. When called with NULL6, returns the address of the version running the call. 6https://www.lua.org/manual/5.4/manual.html#lua_versionjlua2Returns the name of the type encoded by the value tp,, which must be one the values returned by k. 7https://www.lua.org/manual/5.4/manual.html#lua_typenamekluahttps://www.lua.org/manual/5.4/manual.html#lua_pushglobaltableluaPushes a Cfunction onto the stack. This function receives a pointer to a Cfunction and pushes onto the stack a Lua value of type function9 that, when called, invokes the corresponding Cfunction.Any function to be callable by Lua must follow the correct protocol to receive its parameters and return its results (see ). >= \case FALSE -> return () _ -> do lua_type l (-2) >>= lua_typename l >>= peekCString >>= putStrLn lua_type l (-1) >>= lua_typename l >>= peekCString >>= putStrLn -- removes 'value'; keeps 'key' for next iteration lua_pop l 1 loop loop&While traversing a table, do not call p directly on a key, unless you know that the key is actually a string. Recall that p may change the value at the given index; this confuses the next call to  3https://www.lua.org/manual/5.4/manual.html#lua_nextlua_next.See function  3https://www.lua.org/manual/5.4/manual.html#pdf-nextnext> for the caveats of modifying the table during its traversal.WARNING: lua_next is unsafe in Haskell: This function will cause an unrecoverable crash an error if the given key is neither nil. nor present in the table. Consider using the   ersatz function instead.luaThis function creates and pushes on the stack a new full userdata, with nuvalue associated Lua values, called  user values/, plus an associated block of raw memory with size bytes. (The user values can be set and read with the functions w and .)The function returns the address of the block of memory. Lua ensures that this address is valid as long as the corresponding userdata is alive (see  .https://www.lua.org/manual/5.4/manual.html#2.52.5?). Moreover, if the userdata is marked for finalization (see  0https://www.lua.org/manual/5.4/manual.html#2.5.32.5.3), its address is valid at least until the call to its finalizer. https://www.lua.org/manual/5.4/manual.html#lua_islightuserdataluaReturns  ! if the value at the given index is an integer (that is, the value is a number and is represented as an integer), and   otherwise. 8https://www.lua.org/manual/5.4/manual.html#lua_isintegerluaReturns  ! if the value at the given index is a function (either C or Lua), and   otherwise. 9https://www.lua.org/manual/5.4/manual.html#lua_isfunctionluaReturns  !7 if the value at the given index is a C function, and   otherwise. :https://www.lua.org/manual/5.4/manual.html#lua_iscfunctionluaReturns  !4 if the value at the given index is a boolean, and   otherwise. 8https://www.lua.org/manual/5.4/manual.html#lua_isbooleanluaMoves the top element into the given valid index, shifting up the elements above this index to open space. This function cannot be called with a pseudo-index, because a pseudo-index is not an actual stack position. 5https://www.lua.org/manual/5.4/manual.html#lua_insertluaPushes onto the stack the n-th user value associated with the full userdata at the given index and returns the type of the pushed value.1If the userdata does not have that value, pushes nil and returns  LUA_TNONE. >)WARNING:  lua_arith is unsafe in Haskell: if the call to a metamethod triggers an error, then that error cannot be handled and will lead to an unrecoverable program crash. Consider using the  ' ersatz function instead. Likewise, the metamethod may not call a Haskell function unless the library was compiled without allow-unsafe-gc. 4https://www.lua.org/manual/5.4/manual.html#lua_arith.luaConverts the acceptable index idx into an equivalent absolute index (that is, one that does not depend on the stack top). 7https://www.lua.org/manual/5.4/manual.html#lua_absindex hluamessageluatocontjluatp oluaindexluaisnumpluaindexlualenqluaindexluaisnumvluafluaudwluaindexluanxluaindex yluaindex {luaname |luaidxluanluan luaidx1luaidx2luas luaslualenluafnluafnluanluan luanargsluanresultsluamsghluaindex luasizeluanuvalueluareaderluadatalua chunknameluamodeluaindexluanluaindex luaname luawhatluadata1luadata2luadata3luanarrluanrecluafromidxluatoidxluan luan luaop luaidx\]^_`abcdefghijklmnopqrstuvwxyz{|}~~}|{zyxwvutsrqponmlkjih( 2007@2012 Gracjan Polak;  2012@2016 mer Sinan Aacan;  2017-2022 Albert KrewinkelMIT,Albert Krewinkel betaNone \]^_`abceg ba`_^]\cge 2007@2012 Gracjan Polak;  2012@2016 mer Sinan Aacan;  2017-2022 Albert KrewinkelMIT,Albert Krewinkel betaForeignFunctionInterfaceNone 3lua Value which Lua usually uses as .lua Value which Lua usually uses as .lua,Value signaling that no reference was found.lua.Value signaling that no reference was created.lua*Changes the collector to incremental mode.lua+Changes the collector to generational mode.luaReturns a boolean that tells whether the collector is running (i.e., not stopped).luaSets data as the new value for the step multiplier of the collector (see 2.5) and returns the previous value of the step multiplier.luaSets data as the new value for the pause of the collector (see 2.5) and returns the previous value of the pause.lua3Performs an incremental step of garbage collection.luaReturns the remainder of dividing the current amount of bytes of memory in use by Lua by 1024.lua?Returns the current amount of memory (in Kbytes) in use by Lua.lua)Performs a full garbage-collection cycle.luaRestarts the garbage collector.luaStops the garbage collector.luaPerforms right shift (>>)luaPerforms left shift (<<)luaPerforms bitwise exclusive OR (~)luaPerforms bitwise OR (|)luaPerforms bitwise AND (&)luaPerforms bitwise NOT (~)lua&Performs mathematical negation (unary -)luaPerforms exponentiation (^)luaPerforms modulo (%)luaPerforms floor division (//)luaPerforms float division (/)luaPerforms multiplication (*)luaPerforms subtraction (-)luaPerforms addition (+).luaCompares for less or equal (<=)luaCompares for less than (<)luaCompares for equality (==)lua=File related error (e.g., the file cannot be opened or read).lua(Error while running the message handler.luaMemory allocation error. For such errors, Lua does not call the message handler.luaA syntax error.luaA runtime error.luaYielding / suspended coroutine.luaSuccess.luaType of Lua threadsluaType of full user datalua$Type of functions, either normal or luaType of Lua tablesluaType of Lua string valuesluaType of Lua numbers. See  )luaType of light userdataluaType of Lua booleansluaType of Lua's nil valueluaNon-valid stack indexlua Stack index of the Lua registry.luaOption for multiple returns in  .33 2007@2012 Gracjan Polak;  2012@2016 mer Sinan Aacan;  2017-2022 Albert KrewinkelMIT,Albert Krewinkel betanon-portable (depends on GHC)None XluaPushes a Haskell operation as a Lua function. The Haskell operation is expected to follow the custom error protocol, i.e., it must signal errors with  *.Example4Export the function to calculate triangular numbers. let triangular :: PreCFunction triangular l' = do n <- lua_tointegerx l' (nthBottom 1) nullPtr lua_pushinteger l' (sum [1..n]) return (NumResults 1) hslua_newhsfunction l triangular withCString "triangular" (lua_setglobal l) 2007@2012 Gracjan Polak;  2012@2016 mer Sinan Aacan;  2017-2022 Albert KrewinkelMIT,Albert Krewinkel betanon-portable (depends on GHC)None ©luaReference to a stored value.luaReference to a stored valueluaReference to a nil valueluaPushes onto the stack a string identifying the current position of the control at level lvl in the call stack. Typically this string has the following format: chunkname:currentline:Level0 is the running function, level1 is the function that called the running function, etc.;This function is used to build a prefix for error messages.lua%Checks whether the function argument arg is a userdata of the type tname (see )) and returns the userdata address (see  + ). Returns NULL if the test fails. 9https://www.lua.org/manual/5.4/manual.html#luaL_testudataluaReleases reference ref from the table at index t (see ). The entry is removed from the table, so that the referred object can be collected. The reference ref! is also freed to be used again.lua,Creates and pushes a traceback of the stack l1. If msg is not NULL it is appended at the beginning of the traceback. The level parameter tells at which level to start the traceback.lua7Creates and returns a reference, in the table at index t, for the object at the top of the stack (and pops the object).A reference is a unique integer key. As long as you do not manually add integer keys into table t, luaL_ref ensures the uniqueness of the key it returns. You can retrieve an object referred by reference r by calling lua_rawgeti l t r . Function . frees a reference and its associated object..If the object at the top of the stack is nil, luaL_ref returns the constant ,. The constant -? is guaranteed to be different from any reference returned by luaL_ref.lua6Opens all standard Lua libraries into the given state. 8https://www.lua.org/manual/5.4/manual.html#luaL_openlibslua$If the registry already has the key tname , returns 0. Otherwise, creates a new table to be used as a metatable for userdata, adds to this new table the pair __name = tname!, adds to the registry the pair [tname] = new table, and returns 1. (The entry __name, is used by some error-reporting functions.)In both cases pushes onto the stack the final value associated with tname in the registry.lua0Loads a file as a Lua chunk. This function uses lua_load? to load the chunk in the file named filename. If filename is NULL, then it loads from the standard input. The first line in the file is ignored if it starts with a #.%The string mode works as in function lua_load.*This function returns the same results as lua_load, but it has an extra error code LUA_ERRFILE for file-related errors (e.g., it cannot open or read the file).As lua_load:, this function only loads the chunk; it does not run it.lua0Equivalent to luaL_loadfilex with mode equal to NULL.lua2Loads a buffer as a Lua chunk. This function uses lua_load0 to load the chunk in the buffer pointed to by buff with size sz.*This function returns the same results as lua_load. name is the chunk name, used for debug information and error messages.luaPushes onto the stack the metatable associated with name tname in the registry (see ) (nil if there is no metatable associated with that name). Returns the type of the pushed value.lua Pushes onto the stack the field e, from the metatable of the object at index obj and returns the type of the pushed value. If the object does not have a metatable, or if the metatable does not have this field, pushes nothing and returns ..lua2Key, in the registry, for table of loaded modules.lua5Key, in the registry, for table of preloaded loaders.lua,Convert a reference to its C representation.lua-Create a reference from its C representation. luallualvllualluaargluatnameluat luaref luallual1luamsglualevelluat luatname luafilenameluamodeluafilenameluabuffluaszluanameluaobjluae  2021-2022 Albert KrewinkelMIT,Albert Krewinkel betaportableNone GluaRuns operations on a new Lua . The state is created when the function is called and closed on return. The state, and all pointers to values within it, must not% be used after the function returns.Example do luaL_openlibs l withCString "print" (lua_getglobal l) withCString "_VERSION" (lua_getglobal l) lua_pcall l (NumArgs 1) (NumResults 1) (StackIndex 0)lua9Stack index of the nth element from the top of the stack.luabetaForeignFunctionInterfaceNone luaCreates and registers a new metatable for a userdata-wrapped Haskell value; checks whether a metatable of that name has been registered yet and uses the registered table if possible.luaCreates a new userdata wrapping the given Haskell object, with nuvalue$ associated Lua values (uservalues).luaRetrieves a Haskell object from userdata at the given index. The userdata must have the given name.lua?Replaces the Haskell value contained in the userdata value at index&. Checks that the userdata is of type name and returns  on success, or  otherwise.lua Lua stateluaUserdata name (__name)lua&True iff new metatable was created.luavalue to be wrappedluanuvalueluauserdata indexluanameluaindexluanameluanew Haskell value//01123345566778899:;;))<<=>?@AABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}$*#"~'+ !-,.          lua-2.2.1-KlU5RPNhml0CgrTmPpae4U Lua.TypesLua.LibLua.Ersatz.FunctionsLua.Ersatz.Auxiliary Lua.Primary Lua.ConstantsLua.Call Lua.AuxiliaryLua Lua.Userdataload Lua.Functions lua_gettop lua_setglobal lua_pcall lua_settable lua_getglobal lua_gettableLUA_OPEQLUA_OPLTLUA_OPLE LUA_TNONELUA_OK LUA_YIELDhslua_settablehslua_setglobal LUA_MULTRETFALSE hslua_next LUA_ERRSYNTAX LUA_ERRMEM LUA_ERRGCMMTRUEhslua_gettablehslua_getglobal hslua_concatForeign.ForeignPtr newForeignPtr hslua_arith Lua.ErsatzNumber hslua_errorlua_touserdata LUA_REFNIL LUA_NOREFLUA_TNIL NumResultsfromNumResultsNumArgs fromNumArgs StackIndexfromStackIndexGCCode StatusCode ArithOPCodeOPCodeTypeCode fromTypeCodeLuaBoolInteger WarnFunctionReader PreCFunction CFunctionState $fReadInteger $fShowInteger $fReadNumber $fShowNumber$fEqNumResults$fNumNumResults$fOrdNumResults$fShowNumResults $fEqNumArgs $fNumNumArgs $fOrdNumArgs $fShowNumArgs$fEnumStackIndex$fEqStackIndex$fNumStackIndex$fOrdStackIndex$fShowStackIndex $fEqGCCode$fStorableGCCode $fShowGCCode$fEqStatusCode$fStorableStatusCode$fShowStatusCode$fEqArithOPCode$fStorableArithOPCode$fShowArithOPCode $fEqOPCode$fStorableOPCode $fShowOPCode $fEqTypeCode $fOrdTypeCode$fShowTypeCode $fEqLuaBool$fStorableLuaBool $fShowLuaBool $fEqNumber$fFloatingNumber$fFractionalNumber $fNumNumber $fOrdNumber $fRealNumber$fRealFloatNumber$fRealFracNumber$fBoundedInteger $fEnumInteger $fEqInteger$fIntegralInteger $fNumInteger $fOrdInteger $fRealInteger $fEqState$fGenericStateluaopen_package luaopen_debug luaopen_mathluaopen_string luaopen_os luaopen_io luaopen_table luaopen_base hslua_comparehsluaL_tolstringhsluaL_requirefhsluaL_newstate lua_warning lua_version lua_typenamelua_type lua_tothread lua_topointer lua_tonumberx lua_tolstringlua_tointegerxlua_tocfunction lua_tobooleanlua_stringtonumber lua_status lua_setwarnflua_setiuservalue lua_settoplua_setmetatable lua_rotate lua_replace lua_remove lua_rawseti lua_rawset lua_rawlen lua_rawgeti lua_rawget lua_rawequal lua_pushvaluelua_pushthreadlua_pushstringlua_pushnumber lua_pushnillua_pushlstringlua_pushlightuserdatalua_pushintegerlua_pushglobaltablelua_pushcfunctionlua_pushcclosurelua_pushbooleanlua_poplua_nextlua_newuserdatauv lua_newthreadlua_loadlua_isuserdata lua_isthread lua_istable lua_isstring lua_isnumberlua_isnoneornil lua_isnone lua_isnillua_islightuserdata lua_isintegerlua_isfunctionlua_iscfunction lua_isboolean lua_insertlua_getiuservaluelua_getmetatablelua_gclua_createtablelua_copy lua_concat lua_close_ptr lua_closelua_checkstack lua_arith lua_absindex LUA_GCINC LUA_GCGENLUA_GCISRUNNINGLUA_GCSETSTEPMULLUA_GCSETPAUSE LUA_GCSTEP LUA_GCCOUNTB LUA_GCCOUNT LUA_GCCOLLECT LUA_GCRESTART LUA_GCSTOP LUA_OPSHR LUA_OPSHL LUA_OPBXOR LUA_OPBOR LUA_OPBAND LUA_OPBNOT LUA_OPUNM LUA_OPPOW LUA_OPMOD LUA_OPIDIV LUA_OPDIV LUA_OPMUL LUA_OPSUB LUA_OPADD LUA_ERRFILE LUA_ERRERR LUA_ERRRUN LUA_TTHREAD LUA_TUSERDATA LUA_TFUNCTION LUA_TTABLE LUA_TSTRING LUA_TNUMBERLUA_TLIGHTUSERDATA LUA_TBOOLEANLUA_REGISTRYINDEXhslua_pushhsfunction ReferenceRefNil luaL_whereluaL_testudata luaL_unrefluaL_tracebackluaL_ref luaL_openlibsluaL_newmetatableluaL_loadfilex luaL_loadfileluaL_loadbufferluaL_getmetatableluaL_getmetafieldloadedTableRegistryFieldpreloadTableRegistryField fromReference toReference $fEqReference$fShowReference withNewStatenthTop nthBottomnthtophslua_newudmetatablehslua_newhsuserdatauvhslua_fromuserdatahslua_putuserdatabaseForeign.C.TypesCIntghc-prim GHC.TypesFalseTrueDoubleGHC.IntInt64GHC.PtrnullPtr