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-aeson-2.3.1Haskell2010

HsLua.Aeson

Pushes and retrieves aeson Values to and from the Lua stack.

  • JSON null values are encoded as light userdata containing the NULL pointer.

  • Objects are converted to string-indexed tables.

  • Arrays are converted to sequence tables and are given a metatable. This makes it possible to distinguish between empty arrays and empty objects. The metatable is stored in the registry under key 'HsLua JSON array'' (see also jsonarray).

  • JSON numbers are converted to Lua numbers, i.e., Number; the exact C type may vary, depending on compile-time Lua configuration.

  • 7 values
valuejsonarray :: Name
#

Name of the registry slot holding the metatable given to array tables. The registry entry can be replaced with a different table if needed.

Encoding arbitrary objects

2 declarations
valuepeekToAeson :: Peeker e (ToAeson e)
#

Gets the ToAeson function from a Lua userdata object.

valuepushToAeson :: Pusher e (ToAeson e)
#

Pushes a function that converts the object at a given index into a Value.