Get f from typeof(f)

How can I get a function f, from the type of the function, i.e. typeof(f)?

Here’s the full story, to avoid the XY problem: I’m using ChainRulesOverloadGeneration which is giving me typeof(f). I would like to run Base.return_types(f, (Float64,)) and do different overloads based on the answer of this call, but since that function requires f rather than typeof(f) I don’t know what to do.

Relevant: How to get a function instance from a function type? - #2 by Mason

1 Like