# Specific function type

**URL:** https://discourse.julialang.org/t/specific-function-type/117256
**Category:** New to Julia
**Created:** [July 19, 2024, 9:45pm UTC](https://discourse.julialang.org/t/specific-function-type/117256 "2024-07-19T21:45:27Z")
**Posts on this page:** 1
**Showing post:** 21

<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: [July 21, 2024, 12:15pm UTC](https://discourse.julialang.org/t/specific-function-type/117256/21 "2024-07-21T12:15:31Z")

</div>

Note that this has been discussed many times already, e.g.:

- [julia issue #210: function types](https://github.com/JuliaLang/julia/issues/210)
- [Want a field signature more specific than 'Function'](https://discourse.julialang.org/t/want-a-field-signature-more-specific-than-function/1562)
- [Function Parameter Speculation #17168](https://discourse.julialang.org/t/function-parameter-speculation-17168/1677)
- [Function type specification](https://discourse.julialang.org/t/function-type-specification/1749)
- [Ability to define function templates](https://discourse.julialang.org/t/ability-to-define-function-templates/4867)
- [Higher-order function argument types](https://discourse.julialang.org/t/higher-order-function-argument-types/7348)
- [Enforcing function signatures by both argument & return types](https://discourse.julialang.org/t/enforcing-function-signatures-by-both-argument-return-types/8174)
- [Proposal to make functions first class citizens in context of multiple dispatch](https://discourse.julialang.org/t/proposal-to-make-functions-first-class-citizens-in-context-of-multiple-dispatch/12080)
- [How to type annotate functions which take functions as args](https://discourse.julialang.org/t/how-to-type-annotate-functions-which-take-functions-as-args/14158)

Actually implementing it in a way that is compatible with Julia’s multiple dispatch is quite tricky. This is the only start at an attempt that I know of: [julia#10269: Towards typed lambdas](https://github.com/JuliaLang/julia/pull/10269).

For example, it makes runtime behavior / dispatch (whether a particular function `f` is accepted as an argument of another function) potentially dependent on type inference of `f`, which is problematic in a dynamic language like Julia where type inference is not required to succeed — it’s only an optimization. (Unlike static languages like Rust or Haskell.)

---

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