Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pretty-printing #71

Open
9 of 16 tasks
epost opened this issue Oct 11, 2018 · 2 comments
Open
9 of 16 tasks

Pretty-printing #71

epost opened this issue Oct 11, 2018 · 2 comments
Assignees
Labels

Comments

@epost
Copy link
Member

epost commented Oct 11, 2018

Current situation

Output looks something like this:

algebra
"E" (2)
-------------
"e"."f": "f" = "e", "a1" = Right ("e"."f","a2"),"a2" = Right ("e"."f","a2")
"e": "f" = "e"."f", "a1" = Right ("e","a2"),"a2" = Right ("e","a2")

Here, algebra is a section heading, and show-like output, such as Right ("e","a2") is mixed with pretty-printed output like the section heading and -------.

TODO

  • indent section bodies; currently, we have things like the following, where :
  • -> String functions should distinguish between pretty-printing and show, which should be the inverse of read.
  • We'll also want to consider some annotated output format like XML, with one obvious use case being to produce HTML.

Ryan's suggestions:

  • make TTerm (in Instance.hs) a newtype with a custom Show
  • in Show Term (in Term.hs) we can strip quotes from printed strings using filter, provided the quotes aren't needed (e.g., no spaces)

Fix Show instances:

  • Schema
  • Entity
  • Attribute
  • Instance
  • Algebra
  • Term
  • Typeside
  • Mapping
  • Query
  • Transform
  • TODO all the XxxEx and XxxRaw ones
@wisnesky
Copy link
Contributor

todo:

  • make TTerm (in Intsance.hs) a new type with a custom show
  • in Show for Term (in Term.hs) we can strip quotes from printed strings using filter, provided the quotes aren't needed (e.g., no spaces)

@wisnesky
Copy link
Contributor

Desired output:

Department (1) | secretary | name
----------------------------------
a.worksIn a a.worksIn.name


Employee (2) | manager | worksIn | age | first | last
--------------------------------------------------------
a a a.worksIn a.age a.first a.last
b b b.worksIn b.age b.first b.last


nat (2)
--------
a.age
b.age

string (5)
-----------
a.worksIn.name

@epost epost assigned epost and unassigned antonleviathan Oct 12, 2018
epost added a commit that referenced this issue Oct 16, 2018
epost added a commit that referenced this issue Oct 16, 2018
epost added a commit that referenced this issue Oct 16, 2018
epost added a commit that referenced this issue Oct 16, 2018
@wires wires added this to Backlog in First Release Oct 29, 2018
@epost epost added the ux label Oct 29, 2018
epost added a commit that referenced this issue Aug 9, 2019
epost added a commit that referenced this issue Aug 9, 2019
epost added a commit that referenced this issue Aug 9, 2019
epost added a commit that referenced this issue Aug 9, 2019
epost added a commit that referenced this issue Aug 9, 2019
epost added a commit that referenced this issue Aug 10, 2019
* Make CQL output structured and human-readable. #71

* More output structure indentation. #71

* Print 4 spaces instead of tabs in output. #71

* Simplify prettyprinting. #71

* Prettify top-level output. #71
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
First Release
  
Backlog
Development

No branches or pull requests

3 participants