JuliaData / JuliaData/StructTypes.jl
allow for arbitrary key types by serializing keys aswell
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 86
- Forks
- 21
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing how StructTypes currently handles Symbol, String, and Int64 keys, along with the BaseType dispatch mentioned in the issue. Define the supported arbitrary-key behavior for serialization and deserialization, then add coverage for the Sub1/Sub2 Dict example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- data
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100