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

Staged generics don't obviously support traversal #151

Open
treeowl opened this issue Feb 8, 2022 · 1 comment
Open

Staged generics don't obviously support traversal #151

treeowl opened this issue Feb 8, 2022 · 1 comment

Comments

@treeowl
Copy link

treeowl commented Feb 8, 2022

One of the trickiest things to implement well using plain GHC generics is a generic traverse. One of a few rather involved bags of tricks are needed to avoid extra fmap invocations in the ambient Applicative, and none of these are sufficient (with current GHC) to get the generic representations to inline away reliably. I don't claim to understand staged generics fully, but it's not at all obvious to me that they are up to the task either. Are they? If so, how?

@kosmikus
Copy link
Member

Yes, this is a tricky aspect. Section 6.5 of the staged-sop paper talks about this problem and presents something which I consider to be a solution, although I wouldn't be surprised if improvements are possible in this area. Does this help, or do you have reason to believe the approach described there would not work in general?

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

2 participants