HsLua.Class.Invokable

hslua-classes-2.1.0: Type classes for HsLua

Copyright | © 2007–2012 Gracjan Polak 2012–2016 Ömer Sinan Ağacan 2017-2022 Albert Krewinkel
License | MIT
Maintainer | Albert Krewinkel <tarleb+hslua@zeitkraut.de>
Stability | beta
Portability | FlexibleInstances, ForeignFunctionInterface, ScopedTypeVariables
Safe Haskell | Safe-Inferred
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 #

Helper class used to make Lua functions useable from Haskell.

Methods

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

#### Instances

Instances details

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

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

Invoke a Lua function. Use as:

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