Open sobolevn opened 5 years ago
I'm really trying to push towards gloms-that-transform-gloms
there are a few bits and pieces to get set up, but the idea would be that "inverse of (certain types of) gloms" would be expressable as a spec
for example in your case it might be
(explode_dict, # TBD what would do this recursive explosion
[Coalesce((Check(type=Assign), Assign(T.src, T.dest)), T)], # if it is an assign, return the inverse assign; otherwise return itself
impolide_dict) # TBD how to recursively compress dict back down
obviously there is a lot to figure out here; but I'm pushing to get the pieces in place to allow this kind of thing
@kurtbrose awesome! Thanks.
Hi!
I am using
glom
as a part of my REST API, it is used to serialize and deserialize requests when API does not 100% match existing objects.And I have started to find that these objects are direct inverse of each other.
Is it possible to generate deserialization from the serialization spec? Something like:
glom(spen).inverse()