HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulehslua-packaging-2.3.1Haskell2010

HsLua.Packaging.Function

Marshaling and documenting Haskell functions.

  • 5 types
  • 25 values

Creating documented functions

12 declarations
valuedefun :: Name -> a -> HsFnPrecursor e a
#

Begin wrapping a monadic Lua function such that it can be turned into a documented function exposable to Lua.

valuelambda :: a -> HsFnPrecursor e a
#

Just like defun, but uses an empty name for the documented function. Should be used when defining methods or operators.

valueliftPure :: (a -> b) -> a -> LuaE e b
#

Turns a pure function into a monadic Lua function.

The resulting function is strict.

valueliftPure2 :: (a -> b -> c) -> a -> b -> LuaE e c
#

Turns a binary function into a Lua function.

The resulting function is strict in both its arguments.

valueliftPure3 :: (a -> b -> c -> d) -> a -> b -> c -> LuaE e d
#

Turns a ternary function into a Lua function.

The resulting function is strict in all of its arguments.

valueliftPure4 :: (a -> b -> c -> d -> e) -> a -> b -> c -> d -> LuaE err e
#

Turns a quarternary function into a Lua function.

The resulting function is strict in all of its arguments.

valueliftPure5
  1. :: a -> b -> c -> d -> e -> f
  2. -> a
  3. -> b
  4. -> c
  5. -> d
  6. -> e
  7. -> LuaE err f
#

Turns a quinary function into a Lua function.

The resulting function is strict in all of its arguments.

Types

Operators

Modifying functions

2 declarations

Pushing to Lua

1 declaration

Convenience functions

4 declarations
valueoptionalParameter
  1. :: Peeker e a

    method to retrieve the value from Lua

  2. -> TypeSpec

    expected Lua type

  3. -> Text

    parameter name

  4. -> Text

    parameter description

  5. -> Parameter e (Maybe a)
#

Deprecated. Use `opt (parameter ...)` instead.

Creates an optional parameter.

DEPRECATED: Use opt (parameter ...) instead.

Internal

2 declarations
valuetoHsFnPrecursor :: StackIndex -> Name -> a -> HsFnPrecursor e a
#

Create a HaskellFunction precursor from a monadic function, selecting the stack index after which the first function parameter will be placed.