# Higher-order function argument types

**URL:** <https://discourse.julialang.org/t/higher-order-function-argument-types/7348>\
**Category:** General Usage\
**Tags:** question\
**Created:** [November 28, 2017, 5:56am UTC](https://discourse.julialang.org/t/higher-order-function-argument-types/7348 "2017-11-28T05:56:07Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [November 28, 2017, 2:49pm UTC](https://discourse.julialang.org/t/higher-order-function-argument-types/7348/3 "2017-11-28T14:49:04Z")

</div>

You may find these related discussions useful. They have pointers to discussions in issues, and other discussions on this forum, and previously Google groups, etc.

> [@Want a field signature more specific than 'Function'](https://discourse.julialang.org/t/want-a-field-signature-more-specific-than-function/1562):
>
> I have some predicate types that have a predicate field. I want my fields to be of type (t::T -\> Bool). Instead they’re of type Function. It all looks like this: abstract Foo{T} type unP{T} \<: Foo{T} p::Function end un = unP{Int}(t::Int -\> t \> 0); println(typeof(un.p)) type andP{T} \<: Foo{T} p::Vector{Function} end and = andP{Int}([t -\> t \> 0, t -\> t \< 10]); println(typeof(and.p)) and.p[1](1) |\> println type AndP{T} \<: Foo{T} p::Tuple{Foo{T},Foo{T}} end And = AndP((un,un)); println(t…

> [@Ability to define function templates](https://discourse.julialang.org/t/ability-to-define-function-templates/4867):
>
> I’ve ran into multiple scenarios now where I’d like to pass a function as an argument to another function, but I want to make sure it conforms to a certain type signature. For example: function dosomething(times::Int,doit::Function) for i=1:times doit(i) end end What I’d like to do in the above example is restrict doit() to any Function that takes a single Int argument. Obviously, I could just document that in the usage, and “hope” that it works out. But, I think it would be …

> [@Function Parameter Speculation #17168](https://discourse.julialang.org/t/function-parameter-speculation-17168/1677):
>
> (continuing this from [https://github.com/JuliaLang/julia/issues/17168#issuecomment-275004495](https://github.com/JuliaLang/julia/issues/17168#issuecomment-275004495)) Haskell’s lack of “dynamic” multiple dispatch is because it’s a static language There’s no formal definition of what characterizes a static language, but I don’t think this necessarily part of it. Julia can be defined to fit into the “static language” category[1] (it can be compiled to native code without need for an interpreter) and has multiple dispatch. Java doesn’t have multiple dispatch and isn…

> [@Proposal for a first-class dispatch wrapper](https://discourse.julialang.org/t/proposal-for-a-first-class-dispatch-wrapper/1127):
>
> Most concepts in Julia have first-class object representations. However, currently dispatch is arguably not one of those things. This hasn’t been a huge issue so far, since people have sometimes found various workarounds. But I want to propose adding a sort of explicit arrow type. I think this would also be especially helpful in dealing with the new world update logic. This also would be an answer to [Helping julia with runtime dispatch/arrowtypes](https://discourse.julialang.org/t/helping-julia-with-runtime-dispatch-arrowtypes/1104). Current developments in this direction include…

---

_[View the full topic](https://discourse.julialang.org/t/higher-order-function-argument-types/7348)._
