hslua-classes-2.3.1: Type classes for HsLua

Copyright | © 2007–2012 Gracjan Polak 2012–2016 Ömer Sinan Ağacan 2017-2024 Albert Krewinkel
License | MIT
Maintainer | Albert Krewinkel <tarleb@hslua.org>
Stability | beta
Portability | FlexibleInstances, ForeignFunctionInterface, ScopedTypeVariables
Safe Haskell | None
Language | Haskell2010

HsLua.Class.Invokable

Description

Call Lua functions from Haskell.

Synopsis

- class Invokable a where
  - addArg :: Name -> (forall e. LuaError e => LuaE e ()) -> NumArgs -> a
- invoke :: Invokable a => Name -> a

# Documentation

class Invokable a where Source #

Helper class used to make Lua functions useable from Haskell.

Methods

addArg :: Name -> (forall e. LuaError e => LuaE e ()) -> NumArgs -> a Source #

#### Instances

Instances details

(LuaError e, Peekable a) => Invokable (LuaE e a) Source # |
Instance details Defined in HsLua.Class.Invokable Methods addArg :: Name -> (forall e0. LuaError e0 => LuaE e0 ()) -> NumArgs -> LuaE e a Source #
(Pushable a, Invokable b) => Invokable (a -> b) Source # |
Instance details Defined in HsLua.Class.Invokable Methods addArg :: Name -> (forall e. LuaError e => LuaE e ()) -> NumArgs -> a -> b Source #

invoke :: Invokable a => Name -> a Source #

Invoke a Lua function. Use as:

    v <- invoke "proc" "abc" (1::Int) (5.0::Double)