Copyright | (c) Anupam Jain 2011 |
---|---|
License | GNU GPL Version 3 (see the file LICENSE) |
Maintainer | ajnsit@gmail.com |
Stability | experimental |
Portability | non-portable (uses ghc extensions) |
Safe Haskell | None |
Language | Haskell98 |
This package is an add-on to the HsLua
package by Gracjan Polak (http:/hackage.haskell.orgpackage/hslua).
HsLua only provides a very bare-bones wrapper over the Lua API, and this package is meant to fill in the gap by providing some commonly used features.
Currently the following features are provided -
Lua.StackValue
instances for a variety of commonly used datatypes, such as Lists, Tuples, Either, Maybe etc.luaDoString
andluaDoFile
utility functions.- A function to dump the contents of the stack for debugging purposes (
dumpStack
).
- data BinStackValue t
- toBinStackValue :: Binary t => t -> BinStackValue t
- fromBinStackValue :: BinStackValue t -> t
- pushbinary :: Binary a => LuaState -> a -> IO ()
- peekbinary :: Binary a => LuaState -> Int -> IO (Maybe a)
- luaDoString :: LuaState -> String -> IO ()
- luaDoFile :: LuaState -> String -> IO ()
- dumpStack :: LuaState -> IO ()
Documentation
data BinStackValue t Source
Eq t => Eq (BinStackValue t) | |
Binary t => StackValue (BinStackValue t) | StackValue instance for datatypes with Binary instances |
toBinStackValue :: Binary t => t -> BinStackValue t Source
fromBinStackValue :: BinStackValue t -> t Source
pushbinary :: Binary a => LuaState -> a -> IO () Source
Binary push
luaDoString :: LuaState -> String -> IO () Source
Execute a String containing Lua Code