# Extract function from function type

**URL:** <https://discourse.julialang.org/t/extract-function-from-function-type/90651>\
**Category:** General Usage\
**Tags:** type, functions\
**Created:** [November 22, 2022, 4:06pm UTC](https://discourse.julialang.org/t/extract-function-from-function-type/90651 "2022-11-22T16:06:07Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Mason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mason/32/2423_2.png) [@Mason](https://discourse.julialang.org/u/Mason)\
**Post date:** [November 22, 2022, 4:31pm UTC](https://discourse.julialang.org/t/extract-function-from-function-type/90651/2 "2022-11-22T16:31:04Z")

</div>

Here you go:

> [@How to get a function instance from a function type?](https://discourse.julialang.org/t/how-to-get-a-function-instance-from-a-function-type/79585/2):
>
> No, because not all functions have a one-to-one relationship with their types. For instance, f = let x = 1 y -\> x + y end captures runtime data and cannot be reconstructed from it’s type alone. That said, in the case of functions which are singleton instances, you could do if isdefined(tf, :instance) ft.instance else error("This type does not have a single instance") end

---

_[View the full topic](https://discourse.julialang.org/t/extract-function-from-function-type/90651)._
