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

Generic-derived FromSql instance #11

Open
mitchellwrosen opened this issue Jan 12, 2021 · 1 comment
Open

Generic-derived FromSql instance #11

mitchellwrosen opened this issue Jan 12, 2021 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@mitchellwrosen
Copy link

It would be great to be able to derive FromSql from Generic :)

@bergey bergey added the help wanted Extra attention is needed label Jan 13, 2021
@bergey
Copy link
Owner

bergey commented Jan 13, 2021

I got a bit more info from Mitchell in DMs:

TH is always a pain to use, as it sometimes requires moving code around to satisfy various visibility checks (like how a module can’t refer to splices defined inside of itself), plus the annoying compile-time hit you take due to the conservative (and correct) assumption that a TH splice may perform arbitrary IO. So whenever you touch module A that is imported by module B, where B contains a benign $deriveFromSql, regardless of if the interface file could otherwise tell GHC it isn’t necessary to recompile B (because something unused by B was modified in A), B will be recompiled regardless.

This isn't a high priority for me personally, but I'd gratefully accept a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants