You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the Technique parser the offset of a given token in a file is the primary means of tracking the location of any given object within Technique. While elegant, this makes defining valid Semigroup/Monoid instances quite difficult. The offset of the result in the current implementation of Monoid Step's mappend, for example, depends on the order of argument application in violation of the semigroup (<>) associativity law. Switching to a range/relation type (a Functor over an Algebraic Graph, for example) in order to map the domain object used by Technique to its relevant location in the source code would alleviate this issue at the expense of some complexity. This machinery could also be used to represent the refinement and canonicalisation of Technique domain objects and those operation's reasoning and results as those Graph folds. However, because it's such a fundamental change to the parser/internal API, I believe it's one worth having now.
The text was updated successfully, but these errors were encountered:
jaesharp
changed the title
Proposal, Range/Relation types for tracking Source locations instead of direct Offsets
Proposal, Range/Relation types for tracking Source/Domain mappings instead of direct Source Offsets
Jun 26, 2021
We'll need to tackle the equivalent question in Technique v1. It remains to be seen how we will relate the output of the parser to the originating source code.
In the Technique parser the offset of a given token in a file is the primary means of tracking the location of any given object within Technique. While elegant, this makes defining valid Semigroup/Monoid instances quite difficult. The offset of the result in the current implementation of Monoid Step's mappend, for example, depends on the order of argument application in violation of the semigroup (<>) associativity law. Switching to a range/relation type (a Functor over an Algebraic Graph, for example) in order to map the domain object used by Technique to its relevant location in the source code would alleviate this issue at the expense of some complexity. This machinery could also be used to represent the refinement and canonicalisation of Technique domain objects and those operation's reasoning and results as those Graph folds. However, because it's such a fundamental change to the parser/internal API, I believe it's one worth having now.
The text was updated successfully, but these errors were encountered: