Repository navigation
Split Transformer into a pure class and ProjectIn - #4
Merged
Merged
Conversation
thomasjm
force-pushed
the
drop-params-from-position-mapping
branch
from
October 11, 2026 23:48
b51de9c to
a85f61a
Compare
thomasjm
changed the base branch from
drop-params-from-position-mapping
to
main
October 12, 2026 00:05
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes this repo's
Transformerclass match the other three, so the plumbing around it can eventually be shared.Transformerkeeps the pure methods —transformPosition,untransformPosition,unproject.ProjectIn mtakesproject,handleDiff,handleDiffMulti.A single
class Transformer m adoes not work: the pure methods never mentionm, so they become ambiguous at every call site. A fundepa -> mfixes that but pins each transformer to one monad, ruling out a mixed stack. With the split, a transformer states how much monad it needs —Monad mfor pure ones, which keeps them usable atIdentity,MonadIO mfor ones that shell out to a parser.getParamsis gone. AfterParamsleft position mapping its only caller wasunproject, which can read what it needs off the transformer value; cpp and go's implementations were fabricating a constant.unprojectis nowa -> Doc -> Maybe Docwith aNothingdefault.Also drops a stray comment left in
Transformer.hsby the previous PR.Needs
MultiParamTypeClasses. Noteproject @Foobecomesproject @_ @Foo, sincemis the first type argument now.