AlgebraicJulia / GATlab.jl

GATlab: a computer algebra system based on generalized algebraic theories (GATs)
https://algebraicjulia.github.io/GATlab.jl/
MIT License
23 stars 2 forks source link

Theories should not be sensitive to ordering of @op blocks #96

Closed olynch closed 11 months ago

olynch commented 11 months ago

Right now, @op blocks are interpreted by adding aliases to the currently build scope, in an intermediate step. This means that @op blocks have to go after the things they are bound to, and before the aliases are used. This is not backwards compatible with Catlab, and is unintuitive.

There are several possible ways to fix this. One is by "saving" all the aliases, and then adding them to any definition which is aliased as soon as that definition is made. Another is by rethinking how we do aliasing. The former will probably be quicker to implement, while the latter may be necessary for other reasons later down the line.