Representing Field Families#6

Labels

Milestone

Assignee

2 participants

Another question. According to the Telehash protocol spec (http://telehash.org/proto.html), there can be multiple field in a given json message which are distinguished by a leading '+' character, followed by alpha-numerics. e.g. fields with names like "+end", or "+foo".

Without enumerating all possibilities, is there any way to gather these into a list or other structure in the underlying type?

Currently the closest you can get to this using the standard combinators is using rest which puts all the unprocessed properties on the stack as a map. When I've finished error reporting I'll give this some more thought. Perhaps a function like prop but with type Json a => (String -> Bool) -> Iso (Object :- t) (Object :- a :- t) would already be good enough for this.