How do I define a dictionary type for tuples with functions as elements?

I want to create a dictionary whose entries are 2-tuples where the second element is a function.

One such dictionary would be:

di1 = Dict(:C => ([:AA], identity))

However, its type does not match what I want:

typeof(di1)
# Dict{Symbol, Tuple{Vector{Symbol}, typeof(identity)}}

This is true:

typeof(identity) <: Function
# true

But this is false:

typeof(di1) <: Dict{Symbol, Tuple{Vector{Symbol}, <:Function}}
# false

So if define:

di2 = Dict(:C => ([:AA], x -> x))

I get:

typeof(di2) <: typeof(di1)
# false

How can I define a type for Dict(:C => ([:AA], f)) so that it works for any function f?

If you define such a dict with two entries, you get the less specific type

julia> typeof(Dict(:C => ([:AA], identity), :D => ([:AA], map)))
Dict{Symbol, Tuple{Vector{Symbol}, Function}}

and you can define your di1 explicitly with this type:

julia> di1 = Dict{Symbol, Tuple{Vector{Symbol}, Function}}(:C => ([:AA], identity))
Dict{Symbol, Tuple{Vector{Symbol}, Function}} with 1 entry:
  :C => ([:AA], identity)

Is this sufficient for your needs?

It works. Thanks.