Skip to content

Dictionary constructed with one dictionary of keys and one of values #44

Open
@georgematheos

Description

@georgematheos

I think it may be useful to implement a deterministic generative function which takes in 2 dictionaries a and b with the same set of keys, and returns a dictionary mapping from a[k] => b[k] for each key in a/b.

The idea would be to enable things like:

objects ~ get_object_set(...)
vals ~ dictmap_lookup_or_generate(world[:val], lazy_set_to_dict_map(identity, objects))
indices ~ dictmap_lookup_or_generate(world[:index], lazy_set_to_dict_map(identity, objects))
idx_to_val ~ dict_from_keyval_dict(indices, vals)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions