Jn      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ [ \ ] ^ _ ` a b c d e f g h i j k l m m 2007 2012 Gracjan Polak, 2012 2016 mer Sinan Aacan, 2017 Albert KrewinkelMIT,Albert Krewinkel <tarleb+hslua@zeitkraut.de>beta4ForeignFunctionInterface, GeneralizedNewtypeDerivingNone /I*2The number of results returned by a function call.,The number of arguments expected a function. A stack index Enumeration used by gc function.Value or an error, using the convention that value below zero indicate an error. Values greater than zero are used verbatim. The phantom type is currently used for documentation only and has no effect.HInteger code used to signal the status of a thread or computation. See .Lua status values.successyielding / suspended coroutinea runtime rror"syntax error during precompilation(memory allocation (out-of-memory) error.(error while running the message handler.error while running a __gc metamethod.!opening or reading a file failed.Lua comparison operations. +Correponds to lua's equality (==) operator.!5Correponds to lua's strictly-lesser-than (<) operator"1Correponds to lua's lesser-or-equal (<=) operator#4Integer code used to encode the type of a lua value.&#Enumeration used as type tag. See  3https://www.lua.org/manual/5.3/manual.html#lua_typelua_type.'non-valid stack index(type of lua's nil value)type of lua booleans*type of light userdata+type of lua numbers. See 3,type of lua string values-type of lua tables.$type of functions, either normal or 7/type of full user data0type of lua threads1:Boolean value returned by a Lua C API function. This is a n and interpreted as o iff the value is 0, p otherwise.3The type of floats in Lua.By default this type is qK, 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.3/manual.html#lua_Number lua_Number.5The type of integers in Lua.By default this type is r<, but that can be changed to different values in lua. (See  LUA_INT_TYPE in  luaconf.h.)See  6https://www.lua.org/manual/5.3/manual.html#lua_Integer lua_Integer.7Type 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, gettop 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 gettopC. 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.3/manual.html#lua_CFunction lua_CFunction.8An 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.3/#lua_State lua_State.: Convert a 1 to a Haskell s.;Convert a Haskell s to a 1.<CConvert a lua Type to a type code which can be passed to the C API.=#Convert numerical code to lua type.>2Convert relation operator to its C representation.?Convert C integer constant to  LuaStatus.@  !"#$%&'()*+,-./0123456789:;<=>?@? ! "#$%&'()*+,-./0123456789:;<=>?@897563412:;&'()*+,-./0#$%@<= !">?     !"#$%& '()*+,-./0123456789:;<=>?@ 2017 Albert KrewinkelMIT,Albert Krewinkel <tarleb+hslua@zeitkraut.de>betaGeneralizedNewtypeDerivingNoneIrLua computationuTurn a function of typ LuaState -> IO a into a monadic lua operation.vTurn a function of typ LuaState -> a -> IO b into a monadic lua operation.w*Get the lua state of this lua computation.xRun lua computation with custom lua state. Errors are left unhandled, the caller of this function is responsible to catch lua errors.rstuvwxrstuvwxrstwxuvrstuvwx 2017 Albert KrewinkelMIT,Albert Krewinkel <tarleb+hslua@zeitkraut.de>betaDeriveDataTypeableNone0,Exceptions raised by Lua-related operations.Raise a $ containing the given error message.Catch a .YReturn either the result of a Lua computation or, if an exception was thrown, the error.m 2007 2012 Gracjan Polak, 2012 2016 mer Sinan Aacan, 2017 Albert KrewinkelMIT,Albert Krewinkel <tarleb+hslua@zeitkraut.de>betaForeignFunctionInterfaceNone BSee :https://www.lua.org/manual/5.3/manual.html#luaL_loadstringluaL_loadstringSee 9https://www.lua.org/manual/5.3/manual.html#luaL_loadfilexluaL_loadfilexSee 5https://www.lua.org/manual/5.3/manual.html#luaL_unref luaL_unrefSee 3https://www.lua.org/manual/5.3/manual.html#luaL_refluaL_refSee <https://www.lua.org/manual/5.3/manual.html#luaL_newmetatableluaL_newmetatableSee 8https://www.lua.org/manual/5.3/manual.html#luaL_newstate luaL_newstate.Point to function opening the package library.,Point to function opening the debug library.+Point to function opening the math library.-Point to function opening the string library.)Point to function opening the os library.)Point to function opening the io library.,Point to function opening the table library.+Point to function opening the base library.See 8https://www.lua.org/manual/5.3/manual.html#luaL_openlibs luaL_openlibsWrapper around  1https://lua.org/manual/5.3/manual.html#lua_concat-- @lua_concat@ which catches any longjmps.Wrapper around  /https://lua.org/manual/5.3/manual.html#lua_next -- @lua_next@ which catches any longjmps.See 1https://www.lua.org/manual/5.3/manual.html#lua_gclua_gcSee 5https://www.lua.org/manual/5.3/manual.html#lua_status lua_statusSee 5https://www.lua.org/manual/5.3/manual.html#lua_pcallk lua_pcallkWrapper around  4https://lua.org/manual/5.3/manual.html#lua_setglobal-- @lua_setglobal@ which catches any longjmps.See ;https://www.lua.org/manual/5.3/manual.html#lua_setmetatablelua_setmetatableSee 6https://www.lua.org/manual/5.3/manual.html#lua_rawseti lua_rawsetiSee 5https://www.lua.org/manual/5.3/manual.html#lua_rawset lua_rawsetWrapper around  3https://lua.org/manual/5.3/manual.html#lua_setfield-- @lua_setfield@ which catches any longjmps.Wrapper around  3https://lua.org/manual/5.3/manual.html#lua_settable-- @lua_settable@ which catches any longjmps.Wrapper around  4https://lua.org/manual/5.3/manual.html#lua_getglobal-- @lua_getglobal@ which catches any longjmps.See ;https://www.lua.org/manual/5.3/manual.html#lua_getmetatablelua_getmetatableSee :https://www.lua.org/manual/5.3/manual.html#lua_newuserdatalua_newuserdataSee :https://www.lua.org/manual/5.3/manual.html#lua_createtablelua_createtableSee 6https://www.lua.org/manual/5.3/manual.html#lua_rawgeti lua_rawgetiSee 5https://www.lua.org/manual/5.3/manual.html#lua_rawget lua_rawgetWrapper around  3https://lua.org/manual/5.3/manual.html#lua_getfield-- @lua_getfield@ which catches any longjmps.Wrapper around  3https://lua.org/manual/5.3/manual.html#lua_gettable-- @lua_gettable@ which catches any longjmps.See 9https://www.lua.org/manual/5.3/manual.html#lua_pushthreadlua_pushthreadSee @https://www.lua.org/manual/5.3/manual.html#lua_pushlightuserdatalua_pushlightuserdataSee :https://www.lua.org/manual/5.3/manual.html#lua_pushbooleanlua_pushbooleanSee ;https://www.lua.org/manual/5.3/manual.html#lua_pushcclosurelua_pushcclosureSee :https://www.lua.org/manual/5.3/manual.html#lua_pushlstringlua_pushlstringSee :https://www.lua.org/manual/5.3/manual.html#lua_pushintegerlua_pushintegerSee 9https://www.lua.org/manual/5.3/manual.html#lua_pushnumberlua_pushnumberSee 6https://www.lua.org/manual/5.3/manual.html#lua_pushnil lua_pushnilSee 5https://www.lua.org/manual/5.3/manual.html#lua_rawlen lua_rawlenSee 9https://www.lua.org/manual/5.3/manual.html#lua_touserdatalua_touserdataSee 7https://www.lua.org/manual/5.3/manual.html#lua_tothread lua_tothreadSee 8https://www.lua.org/manual/5.3/manual.html#lua_topointer lua_topointerSee 8https://www.lua.org/manual/5.3/manual.html#lua_tolstring lua_tolstringSee 8https://www.lua.org/manual/5.3/manual.html#lua_tonumberx lua_tonumberxSee 9https://www.lua.org/manual/5.3/manual.html#lua_tointegerxlua_tointegerxSee :https://www.lua.org/manual/5.3/manual.html#lua_tocfunctionlua_tocfunctionSee 8https://www.lua.org/manual/5.3/manual.html#lua_toboolean lua_tobooleanSee 7https://www.lua.org/manual/5.3/manual.html#lua_rawequal lua_rawequalWrapper around  2https://lua.org/manual/5.3/manual.html#lua_compare-- @lua_compare@ which catches any longjmps.See 7https://www.lua.org/manual/5.3/manual.html#lua_typename lua_typenameSee 3https://www.lua.org/manual/5.3/manual.html#lua_typelua_typeSee 9https://www.lua.org/manual/5.3/manual.html#lua_isuserdatalua_isuserdataSee :https://www.lua.org/manual/5.3/manual.html#lua_iscfunctionlua_iscfunctionSee 7https://www.lua.org/manual/5.3/manual.html#lua_isstring lua_isstringSee 7https://www.lua.org/manual/5.3/manual.html#lua_isnumber lua_isnumberSee 9https://www.lua.org/manual/5.3/manual.html#lua_checkstacklua_checkstackSee 3https://www.lua.org/manual/5.3/manual.html#lua_copylua_copySee 5https://www.lua.org/manual/5.3/manual.html#lua_rotate lua_rotateSee 8https://www.lua.org/manual/5.3/manual.html#lua_pushvalue lua_pushvalueSee 5https://www.lua.org/manual/5.3/manual.html#lua_settop lua_settopSee 5https://www.lua.org/manual/5.3/manual.html#lua_gettop lua_gettopSee 4https://www.lua.org/manual/5.3/manual.html#lua_close lua_closeBBBBm 2007 2012 Gracjan Polak, 2012 2016 mer Sinan Aacan, 2017 Albert KrewinkelMIT,Albert Krewinkel <tarleb+hslua@zeitkraut.de>betaForeignFunctionInterfaceNone Alias for C constant  LUA_MULTRET. See  (https://www.lua.org/manual/5.3/#lua_calllua_call.Alias for C constant LUA_REGISTRYINDEX. See  #https://www.lua.org/manual/5.3/#3.5 Lua registry.m 2007 2012 Gracjan Polak, 2012 2016 mer Sinan Aacan, 2017 Albert KrewinkelMIT,Albert Krewinkel <tarleb+hslua@zeitkraut.de>betaCPP, ForeignFunctionInterfaceNone\t8Throw a lua error if the computation signaled a failure.Calls a function.To call a function you must use the following protocol: first, the function to be called is pushed onto the stack; then, the arguments to the function are pushed in direct order; that is, the first argument is pushed first. Finally you call call; nargs is the number of arguments that you pushed onto the stack. All arguments and the function value are popped from the stack when the function is called. The function results are pushed onto the stack when the function returns. The number of results is adjusted to nresults , unless nresults is multret%. In this case, all results from the function are pushed. Lua takes care that the returned values fit into the stack space. The function results are pushed onto the stack in direct order (the first result is pushed first), so that after the call the last result is on the top of the stack.-Any error inside the called function cause a  to be thrown.YThe following example shows how the host program can do the equivalent to this Lua code: a = f("how", t.x, 14)JHere it is in Haskell (assuming the OverloadedStrings language extension): xgetglobal "f" -- function to be called pushstring "how" -- 1st argument getglobal "t" -- table to be indexed getfield (-1) "x" -- push result of t.x (2nd arg) remove (-2) -- remove 't' from the stack pushinteger 14 -- 3rd argument call 3 1 -- call 'f' with 3 arguments and 1 result setglobal "a" -- set global 'a'Note that the code above is "balanced": at its end, the stack is back to its original configuration. This is considered good programming practice.See  3https://www.lua.org/manual/5.3/manual.html#lua_calllua_call..Ensures that the stack has space for at least n7 extra slots (that is, that you can safely push up to nr values into it). It returns false if it cannot fulfill the request, either because it would cause the stack to be larger than a fixed maximum size (typically at least several thousand elements) or because it cannot allocate memory for the extra space. This function never shrinks the stack; if the stack already has space for the extra slots, it is left unchanged.This is a wrapper function of  9https://www.lua.org/manual/5.3/manual.html#lua_checkstacklua_checkstack.Destroys all objects in the given Lua state (calling the corresponding garbage-collection metamethods, if any) and frees all dynamic memory used by this state. On several platforms, you may not need to call this function, because all resources are naturally released when the host program ends. On the other hand, long-running programs that create multiple states, such as daemons or web servers, will probably need to close states as soon as they are not needed.This is a wrapper function of  4https://www.lua.org/manual/5.3/manual.html#lua_close lua_close.!Compares two Lua values. Returns True if the value at index idx1 satisfies op' when compared with the value at index idx2t, following the semantics of the corresponding Lua operator (that is, it may call metamethods). Otherwise returns False. Also returns False% if any of the indices is not valid. The value of op must be of type  LuaComparerOp:oOpEQ: compares for equality (==) OpLT: compares for less than (<) OpLE: compares for less or equal (<=)This is a wrapper function of  6https://www.lua.org/manual/5.3/manual.html#lua_compare lua_compare.Concatenates the nR values at the top of the stack, pops them, and leaves the result at the top. If n] is 1, the result is the single value on the stack (that is, the function does nothing); if nn is 0, the result is the empty string. Concatenation is performed following the usual semantics of Lua (see  0https://www.lua.org/manual/5.3/manual.html#3.4.63.4.6 of the lua manual).This is a wrapper function of  5https://www.lua.org/manual/5.3/manual.html#lua_concat lua_concat.Copies the element at index fromidx into the valid index toidxU, replacing the value at that position. Values at other positions are not affected. See also  3https://www.lua.org/manual/5.3/manual.html#lua_copylua_copy in the lua manual.Creates a new empty table and pushes it onto the stack. Parameter narr is a hint for how many elements the table will have as a sequence; parameter nrec is a hint for how many other elements the table will have. Lua may use these hints to preallocate memory for the new table. This preallocation is useful for performance when you know in advance how many elements the table will have. Otherwise you can use the function lua_newtable. This is a wrapper for function  :https://www.lua.org/manual/5.3/manual.html#lua_createtablelua_createtable. Loads and runs the given string.Returns Y on success, or an error if either loading of the string or calling of the thunk failed.Loads and runs the given file.Returns Truej if the two values in acceptable indices index1 and index2 are equal, following the semantics of the Lua == operator (that is, may call metamethods). Otherwise returns False. Also returns False if any of the indices is non valid. Uses  internally.Controls the garbage collector.SThis function performs several tasks, according to the value of the parameter what: : stops the garbage collector. !: restarts the garbage collector. +: performs a full garbage-collection cycle.A: returns the current amount of memory (in Kbytes) in use by Lua.e: returns the remainder of dividing the current amount of bytes of memory in use by Lua by 1024.D: performs an incremental step of garbage collection. The step "size" is controlled by data (larger values mean more steps) in a non-specified way. If you want to control the step size you must experimentally tune the value of data. The function returns 1 if the step finished a garbage-collection cycle. 'GCSETPAUSE': sets data as the new value for the pause of the collector (see 2.10). The function returns the previous value of the pause.: sets data as the new value for the step multiplier of the collector (see 2.10). The function returns the previous value of the step multiplier.See  1https://www.lua.org/manual/5.3/manual.html#lua_gclua_gc. Pushes onto the stack the value t[k], where tw is the value at the given stack index. As in Lua, this function may trigger a metamethod for the "index" event (see  .https://www.lua.org/manual/5.3/manual.html#2.42.4 of lua's manual).%Returns the type of the pushed value. See also:  7https://www.lua.org/manual/5.3/manual.html#lua_getfield lua_getfield..Pushes onto the stack the value of the global name". Returns the type of that value. Wrapper of  8https://www.lua.org/manual/5.3/manual.html#lua_getglobal lua_getglobal.pIf the value at the given index has a metatable, the function pushes that metatable onto the stack and returns True#. Otherwise, the function returns False! and pushes nothing on the stack. See also:  ;https://www.lua.org/manual/5.3/manual.html#lua_getmetatablelua_getmetatable. Pushes onto the stack the value t[k], where t& is the value at the given index and k& is the value at the top of the stack.This function pops the key from the stack, pushing the resulting value in its place. As in Lua, this function may trigger a metamethod for the "index" event (see  .https://www.lua.org/manual/5.3/manual.html#2.42.4 of lua's manual). See also:  7https://www.lua.org/manual/5.3/manual.html#lua_gettable lua_gettable.Returns the index of the top element in the stack. Because indices start at 1, this result is equal to the number of elements in the stack (and so 0 means an empty stack). See also:  5https://www.lua.org/manual/5.3/manual.html#lua_gettop lua_gettop.Moves 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. See also:  5https://www.lua.org/manual/5.3/manual.html#lua_insert lua_insert.Returns True3 if the value at the given index is a boolean, and False otherwise. See also:  8https://www.lua.org/manual/5.3/manual.html#lua_isboolean lua_isboolean.Returns True6 if the value at the given index is a C function, and False otherwise. See also:  :https://www.lua.org/manual/5.3/manual.html#lua_iscfunctionlua_iscfunction.Returns TrueG if the value at the given index is a function (either C or Lua), and False otherwise. See also:  9https://www.lua.org/manual/5.3/manual.html#lua_isfunctionlua_isfunction.Returns True; if the value at the given index is a light userdata, and False otherwise. See also:  >https://www.lua.org/manual/5.3/manual.html#lua_islightuserdata-- lua_islightuserdata.Returns True$ if the value at the given index is nil, and False otherwise. See also:  4https://www.lua.org/manual/5.3/manual.html#lua_isnil lua_isnil.Returns True& if the given index is not valid, and False otherwise. See also:  5https://www.lua.org/manual/5.3/manual.html#lua_isnone lua_isnone.Returns TrueH if the given index is not valid or if the value at the given index is nil, and False otherwise. See also:  :https://www.lua.org/manual/5.3/manual.html#lua_isnoneornillua_isnoneornil.Returns TrueW if the value at the given index is a number or a string convertible to a number, and False otherwise. See also:  7https://www.lua.org/manual/5.3/manual.html#lua_isnumber lua_isnumber.Returns Truei if the value at the given index is a string or a number (which is always convertible to a string), and False otherwise. See also:  7https://www.lua.org/manual/5.3/manual.html#lua_isstring lua_isstring.Returns True1 if the value at the given index is a table, and False otherwise. See also:  6https://www.lua.org/manual/5.3/manual.html#lua_istable lua_istable.Returns True2 if the value at the given index is a thread, and False otherwise. See also:  7https://www.lua.org/manual/5.3/manual.html#lua_isthread lua_isthread.Returns TrueL if the value at the given index is a userdata (either full or light), and False otherwise. See also:  9https://www.lua.org/manual/5.3/manual.html#lua_isuserdatalua_isuserdata.WThis is a convenience function to implement error propagation convention described in  #g:1Error handling in hslua. hslua doesn't implement  lua_error? function from Lua C API because it's never safe to use. (see  #g:1Error handling in hslua for details)\Tests whether the object under the first index is smaller than that under the second. Uses  internally.See  8https://www.lua.org/manual/5.3/manual.html#luaL_loadfile luaL_loadfile.See  :https://www.lua.org/manual/5.3/manual.html#luaL_loadstringluaL_loadstring.See  3https://www.lua.org/manual/5.3/manual.html#lua_typelua_type.3If the registry already has the key tname, returns Falsek. 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 True . (The entry __name- is used by some error-reporting functions.)DIn both cases pushes onto the stack the final value associated with tname in the registry. See also:  <https://www.lua.org/manual/5.3/manual.html#luaL_newmetatableluaL_newmetatable."Creates a new Lua state. It calls  lua_newstate, with an allocator based on the standard C realloc/ function and then sets a panic function (see  .https://www.lua.org/manual/5.3/manual.html#4.64.6v of the Lua 5.3 Reference Manual) that prints an error message to the standard error output in case of fatal errors. See also:  8https://www.lua.org/manual/5.3/manual.html#luaL_newstate luaL_newstate.MCreates a new empty table and pushes it onto the stack. It is equivalent to createtable 0 0. See also:  7https://www.lua.org/manual/5.3/manual.html#lua_newtable lua_newtable.This function allocates a new block of memory with the given size, pushes onto the stack a new full userdata with the block address, and returns this address. The host program can freely use this memory. See also:  :https://www.lua.org/manual/5.3/manual.html#lua_newuserdatalua_newuserdata.Pops a key from the stack, and pushes a key value pair from the table at the given index (the "next" pair after the given key). If there are no more elements in the table, then next returns False (and pushes nothing). See also:  3https://www.lua.org/manual/5.3/manual.html#lua_nextlua_next.Obsolete alias for .8Opens all standard Lua libraries into the current state. See also:  8https://www.lua.org/manual/5.3/manual.html#luaL_openlibs luaL_openlibs.8Opens all standard Lua libraries into the current state.| See  ;https://www.lua.org/manual/5.3/manual.html#pdf-luaopen_base luaopen_base. Opens Lua's debug library into the current state. See also:  <https://www.lua.org/manual/5.3/manual.html#pdf-luaopen_debug luaopen_debug. Opens Lua's io library into the current state. See also:  9https://www.lua.org/manual/5.3/manual.html#pdf-luaopen_io luaopen_io. Opens Lua's math library into the current state. See also:  ;https://www.lua.org/manual/5.3/manual.html#pdf-luaopen_math luaopen_math. Opens Lua's os library into the current state. See also:  9https://www.lua.org/manual/5.3/manual.html#pdf-luaopen_os luaopen_os. Opens Lua's package library into the current state. See also:  >https://www.lua.org/manual/5.3/manual.html#pdf-luaopen_packageluaopen_package. Opens Lua's string library into the current state. See also:  =https://www.lua.org/manual/5.3/manual.html#pdf-luaopen_stringluaopen_string. Opens Lua's table library into the current state. See also:  <https://www.lua.org/manual/5.3/manual.html#pdf-luaopen_table luaopen_table.#Calls a function in protected mode.Both nargs and nresults have the same meaning as in +. If there are no errors during the call, pcall behaves exactly like #. However, if there is any error, pcallg catches it, pushes a single value on the stack (the error message), and returns the error code. Like , pcall> always removes the function and its arguments from the stack.If msgh is Nothinge, then the error object returned on the stack is exactly the original error object. Otherwise, when msgh is Just idx, the stack index idx is the location of a message handler. (This index cannot be a pseudo-index.) In case of runtime errors, this function will be called with the error object and its return value will be the object returned on the stack by .Typically, the message handler is used to add more debug information to the error object, such as a stack traceback. Such information cannot be gathered after the return of &, since by then the stack has unwound.See  4https://www.lua.org/manual/5.3/manual.html#lua_pcall lua_pcall.Pops n elements from the stack. See also:  2https://www.lua.org/manual/5.3/manual.html#lua_poplua_pop.;Pushes a boolean value with the given value onto the stack. See also:  :https://www.lua.org/manual/5.3/manual.html#lua_pushbooleanlua_pushboolean.&Pushes a new C closure onto the stack.pWhen a C function is created, it is possible to associate some values with it, thus creating a C closure (see  .https://www.lua.org/manual/5.1/manual.html#3.43.4Q); these values are then accessible to the function whenever it is called. To associate values with a C function, first these values should be pushed onto the stack (when there are multiple values, the first value is pushed first). Then lua_pushcclosure is called to create and push the C function onto the stack, with the argument ny telling how many values should be associated with the function. lua_pushcclosure also pops these values from the stack.The maximum value for n is 255. See also:  ;https://www.lua.org/manual/5.3/manual.html#lua_pushcclosurelua_pushcclosure.Pushes a C function onto the stack. This function receives a pointer to a C function and pushes onto the stack a Lua value of type function that, when called, invokes the corresponding C function.{Any function to be callable by Lua must follow the correct protocol to receive its parameters and return its results (see 7) See also:  <https://www.lua.org/manual/5.3/manual.html#lua_pushcfunctionlua_pushcfunction.;Pushes an integer with with the given value onto the stack. See also:  :https://www.lua.org/manual/5.3/manual.html#lua_pushintegerlua_pushinteger.'Pushes a light userdata onto the stack.NUserdata represent C values in Lua. A light userdata represents a pointer, a Ptr () (i.e., void* in C lingo). It is a value (like a number): you do not create it, it has no individual metatable, and it is not collected (as it was never created). A light userdata is equal to "any" light userdata with the same C address. See also:  @https://www.lua.org/manual/5.3/manual.html#lua_pushlightuserdatalua_pushlightuserdata."Pushes a nil value onto the stack.See  6https://www.lua.org/manual/5.3/manual.html#lua_pushnil lua_pushnil.3Pushes a float with the given value onto the stack.See  9https://www.lua.org/manual/5.3/manual.html#lua_pushnumberlua_pushnumber. Pushes the zero-terminated string pointed to by s onto the stack. Lua makes (or reuses) an internal copy of the given string, so the memory at s can be freed or reused immediately after the function returns. See also:  9https://www.lua.org/manual/5.3/manual.html#lua_pushstring-- lua_pushstring. 2Pushes the current thread onto the stack. Returns True2 if this thread is the main thread of its state, False otherwise. See also:  9https://www.lua.org/manual/5.3/manual.html#lua_pushthreadlua_pushthread. ?Pushes a copy of the element at the given index onto the stack.See  8https://www.lua.org/manual/5.3/manual.html#lua_pushvalue lua_pushvalue. Returns True if the two values in indices idx1 and idx26 are primitively equal (that is, without calling the __eq! metamethod). Otherwise returns False. Also returns False% if any of the indices are not valid. See also:  7https://www.lua.org/manual/5.3/manual.html#lua_rawequal lua_rawequal.  Similar to 4, but does a raw access (i.e., without metamethods). See also:  5https://www.lua.org/manual/5.3/manual.html#lua_rawget lua_rawget. Pushes onto the stack the value t[n], where tV is the table at the given index. The access is raw, that is, it does not invoke the __index metamethod. See also:  6https://www.lua.org/manual/5.3/manual.html#lua_rawgeti lua_rawgeti.Returns the raw "length" of the value at the given index: for strings, this is the string length; for tables, this is the result of the length operator (#) with no metamethods; for userdata, this is the size of the block of memory allocated for the userdata; for other values, it is 0. See also:  5https://www.lua.org/manual/5.3/manual.html#lua_rawlen lua_rawlen. Similar to 9, but does a raw assignment (i.e., without metamethods). See also:  5https://www.lua.org/manual/5.3/manual.html#lua_rawset lua_rawset.Does the equivalent of t[i] = v, where t& is the table at the given index and v& is the value at the top of the stack.eThis function pops the value from the stack. The assignment is raw, that is, it does not invoke the  __newindex metamethod. See also:  6https://www.lua.org/manual/5.3/manual.html#lua_rawseti lua_rawseti.See  3https://www.lua.org/manual/5.3/manual.html#luaL_refluaL_ref.Sets the C function f as the new value of global name.See  7https://www.lua.org/manual/5.3/manual.html#lua_register lua_register.Removes the element at the given valid index, shifting down the elements above this index to fill the gap. This function cannot be called with a pseudo-index, because a pseudo-index is not an actual stack position.See  5https://www.lua.org/manual/5.3/manual.html#lua_remove lua_remove.Moves the top element into the given valid index without shifting any element (therefore replacing the value at that given index), and then pops the top element.See  6https://www.lua.org/manual/5.3/manual.html#lua_replace lua_replace.Does the equivalent to t[k] = v, where t& is the value at the given index and v& is the value at the top of the stack.This function pops the value from the stack. As in Lua, this function may trigger a metamethod for the "newindex" event (see  .https://www.lua.org/manual/5.3/manual.html#2.42.4# of the Lua 5.3 Reference Manual). See also:  7https://www.lua.org/manual/5.3/manual.html#lua_setfield lua_setfield.CPops a value from the stack and sets it as the new value of global name. See also:  8https://www.lua.org/manual/5.3/manual.html#lua_setglobal lua_setglobal._Pops a table from the stack and sets it as the new metatable for the value at the given index. See also:  ;https://www.lua.org/manual/5.3/manual.html#lua_setmetatable-- lua_setmetatable.Does the equivalent to t[k] = v, where t# is the value at the given index, v+ is the value at the top of the stack, and k" is the value just below the top.This function pops both the key and the value from the stack. As in Lua, this function may trigger a metamethod for the "newindex" event (see  .https://www.lua.org/manual/5.3/manual.html#2.42.4# of the Lua 5.3 Reference Manual). See also:  7https://www.lua.org/manual/5.3/manual.html#lua_settable lua_settable.Accepts any index, or 0, and sets the stack top to this index. If the new top is larger than the old one, then the new elements are filled with nil. If index is 0, then all stack elements are removed. See also:  5https://www.lua.org/manual/5.3/manual.html#lua_settop lua_settop.&Returns the status of this Lua thread.The status can be P for a normal thread, an error value if the thread finished the execution of a  lua_resume with an error, or  if the thread is suspended.3You can only call functions in threads with status &. You can resume threads with status  (to start a new coroutine) or  (to resume a coroutine). See also:  5https://www.lua.org/manual/5.3/manual.html#lua_status lua_status.Compatibility alias for rawlen^Converts the Lua value at the given index to a haskell boolean value. Like all tests in Lua,  toboolean returns True# for any Lua value different from false and nil; otherwise it returns False:. (If you want to accept only actual boolean values, use  to test the value's type.) See also:  8https://www.lua.org/manual/5.3/manual.html#lua_toboolean lua_toboolean.oConverts a value at the given index to a C function. That value must be a C function; otherwise, returns NULL. See also:  :https://www.lua.org/manual/5.3/manual.html#lua_tocfunctionlua_tocfunction.RConverts the Lua value at the given acceptable index to the signed integral type  lua_IntegerZ. The Lua value must be an integer, a number or a string convertible to an integer (see  0https://www.lua.org/manual/5.3/manual.html#3.4.33.4.3/ of the Lua 5.3 Reference Manual); otherwise,  tointeger returns 0.KIf the number is not an integer, it is truncated in some non-specified way. See also:  8https://www.lua.org/manual/5.3/manual.html#lua_tointeger lua_tointeger. Like , but returns Nothing if the conversion failed!Converts the Lua value at the given index to the C type lua_Number. The Lua value must be a number or a string convertible to a number; otherwise, tonumber returns 0.See  7https://www.lua.org/manual/5.3/manual.html#lua_tonumber lua_tonumber."Like !, but returns Nothing if the conversion failed#!Converts the value at the given index to a generic C pointer (void*). The value can be a userdata, a table, a thread, or a function; otherwise, lua_topointer returns NULL. Different objects will give different pointers. There is no way to convert the pointer back to its original value.GTypically this function is used only for hashing and debug information. See also:  8https://www.lua.org/manual/5.3/manual.html#lua_topointer lua_topointer.$See  7https://www.lua.org/manual/5.3/manual.html#lua_tostring lua_tostring.%Converts the value at the given index to a Lua thread (represented as lua_State*). This value must be a thread; otherwise, the function returns NULL. See also:  7https://www.lua.org/manual/5.3/manual.html#lua_tothread lua_tothread.&If the value at the given index is a full userdata, returns its block address. If the value is a light userdata, returns its pointer. Otherwise, returns NULL. See also:  9https://www.lua.org/manual/5.3/manual.html#lua_touserdatalua_touserdata.'2Returns the name of the type encoded by the value tp,, which must be one the values returned by . See also:  7https://www.lua.org/manual/5.3/manual.html#lua_typename lua_typename.(Releases reference  from the table at index idx (see f). The entry is removed from the table, so that the referred object can be collected. The reference  is also freed to be used again. See also:  5https://www.lua.org/manual/5.3/manual.html#luaL_unref luaL_unref.)-Returns the pseudo-index that represents the i*-th upvalue of the running function (see  .https://www.lua.org/manual/5.3/manual.html#4.44.4# of the Lua 5.3 reference manual). See also:  ;https://www.lua.org/manual/5.3/manual.html#lua_upvalueindexlua_upvalueindex.^t      !"#$%&'() ! "#$%&'()*+,-./035789<=>?      !"#$%&'()753 )89 &'()*+,-./0#$%<=' !"#$%& !">    ? (^t      !"#$%&'()m 2007 2012 Gracjan Polak, 2012 2016 mer Sinan Aacan, 2017 Albert KrewinkelMIT,Albert Krewinkel <tarleb+hslua@zeitkraut.de>beta&FlexibleInstances, ScopedTypeVariablesNone9:;T *,A value that can be read from the Lua stack.+Check if at index nB there is a convertible Lua value and if so return it. Throws a  otherwise.,>Result returned when trying to get a value from the lua stack.uUse test+ to check whether the value at stack index n has the correct type and use peekfnc to convert it to a haskell value if possible. A successfully received value is wrapped using the Success3 constructor, while a type mismatch results in an Error with the given error message.-OTry to convert the value at the given stack index to a haskell value. Returns Left" with an error message on failure..Read a table into a list/"Read a table into a list of pairs.v)Get the next key-value pair from a table.w*Helper function to get the nth table value*+,u-./vw0123456789:;<=>?@ABC*+,-./*+,-/.*+,u-./vw0123456789:;<=>?@ABCm 2007 2012 Gracjan Polak, 2012 2016 mer Sinan Aacan, 2017 Albert KrewinkelMIT,Albert Krewinkel <tarleb+hslua@zeitkraut.de>beta&FlexibleInstances, ScopedTypeVariablesNone9;TD,A value that can be pushed to the Lua stack.ENPushes a value onto Lua stack, casting it into meaningfully nearest Lua type.F'Push list as numerically indexed table.x7Set numeric key/value in table at the top of the stack.DEFxGHIJKLMNOPQRSTUVWXYDEFDEFDEFxGHIJKLMNOPQRSTUVWXY  2017 Albert KrewinkelMIT,Albert Krewinkel <tarleb+hslua@zeitkraut.de>betaVForeignFunctionInterface, GeneralizedNewtypeDeriving, StandaloneDerivingNonerstuvwx*+,-./DEF m 2007 2012 Gracjan Polak, 2012 2016 mer Sinan Aacan, 2017 Albert KrewinkelMIT,Albert Krewinkel <tarleb+hslua@zeitkraut.de>betaportableNoneZRun lua computation using the default HsLua state as starting point. Raised exceptions are passed through; error handling is the responsibility of the caller.[Run the given Lua computation; exceptions raised in haskell code are caught, but other exceptions (user exceptions raised in haskell, unchecked type errors, etc.) are passed through.\Like  getglobal!, but knows about packages. e. g. getglobal' l "math.sin"returns correct resultZ[\Z[\\Z[Z[\ m 2007 2012 Gracjan Polak, 2012 2016 mer Sinan Aacan, 2017 Albert KrewinkelMIT,Albert Krewinkel <tarleb+hslua@zeitkraut.de>beta@FlexibleInstances, ForeignFunctionInterface, ScopedTypeVariablesNone 9:;T ]<Helper class used to make lua functions useable from haskell_Operations and functions that can be pushed to the lua stack. This is a helper function not intended to be used directly. Use the c wrapper instead.`Helper function, called by ca-Haskell function that can be called from Lua.b4Type of raw haskell functions that can be made into 7s.yTurn a b into an actual 7.caConvert a Haskell function to Lua function. Any Haskell function can be converted provided that:all arguments are instances of *return type is Lua a, where a is an instance of DOAny Haskell exception will be converted to a string and returned as Lua error.dqCreate new foreign Lua function. Function created can be called by Lua engine. Remeber to free the pointer with  freecfunction.e#Free function pointer created with  newcfunction.fCall a Lua function. Use as: 1v <- callfunc "proc" "abc" (1::Int) (5.0::Double)gkPushes Haskell function converted to a Lua function. All values created will be garbage collected. Use as: +pushHaskellFunction myfun setglobal "myfun"You are not allowed to use  lua_errork anywhere, but use an error code of (-1) to the same effect. Push error message as the sole return value.zGConverts a pre C function to a Lua function and pushes it to the stack.@Pre C functions collect parameters from the stack and return a n; that represents number of return values left in the stack.h;Imports a Haskell function and registers it at global name.]^_`ab{|ycdefgzh}~ijklm*+DE]^_`abcdefgh*+]^_`aDEbcfedgh]^_`ab{|ycdefgzh}~ijklm m 2007 2012 Gracjan Polak, 2012 2016 mer Sinan Aacan, 2017 Albert KrewinkelMIT,Albert Krewinkel <tarleb+hslua@zeitkraut.de>beta@FlexibleInstances, ForeignFunctionInterface, ScopedTypeVariablesNone ! "#$%&'()*+,-./0123456789:;<=>?rstwx      !"#$%&'()*+-./DEFZ[\abdefghrstwx*+-./DEFbafdeghZ[\   !"#$%&'()*+,-../0123456789:;;<<==>??@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\] ^ _ ` a b c d e f g h i j k l m n o p q rstuvtuwtux yztu{|}~      "hslua-0.9.2-HYp6v9g2uL8AWHl3Y9HyPDForeign.Lua.Types.LuaForeign.Lua.Api.TypesForeign.Lua.Types.ErrorForeign.Lua.Api.RawBindingsForeign.Lua.Api.ConstantsForeign.Lua.ApiForeign.Lua.Types.FromLuaStackForeign.Lua.Types.ToLuaStackForeign.Lua.UtilForeign.Lua.FunctionCallingForeign.Lua.Types Foreign.LuabaseControl.Monad.IO.ClassliftIO NumResultsfromNumResultsNumArgs fromNumArgs StackIndexfromStackIndex GCCONTROLGCSTOP GCRESTART GCCOLLECTGCCOUNTGCCOUNTBGCSTEP GCSETPAUSE GCSETSTEPMULFailable StatusCodeStatusOKYieldErrRun ErrSyntaxErrMemErrErrErrGcmmErrFileRelationalOperatorEQLTLETypeCode fromTypeCodeTypeTypeNoneTypeNil TypeBooleanTypeLightUserdata TypeNumber TypeString TypeTable TypeFunction TypeUserdata TypeThreadLuaBool LuaNumber LuaInteger CFunctionLuaState fromLuaBool toLuaBoolfromTypetoTypefromRelationalOperatortoStatus $fEnumType $fEqLuaState$fEnumLuaInteger$fEqLuaInteger$fIntegralLuaInteger$fNumLuaInteger$fOrdLuaInteger$fRealLuaInteger$fShowLuaInteger $fEqLuaNumber$fFloatingLuaNumber$fFractionalLuaNumber$fNumLuaNumber$fOrdLuaNumber$fRealLuaNumber$fRealFloatLuaNumber$fRealFracLuaNumber$fShowLuaNumber $fEqLuaBool$fStorableLuaBool $fBoundedType$fEqType $fOrdType $fShowType $fEqTypeCode $fOrdTypeCode$fShowTypeCode$fEqRelationalOperator$fOrdRelationalOperator$fShowRelationalOperator $fEqStatus $fShowStatus$fEqStatusCode$fEnumGCCONTROL $fEqGCCONTROL$fOrdGCCONTROL$fShowGCCONTROL$fEnumStackIndex$fEqStackIndex$fNumStackIndex$fOrdStackIndex$fShowStackIndex $fEqNumArgs $fNumNumArgs $fOrdNumArgs $fShowNumArgs$fEqNumResults$fNumNumResults$fOrdNumResults$fShowNumResultsLuaunLualiftLualiftLua1luaState runLuaWith$fApplicativeLua $fFunctorLua $fMonadLua$fMonadCatchLua $fMonadIOLua$fMonadReaderLua$fMonadThrowLua LuaException throwLuaError catchLuaErrortryLua$fAlternativeLua$fExceptionLuaException$fShowLuaException$fEqLuaExceptionluaL_loadstringluaL_loadfilex luaL_unrefluaL_refluaL_newmetatable luaL_newstatelua_open_package_ptrlua_open_debug_ptrlua_open_math_ptrlua_open_string_ptrlua_open_os_ptrlua_open_io_ptrlua_open_table_ptrlua_open_base_ptr luaL_openlibs hslua_concat hslua_nextlua_gc lua_status lua_pcallkhslua_setgloballua_setmetatable lua_rawseti lua_rawsethslua_setfieldhslua_settablehslua_getgloballua_getmetatablelua_newuserdatalua_createtable lua_rawgeti lua_rawgethslua_getfieldhslua_gettablelua_pushthreadlua_pushlightuserdatalua_pushbooleanlua_pushcclosurelua_pushlstringlua_pushintegerlua_pushnumber lua_pushnil lua_rawlenlua_touserdata lua_tothread lua_topointer lua_tolstring lua_tonumberxlua_tointegerxlua_tocfunction lua_toboolean lua_rawequal hslua_compare lua_typenamelua_typelua_isuserdatalua_iscfunction lua_isstring lua_isnumberlua_checkstacklua_copy lua_rotate lua_pushvalue lua_settop lua_gettop lua_closemultret registryindexthrowTopMessageAsErrorthrowTopMessageAsError'call checkstackclosecompareconcatcopy createtabledostringdofileequalgcgetfield getglobal getmetatablegettablegettopinsert isboolean iscfunction isfunctionislightuserdataisnilisnone isnoneornilisnumberisstringistableisthread isuserdatalerrorlessthanloadfile loadstringltype newmetatablenewstatenewtable newuserdatanextobjlenopenlibsopenbase opendebugopenioopenmathopenos openpackage openstring opentablepcallpop pushboolean pushcclosure pushcfunction pushintegerpushlightuserdatapushnil pushnumber pushstring pushthread pushvaluerawequalrawgetrawgetirawlenrawsetrawsetirefregisterremovereplacesetfield setglobal setmetatablesettablesettopstatusstrlen toboolean tocfunction tointeger tointegerxtonumber tonumberx topointertostringtothread touserdatatypenameunref upvalueindex FromLuaStackpeekResult peekEithertoListpairsFromTable$fFromLuaStack(,,,,,,,)$fFromLuaStack(,,,,,,)$fFromLuaStack(,,,,,)$fFromLuaStack(,,,,)$fFromLuaStack(,,,)$fFromLuaStack(,,)$fFromLuaStack(,)$fFromLuaStackMap$fFromLuaStack[]$fFromLuaStack[]0$fFromLuaStackByteString$fFromLuaStackText$fFromLuaStackLuaState$fFromLuaStackPtr$fFromLuaStackFunPtr$fFromLuaStackBool$fFromLuaStackByteString0$fFromLuaStackLuaNumber$fFromLuaStackLuaInteger$fFromLuaStack() ToLuaStackpushpushList$fToLuaStack(,,,,,,,)$fToLuaStack(,,,,,,)$fToLuaStack(,,,,,)$fToLuaStack(,,,,)$fToLuaStack(,,,)$fToLuaStack(,,)$fToLuaStack(,)$fToLuaStackMap$fToLuaStack[]$fToLuaStack[]0$fToLuaStackByteString$fToLuaStackText$fToLuaStackPtr$fToLuaStackFunPtr$fToLuaStackBool$fToLuaStackByteString0$fToLuaStackLuaNumber$fToLuaStackLuaInteger$fToLuaStack()runLua runLuaEither getglobal' LuaCallFunc callFunc'ToHaskellFunctiontoHsFunHaskellFunction PreCFunctiontoHaskellFunction newCFunction freeCFunctioncallFuncpushHaskellFunctionregisterHaskellFunction$fLuaCallFunc(->)$fLuaCallFuncLua$fToHaskellFunction(->)$fToHaskellFunctionLua$fToHaskellFunctionLua0Foreign.C.TypesCIntghc-prim GHC.TypesFalseTrueDoubleGHC.IntInt64Bool throwOnError typeCheckednextPair getTableIndex addRawInt mkWrapperpushPreCFunctionhsmethod__call_addrhsmethod__gc_addr hsMethodGc hsMethodCall