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

Convenient cross-module reification #8

Open
conal opened this issue Apr 13, 2014 · 0 comments
Open

Convenient cross-module reification #8

conal opened this issue Apr 13, 2014 · 0 comments

Comments

@conal
Copy link
Owner

conal commented Apr 13, 2014

Inter-module access to reified definitions is a bit tricky. So far module interfaces are kept intact, including type signatures. Since reification produces a different type (reifyE :: a -> E p a), this constraint means that no reified definitions can be exported. Instead, we wrap a reified expression in a evalE call. The idea is to inline that definition elsewhere, in the context of applying reifyE, hoping that the reifyE/evalE rewrite rule will kick in. In order to reduce the amount of inlining required, there's a second trick. Split foo = evalE ... into foo_reified = ... and foo = evalE foo_reified. We need only inline this short foo definition to get the reifyE/evalE rule to fire.

I've been unable to get the required inlining and simplification to happen in a client module (i.e., one using a reified module), however, without specially handling that module as well.

The rewrite rule trick gives indirect access to the unexported foo_reified definitions via reifyE foo. Look for more robust alternatives.

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