hslua-aeson-0.3.0: Allow aeson data types to be used with lua.

Copyright© 2017 Albert Krewinkel
LicenseMIT
MaintainerAlbert Krewinkel <tarleb@zeitkraut.de>
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

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:

  • Null values are encoded as the special global _NULL. Using Nil 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.

Synopsis

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 # 

Methods

push :: Scientific -> Lua () #

ToLuaStack Value Source #

Hslua StackValue instance for the Aeson Value data type.

Methods

push :: Value -> Lua () #

FromLuaStack Scientific Source # 
FromLuaStack Value Source # 

Methods

peek :: StackIndex -> Lua Value #

ToLuaStack a => ToLuaStack (Vector a) Source # 

Methods

push :: Vector a -> Lua () #

FromLuaStack a => FromLuaStack (Vector a) Source # 

Methods

peek :: StackIndex -> Lua (Vector a) #

(Eq a, Hashable a, ToLuaStack a, ToLuaStack b) => ToLuaStack (HashMap a b) Source # 

Methods

push :: HashMap a b -> Lua () #

(Eq a, Hashable a, FromLuaStack a, FromLuaStack b) => FromLuaStack (HashMap a b) Source # 

Methods

peek :: StackIndex -> Lua (HashMap a b) #