You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.:
where the code generator for
bar
makes use of types found inast0
.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:
Since we won't be hacking on GHC just yet, here's a place to discuss ways around these restrictions.
The text was updated successfully, but these errors were encountered: