Consider a web request for 1 or more of 3 keys that are known ahead of time - foo, bar, cow.
curl "http://host/getme?key=foo,cow"
{"foo": "val1", "cow": "val2"} # bar is missing because we didn't ask for it
A typical record type definition won't work because we may or may not get the all the keys in the json reply.
I looked in the docs and the closest match were union (sum) types but are they able to solve this? Not seeing how.
Consider a web request for 1 or more of 3 keys that are known ahead of time - foo, bar, cow.
A typical record type definition won't work because we may or may not get the all the keys in the json reply. I looked in the docs and the closest match were union (sum) types but are they able to solve this? Not seeing how.