Bijections.jl
Bijections.jl copied to clipboard
`domain` and `range` fields are not necessary
A suggestion for simplifying the code: It's not necessary to have dedicated domain and range fields, because the domain and range can be obtained with keys(f) and keys(finv). In fact, the Set{T} type in Julia is just a wrapper of Dict{T,Nothing}!
I can't believe it. You are right. in is just haskey! The linear time membership-checking is just the magic of the dict-hash table!
I think the bigger problem is the documentation in the Julia manual for these different data structures.