Copyright | © 2007–2012 Gracjan Polak; © 2012–2016 Ömer Sinan Ağacan; © 2017-2021 Albert Krewinkel |
---|---|
License | MIT |
Maintainer | Albert Krewinkel <tarleb+hslua@zeitkraut.de> |
Stability | beta |
Portability | non-portable (depends on GHC) |
Safe Haskell | None |
Language | Haskell2010 |
HsLua utility functions.
Synopsis
- raiseError :: (PeekError e, Pushable a) => a -> LuaE e NumResults
- newtype Optional a = Optional {
- fromOptional :: Maybe a
- peekEither :: (PeekError e, Peekable a) => StackIndex -> LuaE e (Either e a)
- popValue :: (PeekError e, Peekable a) => LuaE e a
Documentation
raiseError :: (PeekError e, Pushable a) => a -> LuaE e NumResults Source #
Raise a Lua error, using the given value as the error object.
Newtype wrapper intended to be used for optional Lua values. Nesting this type is strongly discouraged as missing values on inner levels are indistinguishable from missing values on an outer level; wrong values would be the likely result.
Optional | |
|
getting values
peekEither :: (PeekError e, Peekable a) => StackIndex -> LuaE e (Either e a) Source #
Try to convert the value at the given stack index to a Haskell value.
Returns Left
with the error on failure.