hslua-2.0.0: Bindings to Lua, an embeddable scripting language
Copyright© 2007–2012 Gracjan Polak;
© 2012–2016 Ömer Sinan Ağacan;
© 2017-2021 Albert Krewinkel
LicenseMIT
MaintainerAlbert Krewinkel <tarleb+hslua@zeitkraut.de>
Stabilitybeta
Portabilitynon-portable (depends on GHC)
Safe HaskellNone
LanguageHaskell2010

HsLua

Description

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 Core from Hackage package lua.

Synopsis

Core functionality

module HsLua.Core

Marshalling

Module, data, and function packaging

Type classes

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.

class Peekable a where #

A value that can be read from the Lua stack.

Methods

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 Exception otherwise.

Instances

Instances details
Peekable Bool 
Instance details

Defined in HsLua.Class.Peekable

Methods

peek :: PeekError e => StackIndex -> LuaE e Bool #

Peekable Double 
Instance details

Defined in HsLua.Class.Peekable

Methods

peek :: PeekError e => StackIndex -> LuaE e Double #

Peekable Float 
Instance details

Defined in HsLua.Class.Peekable

Methods

peek :: PeekError e => StackIndex -> LuaE e Float #

Peekable Int 
Instance details

Defined in HsLua.Class.Peekable

Methods

peek :: PeekError e => StackIndex -> LuaE e Int #

Peekable Integer 
Instance details

Defined in HsLua.Class.Peekable

Methods

peek :: PeekError e => StackIndex -> LuaE e Integer #

Peekable () 
Instance details

Defined in HsLua.Class.Peekable

Methods

peek :: PeekError e => StackIndex -> LuaE e () #

Peekable ByteString 
Instance details

Defined in HsLua.Class.Peekable

Peekable ByteString 
Instance details

Defined in HsLua.Class.Peekable

Peekable Text 
Instance details

Defined in HsLua.Class.Peekable

Methods

peek :: PeekError e => StackIndex -> LuaE e Text #

Peekable Number 
Instance details

Defined in HsLua.Class.Peekable

Methods

peek :: PeekError e => StackIndex -> LuaE e Number #

Peekable Integer 
Instance details

Defined in HsLua.Class.Peekable

Methods

peek :: PeekError e => StackIndex -> LuaE e Integer #

Peekable CFunction 
Instance details

Defined in HsLua.Class.Peekable

Methods

peek :: PeekError e => StackIndex -> LuaE e CFunction #

Peekable State 
Instance details

Defined in HsLua.Class.Peekable

Methods

peek :: PeekError e => StackIndex -> LuaE e State #

Peekable [Char] 
Instance details

Defined in HsLua.Class.Peekable

Methods

peek :: PeekError e => StackIndex -> LuaE e [Char] #

Peekable a => Peekable [a] 
Instance details

Defined in HsLua.Class.Peekable

Methods

peek :: PeekError e => StackIndex -> LuaE e [a] #

Peekable (Ptr a) 
Instance details

Defined in HsLua.Class.Peekable

Methods

peek :: PeekError e => StackIndex -> LuaE e (Ptr a) #

(Ord a, Peekable a) => Peekable (Set a) 
Instance details

Defined in HsLua.Class.Peekable

Methods

peek :: PeekError e => StackIndex -> LuaE e (Set a) #

Peekable a => Peekable (Optional a) 
Instance details

Defined in HsLua.Class.Util

Methods

peek :: PeekError e => StackIndex -> LuaE e (Optional a) #

(Peekable a, Peekable b) => Peekable (a, b) 
Instance details

Defined in HsLua.Class.Peekable

Methods

peek :: PeekError e => StackIndex -> LuaE e (a, b) #

(Ord a, Peekable a, Peekable b) => Peekable (Map a b) 
Instance details

Defined in HsLua.Class.Peekable

Methods

peek :: PeekError e => StackIndex -> LuaE e (Map a b) #

(Peekable a, Peekable b, Peekable c) => Peekable (a, b, c) 
Instance details

Defined in HsLua.Class.Peekable

Methods

peek :: PeekError e => StackIndex -> LuaE e (a, b, c) #

(Peekable a, Peekable b, Peekable c, Peekable d) => Peekable (a, b, c, d) 
Instance details

Defined in HsLua.Class.Peekable

Methods

peek :: PeekError e => StackIndex -> LuaE e (a, b, c, d) #

(Peekable a, Peekable b, Peekable c, Peekable d, Peekable e) => Peekable (a, b, c, d, e) 
Instance details

Defined in HsLua.Class.Peekable

Methods

peek :: PeekError e0 => StackIndex -> LuaE e0 (a, b, c, d, e) #

(Peekable a, Peekable b, Peekable c, Peekable d, Peekable e, Peekable f) => Peekable (a, b, c, d, e, f) 
Instance details

Defined in HsLua.Class.Peekable

Methods

peek :: PeekError e0 => StackIndex -> LuaE e0 (a, b, c, d, e, f) #

(Peekable a, Peekable b, Peekable c, Peekable d, Peekable e, Peekable f, Peekable g) => Peekable (a, b, c, d, e, f, g) 
Instance details

Defined in HsLua.Class.Peekable

Methods

peek :: PeekError e0 => StackIndex -> LuaE e0 (a, b, c, d, e, f, g) #

(Peekable a, Peekable b, Peekable c, Peekable d, Peekable e, Peekable f, Peekable g, Peekable h) => Peekable (a, b, c, d, e, f, g, h) 
Instance details

Defined in HsLua.Class.Peekable

Methods

peek :: PeekError e0 => StackIndex -> LuaE e0 (a, b, c, d, e, f, g, h) #

class Pushable a where #

A value that can be pushed to the Lua stack.

Methods

push :: LuaError e => a -> LuaE e () #

Pushes a value onto Lua stack, casting it into meaningfully nearest Lua type.

Instances

Instances details
Pushable Bool 
Instance details

Defined in HsLua.Class.Pushable

Methods

push :: LuaError e => Bool -> LuaE e () #

Pushable Double 
Instance details

Defined in HsLua.Class.Pushable

Methods

push :: LuaError e => Double -> LuaE e () #

Pushable Float 
Instance details

Defined in HsLua.Class.Pushable

Methods

push :: LuaError e => Float -> LuaE e () #

Pushable Int 
Instance details

Defined in HsLua.Class.Pushable

Methods

push :: LuaError e => Int -> LuaE e () #

Pushable Integer 
Instance details

Defined in HsLua.Class.Pushable

Methods

push :: LuaError e => Integer -> LuaE e () #

Pushable () 
Instance details

Defined in HsLua.Class.Pushable

Methods

push :: LuaError e => () -> LuaE e () #

Pushable ByteString 
Instance details

Defined in HsLua.Class.Pushable

Methods

push :: LuaError e => ByteString -> LuaE e () #

Pushable ByteString 
Instance details

Defined in HsLua.Class.Pushable

Methods

push :: LuaError e => ByteString -> LuaE e () #

Pushable Text 
Instance details

Defined in HsLua.Class.Pushable

Methods

push :: LuaError e => Text -> LuaE e () #

Pushable Number 
Instance details

Defined in HsLua.Class.Pushable

Methods

push :: LuaError e => Number -> LuaE e () #

Pushable Integer 
Instance details

Defined in HsLua.Class.Pushable

Methods

push :: LuaError e => Integer -> LuaE e () #

Pushable CFunction 
Instance details

Defined in HsLua.Class.Pushable

Methods

push :: LuaError e => CFunction -> LuaE e () #

Pushable [Char] 
Instance details

Defined in HsLua.Class.Pushable

Methods

push :: LuaError e => [Char] -> LuaE e () #

Pushable a => Pushable [a] 
Instance details

Defined in HsLua.Class.Pushable

Methods

push :: LuaError e => [a] -> LuaE e () #

Pushable (Ptr a) 
Instance details

Defined in HsLua.Class.Pushable

Methods

push :: LuaError e => Ptr a -> LuaE e () #

Pushable a => Pushable (Set a) 
Instance details

Defined in HsLua.Class.Pushable

Methods

push :: LuaError e => Set a -> LuaE e () #

Pushable a => Pushable (Optional a) 
Instance details

Defined in HsLua.Class.Util

Methods

push :: LuaError e => Optional a -> LuaE e () #

(Pushable a, Pushable b) => Pushable (a, b) 
Instance details

Defined in HsLua.Class.Pushable

Methods

push :: LuaError e => (a, b) -> LuaE e () #

(Pushable a, Pushable b) => Pushable (Map a b) 
Instance details

Defined in HsLua.Class.Pushable

Methods

push :: LuaError e => Map a b -> LuaE e () #

(Pushable a, Pushable b, Pushable c) => Pushable (a, b, c) 
Instance details

Defined in HsLua.Class.Pushable

Methods

push :: LuaError e => (a, b, c) -> LuaE e () #

(Pushable a, Pushable b, Pushable c, Pushable d) => Pushable (a, b, c, d) 
Instance details

Defined in HsLua.Class.Pushable

Methods

push :: LuaError e => (a, b, c, d) -> LuaE e () #

(Pushable a, Pushable b, Pushable c, Pushable d, Pushable e) => Pushable (a, b, c, d, e) 
Instance details

Defined in HsLua.Class.Pushable

Methods

push :: LuaError e0 => (a, b, c, d, e) -> LuaE e0 () #

(Pushable a, Pushable b, Pushable c, Pushable d, Pushable e, Pushable f) => Pushable (a, b, c, d, e, f) 
Instance details

Defined in HsLua.Class.Pushable

Methods

push :: LuaError e0 => (a, b, c, d, e, f) -> LuaE e0 () #

(Pushable a, Pushable b, Pushable c, Pushable d, Pushable e, Pushable f, Pushable g) => Pushable (a, b, c, d, e, f, g) 
Instance details

Defined in HsLua.Class.Pushable

Methods

push :: LuaError e0 => (a, b, c, d, e, f, g) -> LuaE e0 () #

(Pushable a, Pushable b, Pushable c, Pushable d, Pushable e, Pushable f, Pushable g, Pushable h) => Pushable (a, b, c, d, e, f, g, h) 
Instance details

Defined in HsLua.Class.Pushable

Methods

push :: LuaError e0 => (a, b, c, d, e, f, g, h) -> LuaE e0 () #

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.