As a Querki Dev, I can declare the signature of a function
Summary: Currently, I check parameters in an ad hoc way, when we are executing. Instead, the function should declare a list of params, with each one's name and type.
Should be able to give a model as the type, and the system will understand that it expects a Link or Tag to that Model.
The signature includes the context and any parameters.
The signature should itself be a Model Type, but we should ideally optimize this in some fashion, or it will become a bottleneck.
Parameters can be declared to be optional.
Function code can fetch params by name instead of position .
When we call this function, we type-check the params upfront, and give an error if they aren't right.
Think strongly in terms of Haskell when writing this. The whole notion of a function signature as containing potentially multiple bodies is very Haskellian, and there may be a lot of ideas to steal there. It is even possible that the Haskell style of pattern-matching (where each distinct match is a separate implementation of the function) is the right way to implement pattern matching.