hslua- Bindings to Lua, an embeddable scripting language
Copyright© 2020 Albert Krewinkel
MaintainerAlbert Krewinkel <tarleb+hslua@zeitkraut.de>
Safe HaskellNone



Functions which marshal and push Haskell values onto Lua's stack.



type Pusher a = a -> Lua () Source #

Function to push a value to Lua's stack.


pushBool :: Pusher Bool Source #

Pushes a Bool as a Lua boolean.

pushIntegral :: (Integral a, Show a) => a -> Lua () Source #

Pushes an Integer to the Lua stack. Values representable as Lua integers are pushed as such; bigger integers are represented using their string representation.

pushRealFloat :: RealFloat a => a -> Lua () Source #

Push a floating point number to the Lua stack. Uses a string representation for all types which do not match the float properties of the Number type.


pushByteString :: Pusher ByteString Source #

Pushes a ByteString as a raw string.

pushLazyByteString :: Pusher ByteString Source #

Pushes a lazy ByteString as a raw string.

pushString :: String -> Lua () Source #

Pushes a String as an UTF-8 encoded Lua string.

pushText :: Pusher Text Source #

Pushes a Text value as an UTF-8 encoded string.


pushList :: Pusher a -> [a] -> Lua () Source #

Push list as numerically indexed table.

pushMap :: Pusher a -> Pusher b -> Pusher (Map a b) Source #

Push Map as default key-value Lua table.

pushSet :: Pusher a -> Pusher (Set a) Source #

Push a Set as idiomatic Lua set, i.e., as a table with the set elements as keys and true as values.