# How are functors useful?

**URL:** <https://discourse.julialang.org/t/how-are-functors-useful/24110>\
**Category:** New to Julia\
**Tags:** functors\
**Created:** [May 11, 2019, 2:46pm UTC](https://discourse.julialang.org/t/how-are-functors-useful/24110 "2019-05-11T14:46:27Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [May 11, 2019, 3:48pm UTC](https://discourse.julialang.org/t/how-are-functors-useful/24110/6 "2019-05-11T15:48:10Z")

</div>

With a function you can only do one thing, call it. With a functor you can define additional methods to expose other information and functionality, but still have the convenience of a function-call API.

For example, there are various packages (Polynomials, ApproxFun, etc.) that provide a data structure wrapping a polynomial `p`. It is natural to make these callable so that you can use the syntax `p(x)` to evaluate the polynomial, but that’s not _all_ you want to do with polynomials so you need a struct and not an anonymous function.

---

_[View the full topic](https://discourse.julialang.org/t/how-are-functors-useful/24110)._
