Hoogle Search
Within LTS Haskell 24.52 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
hslua-packaging HsLua.Packaging.UDType The call operation func(args). This event happens when Lua tries to call a non-function value (that is, func is not a function). The metamethod is looked up in func. If present, the metamethod is called with func as its first argument, followed by the arguments of the original call (args). All results of the call are the result of the operation. (This is the only metamethod that allows multiple results.)
lua_pcall :: State -> NumArgs -> NumResults -> StackIndex -> IO StatusCodelua Lua Calls a function in protected mode. 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 lua_pcall; 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 LUA_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. If there is any error, lua_pcall catches it, pushes a single value on the stack (the error message), and returns the error code. lua_pcall always removes the function and its arguments from the stack. If msgh is 0, then the error object returned on the stack is exactly the original error object. Otherwise, msgh 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 lua_pcall. 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 lua_pcall, since by then the stack has unwound. https://www.lua.org/manual/5.4/manual.html#lua_pcall.
-
Function to push Haskell functions as Lua C functions. Haskell functions are converted into C functions in a two-step process. First, a function pointer to the Haskell function is stored in a Lua userdata object. The userdata gets a metatable which allows to invoke the object as a function. The userdata also ensures that the function pointer is freed when the object is garbage collected in Lua. In a second step, the userdata is then wrapped into a C closure. The wrapping function calls the userdata object and implements the error protocol, converting special error values into proper Lua errors.
lua_pcall :: State -> NumArgs -> NumResults -> StackIndex -> IO StatusCodelua Lua.Primary Calls a function in protected mode. 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 lua_pcall; 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 LUA_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. If there is any error, lua_pcall catches it, pushes a single value on the stack (the error message), and returns the error code. lua_pcall always removes the function and its arguments from the stack. If msgh is 0, then the error object returned on the stack is exactly the original error object. Otherwise, msgh 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 lua_pcall. 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 lua_pcall, since by then the stack has unwound. https://www.lua.org/manual/5.4/manual.html#lua_pcall.
tally :: (Manifest r e, Load r ix e, Ord e) => Array r ix e -> Vector DS (e, Int)massiv Data.Massiv.Array Count number of occurrences of each element in the array. Results will be sorted in ascending order of the element.
Example
>>> import Data.Massiv.Array as A >>> xs = fromList Seq [2, 4, 3, 2, 4, 5, 2, 1] :: Array P Ix1 Int >>> xs Array P Seq (Sz1 8) [ 2, 4, 3, 2, 4, 5, 2, 1 ] >>> tally xs Array DS Seq (Sz1 5) [ (1,1), (2,3), (3,1), (4,2), (5,1) ]
evalLazyArray :: Index ix => Array BL ix e -> Array B ix emassiv Data.Massiv.Array.Manifest O(n) - Evaluate all elements of a boxed lazy array to weak head normal form
mallocCompute :: (Size r, Load r ix e, Storable e) => Array r ix e -> IO (Array S ix e)massiv Data.Massiv.Array.Manifest Very similar to computeAs S except load the source array into memory allocated with malloc on C heap. It can potentially be useful when iteroperating with some C programs.
mallocCopy :: (Index ix, Storable e) => Array S ix e -> IO (Array S ix e)massiv Data.Massiv.Array.Manifest Allocate memory on C heap with malloc and copy the source array over.
-
massiv Data.Massiv.Array.Unsafe Allocate memory using malloc on C heap, instead of on Haskell heap. Memory is left uninitialized
sall :: Stream r ix e => (e -> Bool) -> Array r ix e -> Boolmassiv Data.Massiv.Vector Examples