Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow for arbitrary key types by serializing keys aswell #55

Open
rapus95 opened this issue Jul 21, 2021 · 0 comments
Open

allow for arbitrary key types by serializing keys aswell #55

rapus95 opened this issue Jul 21, 2021 · 0 comments

Comments

@rapus95
Copy link

rapus95 commented Jul 21, 2021

Right now I have some project where I build a very small database by using a Dict that maps singleton types to arbitrary types.

for example:

abstract type BaseType end
struct Sub1 <: BaseType end
struct Sub2 <: BaseType end

tmp = Dict(Sub1()=>"5", Sub2()=>10)

what I'm looking for right now is to have a proper way of serializing and deserializing that. Hooking into the abstract type machinery for BaseType didn't help at all. So I wonder, why don't we have the full StructTypes machinery enabled for all types that currently aren't supported as keys? To me that would be a perfectly valid generalization of the current approach given that the currently supported types, Symbol, String and Int64 are mapped per identity rn afaik.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant