@hackage hslua-aeson2.0.0
Allow aeson data types to be used with lua.
Installation
Tested Compilers
Dependencies (12)
- aeson >=2.0 && <2.1
- base >=4.8 && <5
- bytestring >=0.10.2 && <0.12
- containers >=0.5.9 && <0.7
- hashable >=1.2 && <1.5
- hslua-core >=2.0 && <2.1 Show all…
Dependents (4)
@hackage/acme-everything, @hackage/hslua, @hackage/pandoc, @hackage/pandoc-lua-engine
hslua-aeson
Glue to hslua for aeson values.
This provides a StackValue instance for aeson's Value type. The following
conventions are used:
-
Nullvalues are encoded as a special value (stored in the registry fieldHSLUA_AESON_NULL). Usingnilwould cause problems with null-containing arrays. -
Objects are converted to tables in a straight-forward way.
-
Arrays are converted to Lua tables. Array-length is included as the value at index 0. This makes it possible to distinguish between empty arrays and empty objects.
-
JSON numbers are converted to Lua numbers (usually doubles), which can cause a loss of precision.
License
This project is licensed under the liberal MIT license, the same license under which hslua and lua itself are published. See the LICENSE file for details.