| Copyright | © 2017–2018 Albert Krewinkel |
|---|---|
| License | MIT |
| Maintainer | Albert Krewinkel <tarleb@zeitkraut.de> |
| Stability | experimental |
| Portability | portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Foreign.Lua.Aeson
Contents
Description
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.
Documentation
Push the value which represents JSON null values to the stack (a specific
empty table by default). Internally, this uses the contents of the
HSLUA_AESON_NULL registry field; modifying this field is possible, but it
must always be non-nil.
Orphan instances
| Peekable Scientific Source # | |
Methods peek :: StackIndex -> Lua Scientific # | |
| Peekable Value Source # | |
Methods peek :: StackIndex -> Lua Value # | |
| Pushable Scientific Source # | |
Methods push :: Scientific -> Lua () # | |
| Pushable Value Source # | Hslua StackValue instance for the Aeson Value data type. |
| Peekable a => Peekable (Vector a) Source # | |
Methods peek :: StackIndex -> Lua (Vector a) # | |
| Pushable a => Pushable (Vector a) Source # | |
| (Eq a, Hashable a, Peekable a, Peekable b) => Peekable (HashMap a b) Source # | |
Methods peek :: StackIndex -> Lua (HashMap a b) # | |
| (Eq a, Hashable a, Pushable a, Pushable b) => Pushable (HashMap a b) Source # | |