A possible OTP feature request: syntax for declaring a function spec using a typespec for an anonymous function.

If I define a type specification for an anonymous function, I would like to be able to use that as a specification for a named function. I believe behaviours convey the signatures of implemented callbacks. If the contract is not defined this way, it would be helpful to not repeat/reproduce the signature in all places. Instead use the same named type as the spec signature.

This could look something like:

-module(mod).
-type foo_fun :: (binary() -> boolean()).
-export_type([foo_fun/0]).

Another module:

-spec foo as mod:foo_fun.
foo(Str) -> false.