hslua-classes-2.0.0: Type classes for HsLua
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.Class.Peekable

Description

Sending haskell objects to the lua stack.

Synopsis

Documentation

class Peekable a where Source #

A value that can be read from the Lua stack.

Methods

peek :: PeekError e => StackIndex -> LuaE e a Source #

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 Source # 
Instance details

Defined in HsLua.Class.Peekable

Methods

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

Peekable Double Source # 
Instance details

Defined in HsLua.Class.Peekable

Peekable Float Source # 
Instance details

Defined in HsLua.Class.Peekable

Methods

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

Peekable Int Source # 
Instance details

Defined in HsLua.Class.Peekable

Methods

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

Peekable Integer Source # 
Instance details

Defined in HsLua.Class.Peekable

Peekable () Source # 
Instance details

Defined in HsLua.Class.Peekable

Methods

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

Peekable ByteString Source # 
Instance details

Defined in HsLua.Class.Peekable

Peekable ByteString Source # 
Instance details

Defined in HsLua.Class.Peekable

Peekable Text Source # 
Instance details

Defined in HsLua.Class.Peekable

Methods

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

Peekable Number Source # 
Instance details

Defined in HsLua.Class.Peekable

Peekable Integer Source # 
Instance details

Defined in HsLua.Class.Peekable

Peekable CFunction Source # 
Instance details

Defined in HsLua.Class.Peekable

Peekable State Source # 
Instance details

Defined in HsLua.Class.Peekable

Methods

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

Peekable [Char] Source # 
Instance details

Defined in HsLua.Class.Peekable

Methods

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

Peekable a => Peekable [a] Source # 
Instance details

Defined in HsLua.Class.Peekable

Methods

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

Peekable (Ptr a) Source # 
Instance details

Defined in HsLua.Class.Peekable

Methods

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

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

Defined in HsLua.Class.Peekable

Methods

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

Peekable a => Peekable (Optional a) Source # 
Instance details

Defined in HsLua.Class.Util

Methods

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

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

Defined in HsLua.Class.Peekable

Methods

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

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

Defined in HsLua.Class.Peekable

Methods

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

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

Defined in HsLua.Class.Peekable

Methods

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

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

Defined in HsLua.Class.Peekable

Methods

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

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

Defined in HsLua.Class.Peekable

Methods

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

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

Defined in HsLua.Class.Peekable

Methods

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

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

Defined in HsLua.Class.Peekable

Methods

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

(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) Source # 
Instance details

Defined in HsLua.Class.Peekable

Methods

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

class LuaError e => PeekError e where Source #

Exceptions that are to be used with peek and similar functions must be instances of this class. It ensures that error can be amended with the context in which they happened.

Instances

Instances details
PeekError Exception Source # 
Instance details

Defined in HsLua.Class.Peekable

peekKeyValuePairs :: (Peekable a, Peekable b, PeekError e) => StackIndex -> LuaE e [(a, b)] Source #

Read a table into a list of pairs.

peekList :: (PeekError e, Peekable a) => StackIndex -> LuaE e [a] Source #

Read a table into a list

reportValueOnFailure :: forall e a. PeekError e => ByteString -> (StackIndex -> LuaE e (Maybe a)) -> StackIndex -> LuaE e a Source #

Report the expected and actual type of the value under the given index if conversion failed.

inContext :: forall e a. PeekError e => String -> LuaE e a -> LuaE e a Source #

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.