hslua-0.7.1: A Lua language interpreter embedding in Haskell

Copyright© 2007–2012 Gracjan Polak
2012–2016 Ömer Sinan Ağacan
2017 Albert Krewinkel
LicenseMIT
MaintainerAlbert Krewinkel <tarleb+hslua@zeitkraut.de>
Stabilitybeta
PortabilityFlexibleInstances, ScopedTypeVariables
Safe HaskellNone
LanguageHaskell98

Foreign.Lua.Types.FromLuaStack

Description

Sending haskell objects to the lua stack.

Synopsis

Documentation

class FromLuaStack a where Source #

A value that can be read from the Lua stack.

Minimal complete definition

peek

Methods

peek :: StackIndex -> Lua a Source #

Check if at index n there is a convertible Lua value and if so return it. Throws a LuaException otherwise.

Instances

FromLuaStack Bool Source # 
FromLuaStack Int Source # 

Methods

peek :: StackIndex -> Lua Int Source #

FromLuaStack () Source # 

Methods

peek :: StackIndex -> Lua () Source #

FromLuaStack ByteString Source # 
FromLuaStack Text Source # 
FromLuaStack LuaNumber Source # 
FromLuaStack LuaInteger Source # 
FromLuaStack CFunction Source # 
FromLuaStack LuaState Source # 
FromLuaStack [Char] Source # 

Methods

peek :: StackIndex -> Lua [Char] Source #

FromLuaStack a => FromLuaStack [a] Source # 

Methods

peek :: StackIndex -> Lua [a] Source #

FromLuaStack (Ptr a) Source # 

Methods

peek :: StackIndex -> Lua (Ptr a) Source #

(FromLuaStack a, FromLuaStack b) => FromLuaStack (a, b) Source # 

Methods

peek :: StackIndex -> Lua (a, b) Source #

(Ord a, FromLuaStack a, FromLuaStack b) => FromLuaStack (Map a b) Source # 

Methods

peek :: StackIndex -> Lua (Map a b) Source #

(FromLuaStack a, FromLuaStack b, FromLuaStack c) => FromLuaStack (a, b, c) Source # 

Methods

peek :: StackIndex -> Lua (a, b, c) Source #

(FromLuaStack a, FromLuaStack b, FromLuaStack c, FromLuaStack d) => FromLuaStack (a, b, c, d) Source # 

Methods

peek :: StackIndex -> Lua (a, b, c, d) Source #

(FromLuaStack a, FromLuaStack b, FromLuaStack c, FromLuaStack d, FromLuaStack e) => FromLuaStack (a, b, c, d, e) Source # 

Methods

peek :: StackIndex -> Lua (a, b, c, d, e) Source #

(FromLuaStack a, FromLuaStack b, FromLuaStack c, FromLuaStack d, FromLuaStack e, FromLuaStack f) => FromLuaStack (a, b, c, d, e, f) Source # 

Methods

peek :: StackIndex -> Lua (a, b, c, d, e, f) Source #

(FromLuaStack a, FromLuaStack b, FromLuaStack c, FromLuaStack d, FromLuaStack e, FromLuaStack f, FromLuaStack g) => FromLuaStack (a, b, c, d, e, f, g) Source # 

Methods

peek :: StackIndex -> Lua (a, b, c, d, e, f, g) Source #

(FromLuaStack a, FromLuaStack b, FromLuaStack c, FromLuaStack d, FromLuaStack e, FromLuaStack f, FromLuaStack g, FromLuaStack h) => FromLuaStack (a, b, c, d, e, f, g, h) Source # 

Methods

peek :: StackIndex -> Lua (a, b, c, d, e, f, g, h) Source #

type Result a = Either String a Source #

Result returned when trying to get a value from the lua stack.

peekEither :: FromLuaStack a => StackIndex -> Lua (Either String a) Source #

Try to convert the value at the given stack index to a haskell value. Returns Left with an error message on failure.

pairsFromTable :: (FromLuaStack a, FromLuaStack b) => StackIndex -> Lua [(a, b)] Source #

Read a table into a list of pairs.

toList :: FromLuaStack a => StackIndex -> Lua [a] Source #

Read a table into a list