hslua-marshalling-2.0.1: Marshalling of values between Haskell and Lua.
Copyright© 2007–2012 Gracjan Polak;
© 2012–2016 Ömer Sinan Ağacan;
© 2017-2021 Albert Krewinkel
LicenseMIT
MaintainerAlbert Krewinkel <tarleb+hslua@zeitkraut.de>
Stabilitybeta
Portabilitynon-portable (depends on GHC)
Safe HaskellNone
LanguageHaskell2010

HsLua.Marshalling.Userdata

Description

Convenience functions to use Haskell values as Lua userdata.

Synopsis

Documentation

pushIterator Source #

Arguments

:: forall a e. LuaError e 
=> (a -> LuaE e NumResults)

pusher for the values

-> [a]

list to iterate over lazily

-> LuaE e NumResults 

Pushes three values to the stack that can be used in a generic for loop to lazily iterate over all values in the list. Keeps the remaining list in a userdata state.

If the values pusher function returns NumResults 0 for a list item, then this item will be skipped and the values for the next item will be pushed.