MLstate / opalang

The Opa Language for Web Application Development
http://opalang.org
Other
1.24k stars 125 forks source link

Fix opa serialization of lists #157

Closed HenriChataing closed 9 years ago

HenriChataing commented 10 years ago

It may be needed to have opa serialization translate lists to equivalent Json arrays, for example for the implementation of plugins. This has been implemented in OpaSerialize.serialize, but not in the core.

And a bug in OpaSerialize: sometimes, lists are badly translated: OpaSerialize.serialize(["a"]) returns {"hd": "a", "tl": []} OpaSerialize.serialize(["a","b"]) returns {"hd": "a", "tl": ["b"]}

HenriChataing commented 9 years ago

This is due to list types being expanded into {'a hd, list('a) tl}, and is solved by adding test cases to the serialisation of records and rows.