I'm new to Julia. This may be a stupid question, but I can't seem to get the syntax for this right.
I can do
check_condition(func::F, arg::Int) where {F} = func(arg)
and
check_condition(func::Function, arg::Int)::Bool = func(arg)
But if I want to include both the type annotation and the external where clause I keep getting syntax errors. The following don't seem to work:
check_condition(func::F, arg::Int) where {F}::Bool = func(arg)
(check_condition(func::F, arg::Int) where {F})::Bool = func(arg)
check_condition(func::F, arg::Int)::Bool where {F} = func(arg)
check_condition::Bool(func::F, arg::Int) where {F} = func(arg)
This does work, but I believe it is not equivalent to what I want, since the type parameter is hidden from the method body (assume I want to use it somewhere within)
check_condition(func::F where {F}, arg::Int)::Bool = func(arg)
What is the proper way of writing this?
Thanks