Esempio n. 1
0
def encode_instance(a: A, tpe: type, module: str, names: list) -> Do:
    mod_json = yield encode_json(module)
    names_json = yield encode_json(names)
    return json_object_with_type(Map(module=mod_json, names=names_json), tpe)
Esempio n. 2
0
 def encode(self, data: Tuple) -> Do:
     array = yield encode_json(Lists.wrap(data))
     return json_object_with_type(Map(data=array), tuple)
Esempio n. 3
0
 def encode(self, a: Either[B, A]) -> Do:
     json = yield encode_json(a.value)
     yield Right(json_object_with_type(Map(value=json), type(a)))