# Get f from typeof(f)

**URL:** <https://discourse.julialang.org/t/get-f-from-typeof-f/82724>\
**Category:** General Usage\
**Tags:** question, type\
**Created:** [June 14, 2022, 4:39am UTC](https://discourse.julialang.org/t/get-f-from-typeof-f/82724 "2022-06-14T04:39:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tictaccat](https://avatars.discourse-cdn.com/v4/letter/t/9f8e36/32.png) [@tictaccat](https://discourse.julialang.org/u/tictaccat)\
**Post date:** [June 14, 2022, 4:39am UTC](https://discourse.julialang.org/t/get-f-from-typeof-f/82724/1 "2022-06-14T04:39:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![aramirezreyes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aramirezreyes/32/42573_2.png) [@aramirezreyes](https://discourse.julialang.org/u/aramirezreyes)\
**Post date:** [June 14, 2022, 4:46am UTC](https://discourse.julialang.org/t/get-f-from-typeof-f/82724/2 "2022-06-14T04:46:28Z")

</div>

Relevant: [How to get a function instance from a function type? - #2 by Mason](https://discourse.julialang.org/t/how-to-get-a-function-instance-from-a-function-type/79585/2)
