Skip to content

exactprint prototype, barbie approach#11690

Draft
leana8959 wants to merge 49 commits intohaskell:masterfrom
leana8959:gpd-barbie
Draft

exactprint prototype, barbie approach#11690
leana8959 wants to merge 49 commits intohaskell:masterfrom
leana8959:gpd-barbie

Conversation

@leana8959
Copy link
Copy Markdown
Collaborator

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:


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:

  • Patches conform to the coding conventions.
  • Is this a PR that fixes CI? If so, it will need to be backported to older cabal release branches (ask maintainers for directions).

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant