The EnforcedTypeSignatureCallables
package is being registered: New package: EnforcedTypeSignatureCallables v1.0.0 by JuliaRegistrator · Pull Request #111416 · JuliaRegistries/General · GitHub
Once it’s registered, this link will point to its page on JuliaHub: EnforcedTypeSignatureCallables.jl
The Git repo is on Gitlab:
The package was motivated by the frequent requests by Julia newbies for expressing the type signatures for “functions” in the type system. This doesn’t really make sense as a problem in Julia, but this simple implementation is perhaps close to being a solution.
The package may also be useful for ensuring type stability/helping the Julia compiler’s type inference.
Related
The FunctionWrappers.jl package offers superficially similar functionality, however its goals are actually completely different. Unlike this package, FunctionWrappers doesn’t have a type parameter for the type of the wrapped callable. Thus the same FunctionWrappers type may wrap multiple functions, assuming the type signature is the same.
Also see this recently opened PR to Julia, aiming to make FunctionWrappers obsolete: RFC: Introduce `TypedCallable` by topolarity · Pull Request #55111 · JuliaLang/julia · GitHub
Request for comments
I’m not sure about the naming yet. Specifically, the name of the exported type is TypedCallable
, the same as in the linked Julia PR. It’d probably be good if anyone can think of a better name before EnforcedTypeSignatureCallables is registered.