"access" : [ "view", "edit", "admin" ],
This field should be represented (in the language) as a set of values from an "access-levels" enumeration. [DataMember(Name = "access")]
public HashSet<AccessLevels> Access { get; private set; }
In OCaml, it would be: access : Access.Set.t ;
The simple "json.loads" solution would return a list of strings instead. What's the Python code for turning it into a set of enumeration values, and failing if one of the values does not match ? var! x = expression;
statement;
statement;
And JavaScript would parse it as: return expression.then(function(x) {
statement;
statement;
});
This is obviously shamelessly pilfered from monadic syntax 'let!' in F#, and my own 'let!' extension in OCaml.
When tested on 800 data points, a purely random strategy would have a > 53.5% success rate about 2% of the time.