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

Types of shell commands #26

Open
andygill opened this issue Jul 17, 2015 · 0 comments
Open

Types of shell commands #26

andygill opened this issue Jul 17, 2015 · 0 comments

Comments

@andygill
Copy link
Member

We have a number of top-level shell commands.

display :: Shell ()
apply :: R a -> Shell ()
query :: T a b -> Shell b

I propose we add two principles.

  • When we return textual information to the user, we standardize around DocH. This is because the user can decide how wide the screen is, if they want LaTeX, the can pretty printer to LaTeX, etc.
  • We only print to the screen for debugging, not regular output. For regular output, we use DocH.

The means we have the types

display :: Shell DocH
apply :: R a -> Shell DocH -- returns the current tree, after the rewrite.
query :: T a b -> Shell b

The GHCi pretty printer can handle DocH - I've make this change already.

Notes:

  • We will throw alway our DocH result if we are running a script. This is not lazy, because of the RPC. We might be able to detect when this happens automatically.
  • display might now be an instance of apply or query.
display = query status -- OR
display = query idR
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

No branches or pull requests

1 participant