Slide 12
Slide 12 text
More Results
NestedRecord
✓ can be converted to JSON
(NestedRecord { d: (SimpleRecord { a: 1, b: "b", c: true }) })
-> {"d":{"c":true,"b":"b","a":1}}
✓ can be converted back
✓ can be converted from JSON
{ "d": { "a": 123, "b": "abc", "c": false } }
-> (Right (NestedRecord { d: (SimpleRecord { a: 123, b: "abc",
c: false }) }))
RecordWithArrayAndNullOrUndefined
✓ can be converted to JSON
(RecordWithArrayAndNullOrUndefined { intArray: [1,2,3],
optionalInt: (NullOrUndefined (Just 1)) })
-> {"optionalInt":1,"intArray":[1,2,3]}
✓ can be converted back
✓ can be converted from JSON
{ "intArray": [1, 2, 3] }
-> (Right (RecordWithArrayAndNullOrUndefined {
intArray: [1,2,3], optionalInt: (NullOrUndefined Nothing) }))