quangis / transforge

Describe processes as type transformations, with inference that supports subtypes and parametric polymorphism. Create and query corresponding transformation graphs.
GNU General Public License v3.0
2 stars 0 forks source link

Disable shortcuts #91

Closed nsbgn closed 2 years ago

nsbgn commented 2 years ago

We have a shortcut notation for constraints, in which we can use constraints x[...] as simply their reference x. Actually instating constraints is a side effect.

I think this should be disabled for the release of 0.2, because I'm not sure it is a good idea (it probably conflicts with #86, and also see #85) and I don't want to remove features post-release.

The single way of adding constraints is via the >> operator. Should using a constraint as a reference be deemed a good idea later, it can always be implemented by making a Constraint a Type itself, i.e. give it an .instance() method.

nsbgn commented 2 years ago

In the end, with 0f9feaa86af52ee9887102f70af16510b7bcdbdd the notation was changed so that x[...] only is for adding constraints - it is not a constraint in itself. This makes this issue less important, since we don't blur the boundaries between constraint and type. We can put the constraint anywhere and return the type on which it was put, even if we might later decide to change the structure of constraints, since we can always bubble the constraints up to wherever they need to be. That is why we don't need to bother with parentheses: (x ** x) [x < A] is the same as x ** x [x < A].

(I hope these ramblings sound coherent.)