luautils-0.1.4: Helpers for Haskell integration with Lua

Copyright(c) Anupam Jain 2011
LicenseGNU GPL Version 3 (see the file LICENSE)
Maintainerajnsit@gmail.com
Stabilityexperimental
Portabilitynon-portable (uses ghc extensions)
Safe HaskellNone
LanguageHaskell98

Scripting.LuaUtils

Description

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 -

  1. Lua.StackValue instances for a variety of commonly used datatypes, such as Lists, Tuples, Either, Maybe etc.
  2. luaDoString and luaDoFile utility functions.
  3. A function to dump the contents of the stack for debugging purposes (dumpStack).

Synopsis

Documentation

data BinStackValue t Source

Instances

Eq t => Eq (BinStackValue t) 
Binary t => StackValue (BinStackValue t)

StackValue instance for datatypes with Binary instances

pushbinary :: Binary a => LuaState -> a -> IO () Source

Binary push

peekbinary :: Binary a => LuaState -> Int -> IO (Maybe a) Source

Binary peek

luaDoString :: LuaState -> String -> IO () Source

Execute a String containing Lua Code

luaDoFile :: LuaState -> String -> IO () Source

Execute a Lua script file

dumpStack :: LuaState -> IO () Source

Pretty print the contents of the entire Lua stack in a human readable form