| Copyright | © 2007–2012 Gracjan Polak 2012–2016 Ömer Sinan Ağacan 2017-2019 Albert Krewinkel |
|---|---|
| License | MIT |
| Maintainer | Albert Krewinkel <tarleb+hslua@zeitkraut.de> |
| Stability | beta |
| Portability | non-portable (depends on GHC) |
| Safe Haskell | None |
| Language | Haskell2010 |
Foreign.Lua.Types.Peekable
Description
Sending haskell objects to the lua stack.
- class Peekable a where
- peekKeyValuePairs :: (Peekable a, Peekable b) => StackIndex -> Lua [(a, b)]
- peekList :: Peekable a => StackIndex -> Lua [a]
- reportValueOnFailure :: String -> (StackIndex -> Lua (Maybe a)) -> StackIndex -> Lua a
Documentation
A value that can be read from the Lua stack.
Minimal complete definition
Methods
peek :: StackIndex -> Lua a #
Check if at index n there is a convertible Lua value and if so return
it. Throws a otherwise.Exception
Instances
peekKeyValuePairs :: (Peekable a, Peekable b) => StackIndex -> Lua [(a, b)] #
Read a table into a list of pairs.
peekList :: Peekable a => StackIndex -> Lua [a] #
Read a table into a list
reportValueOnFailure :: String -> (StackIndex -> Lua (Maybe a)) -> StackIndex -> Lua a #
Report the expected and actual type of the value under the given index if conversion failed.