I would like to process some functions according

to the number of their parameters and with regard

to the return value boolean.

```
function G(f::Function)
! hasparameters(f) && return 0
returnsboolean(f) && return 1
return 2
end
```

How can the query functions "hasparameters"

and “returnsboolean” be implemented?

Assume VERSION >= 0.6.

Edit: ChrisRackauckas’ solution seems to work for my purposes:

```
hasparameters(f) = 0 < maximum((length(m.sig.parameters) for m in methods(f))...)
returnsboolean(f) = first((methods(f)...)).specializations.func.rettype == Bool
function G(f::Function)
returnsboolean(f) && return 1 # query functions with parameters
hasparameters(f) && return 2 # functions with parameters
return 0 # functions with no parameters
end
```