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 |
Functions and utilities enabling the seamless integration of a Lua interpreter into a Haskell project.
This module combines and re-exports the functionality of the HsLua
framework. Basic access to the Lua API is provided by
from
Hackage package lua.Core
Synopsis
- module HsLua.Core
- module HsLua.Marshalling
- module HsLua.ObjectOrientation
- module HsLua.Packaging
- module HsLua.Class.Exposable
- module HsLua.Class.Invokable
- inContext :: PeekError e => String -> LuaE e a -> LuaE e a
- class Peekable a where
- peek :: PeekError e => StackIndex -> LuaE e a
- messageFromException :: PeekError e => e -> String
- class Pushable a where
- getglobal' :: LuaError e => Name -> LuaE e ()
- setglobal' :: LuaError e => Name -> LuaE e ()
- module HsLua.Class.Util
Core functionality
module HsLua.Core
Marshalling
module HsLua.Marshalling
Module, data, and function packaging
module HsLua.ObjectOrientation
module HsLua.Packaging
Type classes
module HsLua.Class.Exposable
module HsLua.Class.Invokable
inContext :: PeekError e => String -> LuaE e a -> LuaE e a #
Specify a name for the context in which a computation is run. The name is added to the error message in case of an exception.
A value that can be read from the Lua stack.
peek :: PeekError e => StackIndex -> LuaE e a #
Check if at index n
there is a convertible Lua value and if so return
it. Throws a
otherwise.Exception
Instances
messageFromException :: PeekError e => e -> String #
A value that can be pushed to the Lua stack.
push :: LuaError e => a -> LuaE e () #
Pushes a value onto Lua stack, casting it into meaningfully nearest Lua type.
Instances
Utility functions
getglobal' :: LuaError e => Name -> LuaE e () Source #
Like getglobal
, but knows about packages and nested tables. E.g.
getglobal' "math.sin"
will return the function sin
in package math
.
setglobal' :: LuaError e => Name -> LuaE e () Source #
Like setglobal
, but knows about packages and nested tables. E.g.
pushstring "0.9.4" setglobal' "mypackage.version"
All tables and fields, except for the last field, must exist.
module HsLua.Class.Util