Copyright | © 2017 Albert Krewinkel |
---|---|
License | MIT |
Maintainer | Albert Krewinkel <tarleb@zeitkraut.de> |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Glue to hslua for aeson values.
This provides a StackValue
instance for aeson's Value
type. The following
conventions are used:
Null
values are encoded as the special global_NULL
. UsingNil
would 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.
- registerNull :: Lua ()
Documentation
registerNull :: Lua () Source #
Create a new lua state suitable for use with aeson values. This behaves
like newstate
in hslua, but initializes the _NULL
global. That variable
is used to encode null values.
Orphan instances
ToLuaStack Scientific Source # | |
ToLuaStack Value Source # | Hslua StackValue instance for the Aeson Value data type. |
FromLuaStack Scientific Source # | |
FromLuaStack Value Source # | |
ToLuaStack a => ToLuaStack (Vector a) Source # | |
FromLuaStack a => FromLuaStack (Vector a) Source # | |
(Eq a, Hashable a, ToLuaStack a, ToLuaStack b) => ToLuaStack (HashMap a b) Source # | |
(Eq a, Hashable a, FromLuaStack a, FromLuaStack b) => FromLuaStack (HashMap a b) Source # | |