hslua-0.9.4: A Lua language interpreter embedding in Haskell

Copyright© 2017 Albert Krewinkel
LicenseMIT
MaintainerAlbert Krewinkel <tarleb+hslua@zeitkraut.de>
Stabilitybeta
PortabilityGeneralizedNewtypeDeriving
Safe HaskellNone
LanguageHaskell98

Foreign.Lua.Types.Lua

Description

The core Lua types, including mappings of Lua types to Haskell.

Synopsis

Documentation

newtype Lua a Source #

Lua computation

Constructors

Lua 

Fields

Instances

Monad Lua Source # 

Methods

(>>=) :: Lua a -> (a -> Lua b) -> Lua b #

(>>) :: Lua a -> Lua b -> Lua b #

return :: a -> Lua a #

fail :: String -> Lua a #

Functor Lua Source # 

Methods

fmap :: (a -> b) -> Lua a -> Lua b #

(<$) :: a -> Lua b -> Lua a #

Applicative Lua Source # 

Methods

pure :: a -> Lua a #

(<*>) :: Lua (a -> b) -> Lua a -> Lua b #

liftA2 :: (a -> b -> c) -> Lua a -> Lua b -> Lua c #

(*>) :: Lua a -> Lua b -> Lua b #

(<*) :: Lua a -> Lua b -> Lua a #

MonadIO Lua Source # 

Methods

liftIO :: IO a -> Lua a #

MonadThrow Lua Source # 

Methods

throwM :: Exception e => e -> Lua a #

MonadCatch Lua Source # 

Methods

catch :: Exception e => Lua a -> (e -> Lua a) -> Lua a #

MonadMask Lua Source # 

Methods

mask :: ((forall a. Lua a -> Lua a) -> Lua b) -> Lua b #

uninterruptibleMask :: ((forall a. Lua a -> Lua a) -> Lua b) -> Lua b #

ToHaskellFunction HaskellFunction Source # 
MonadReader LuaState Lua Source # 

Methods

ask :: Lua LuaState #

local :: (LuaState -> LuaState) -> Lua a -> Lua a #

reader :: (LuaState -> a) -> Lua a #

FromLuaStack a => LuaCallFunc (Lua a) Source # 

Methods

callFunc' :: String -> Lua () -> NumArgs -> Lua a Source #

ToLuaStack a => ToHaskellFunction (Lua a) Source # 

luaState :: Lua LuaState Source #

Get the lua state of this lua computation.

runLuaWith :: LuaState -> Lua a -> IO a Source #

Run lua computation with custom lua state. Errors are left unhandled, the caller of this function is responsible to catch lua errors.

liftIO :: MonadIO m => forall a. IO a -> m a #

Lift a computation from the IO monad.

liftLua :: (LuaState -> IO a) -> Lua a Source #

Turn a function of typ LuaState -> IO a into a monadic lua operation.

liftLua1 :: (LuaState -> a -> IO b) -> a -> Lua b Source #

Turn a function of typ LuaState -> a -> IO b into a monadic lua operation.