exactprint prototype, barbie approach#11690
Draft
leana8959 wants to merge 49 commits intohaskell:masterfrom
Draft
exactprint prototype, barbie approach#11690leana8959 wants to merge 49 commits intohaskell:masterfrom
leana8959 wants to merge 49 commits intohaskell:masterfrom
Conversation
fix build error
don't allow other types as modifiers
stop using undecidable instances
rewrite condtree as barbie
rewrite condbranch as barbie
fix build
add ExactParsec class
simple example for dependency
make PackageName a barbie
fix build
pass down modifier to package name barbie
update Dependency's ExactParsec instance
complete PackageName exactparse proof of concept
use exactparsec to define parsec
parameterize VersionRange
parameterize Version
pass down modifier to version barbie
remove ExactParsec class
Rename Barbie -> With, WithTrivia -> Ann
implement VersionRangeAnn Parsec instance
define Parsec without ann
remodel trivia representation
remodel version range
fix trailing / leading string
implement pretty VersionRangeAnn
use VersionRangeAnn in DependencyAnn
implement pretty DependencyAnn
parameterize BuildInfo
parameterize Library
parameterize GenericPackageDescription
refactor modify
rename type variable for consistency
Modifiers now have kind type
make buildinfo lens polymorphic
update codebase to match HasBuildInfo change
introduce constraint alias
fix compilation
run formatter
implement Ann variant of HasBuildInfoWith class
make buildInfoFieldGrammar generic
make optionsFieldGrammar generic
make profOptionsfieldGrammar generic
make sharedOptionsFieldGrammar generic
make profSharedOptionsFieldGrammar generic
make hsSourceDirsGrammar generic
export GenericPackageDescriptionAnn alias
run formatter
clean up
make library's lens polymorphic
make libraryFieldGrammar polymorphic
add dependency parsec/pretty instance tests
complete dependency roundtrip
refactor cabal versioned tests
test entirety of cabal dependency specification
parameterize newtype combinators
fix compile errors
make testcases names more descriptive
implement trivia-aware commavcat
run fourmolu
fix warnings
implement trivia-aware commafcat
implement trivia-aware vcatann
run fourmolu
implement trivia-aware fsepann
implement trivia-aware NoCommaFSepAnn
only guard ^>= bound test behind cabal version 2
implement parsec instance of trivia-aware polymorphic list combinator
implement pretty instance of trivia-aware list combinator
add all tests for combinators
fix VCatAnn and FSepAnn leading trivia parsing
fix VCatAnn and FSepAnn optional comma
fix CommaVCatAnn and CommaFSepAnn trailing
correct parsec pretty test names
factor out parsecSpaceAnn pattern
include position in trivia model
refactor cabal-syntax to use DataKinds
This makes the modifier closed
fix project wide compilation errors
create PrettPos as subclass of Pretty
add todos
Revert "create PrettPos as subclass of Pretty"
Retrieve stored position from the Pretty instances and pass them to FieldGrammar.
What was tried:
- [x] MultiParamTypeClasses
Breaking all downstream instances due to instance head change.
- [x] TypeFamilies:
Impossible to use injectivity because one modifier has more than one `a`.
Otherwise requires all sites to define the associated type modifier.
- [x] PrettyPos as subclass of Pretty. Use PrettyPos in FieldGrammar.
Enforces all field grammar to have position. Not all of them have position.
- [ ] Combine MultiParamTypeClasses and PrettyPos subclass:
Flexibility: not all field grammar need to have the same output type.
No breakage: downstream instance heads aren't changed. We create a new class.
In some situations we want to pass around not only the whitespaces trivia, but also Position. This makes it possible to reuse the Trivia type for Position.
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.
Please read Github PR Conventions and then fill in one of these two templates.
Template Α: This PR modifies behaviour or interface
Include the following checklist in your PR:
significance: significantin the changelog file.Template B: This PR does not modify behaviour or interface
E.g. the PR only touches documentation or tests, does refactorings, etc.
Include the following checklist in your PR: