Open mehalter opened 4 years ago
Follow-up to issue #112 and PR #130.
The other examples that got dropped where multiargument compose and the declaration of constants. I think it is fine eliminate those from the doctrines as long as we have a way to put them in the syntax. And we want the syntax to do some normalizing of the expressions, like f circ g should get normalized to compose(g,f) and multiple argument compose should only be available in the syntax if we want to autonormalize by applying the associators.
How should we handle constants in the syntax layer? I’d like to be able to write a linear map like copy(X)otimes(scalar(X,5), A)mplus(X) or something like that. Maybe we don’t need scalar values in the syntax and the syntactic expression should just use variables for that, reserving the specification of actual numbers for the instances.
Nvm, I misread the last PR to have deleted the tests for this stuff.
Yeah, the multi-argument compose still works. It's implemented differently in doctrines/Category.jl
. I had to double-check that myself.
After removing support for arbitrary Julia code in
@signature
/@theory
, there is no way to define∘(f, g) = compose(g, f)
where is it available to use throughout the GAT definition, syntax, and instances.