hslua-0.6.0: 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.

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.