SplitApplyCombine.jl icon indicating copy to clipboard operation
SplitApplyCombine.jl copied to clipboard

possible to open up types on`innerjoin`?

Open ssfrr opened this issue 4 years ago • 2 comments

It looks like the functions given to innerjoin need to be Union{Function, Type}, which precludes callable objects. Would it be possible to remove that restriction?

For some local code I defined (name::Symbol)(x) = getfield(x, name), so I don't have to do so many r->r.foo and can instead just do things like map(:foo, coll), etc. It doesn't work with innerjoin though.

ssfrr avatar Feb 18 '20 19:02 ssfrr

Yes it would be good to support this.

Recently I had moved from Function to include Type as well and expanded the signatures of many of the functions here to accept multiple containers in lieue of functions.

This results in ambiguities between e.g. group(f, array) and group(array1, array2) - here knowing if the first argument is a function/type thing is quite crucial.

Any ideas on the API here are welcome but both those use cases are quite valid. Arguably group could be split into to generic functions though. Thoughts?

andyferris avatar Apr 17 '20 14:04 andyferris

By the way I’ve been tempted to make a PR to make 'Symbolcallable like that inBase` - it’s a really nice Clojure feature for example.

andyferris avatar Apr 17 '20 14:04 andyferris