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

Discuss ways to avoid "helper" modules #6

Open
cronburg opened this issue Aug 30, 2017 · 0 comments
Open

Discuss ways to avoid "helper" modules #6

cronburg opened this issue Aug 30, 2017 · 0 comments

Comments

@cronburg
Copy link
Owner

GHC quasiquotation currently necessitates a number of staging restrictions:

I can't ask for the type of a declaration defined above a splice in the same module. This makes splitting up the compilation process into multiple stages a logistical nightmare, e.g.:

ast0 = [foo| ... |]
ast1 = [bar| ... ast0 ... |]

where the code generator for bar makes use of types found in ast0.

I also cannot ask for the type of an arbitrary Haskell expression. This is necessary in order to syntactically inline grammar production rules with AST constructors that are functions (not just data constructors).

The principled solution to these problems are:

  • Extend GHC quasiquotation to run the type checker
  • Extend the GHC type checker to support type checking of compilation units other than modules (i.e. where another part of the compiler can provide the environments)

Since we won't be hacking on GHC just yet, here's a place to discuss ways around these restrictions.

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