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

Quasiquotation for ReWire types in pattern matching #3

Open
igraves opened this issue Sep 24, 2014 · 0 comments
Open

Quasiquotation for ReWire types in pattern matching #3

igraves opened this issue Sep 24, 2014 · 0 comments

Comments

@igraves
Copy link
Contributor

igraves commented Sep 24, 2014

Just like the title says.

Currently in the compiler source, we match against ReWire types in the following way:

Say you have ReT i o m (). Matching against this construction looks like this.

fun (RWCTyComp (RWCTyApp (RWCTyApp (RWCTyApp (RWCTyCon (TyConId "ReT")) i) o) m)) (TyConID "()") = 

Note the above bindings and how they correspond to the type signature. We can use this binding pattern to quasiquote over concrete types for something like:

fun [rwp|ReT i o m ()] = 

Where rwp above is the ReWire pattern quasiquoter for ReWIre types.

This could certainly shorten up a lot of code in the compiler and make it more legible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant