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

Sharing types between frontend (ghcjs) and backend (ghc) #667

Closed
mchaver opened this issue Apr 17, 2017 · 2 comments
Closed

Sharing types between frontend (ghcjs) and backend (ghc) #667

mchaver opened this issue Apr 17, 2017 · 2 comments

Comments

@mchaver
Copy link

mchaver commented Apr 17, 2017

persistent is a pretty big project and it would be nice if there was a way to define a types package, share it between GHC backend and GHCJS frontend without GHCJS depending on persistent. Also I found that some versions of persistent have trouble compiling with GHCJS. Ideally there could be a way to declare your models as types first and then apply a version of mkPersist to an existing type and produce all of the necessary persistent typeclasses and functions on the GHC side only and don't reproduce . Conceptually I don't think it is too challenging but there are a few things from persistent that need to be shared on both sides, namely Entity, Key and Id. Perhaps we could have a small base package that defines these, then the GHCJS package and the main persistent package can import them, but I am not sure how challenging it would be to pull those out.

(For reference, this was also an issue mentioned on groundhog lykahb/groundhog#53)

@gregwebs
Copy link
Member

This is certainly not the first time this approach has been proposed. Its tough to find a satisfactory solution here, particularly around adding meta-data annotations. But I think it would be great to have an alternate way to declare as you are suggesting.

@parsonsmatt
Copy link
Collaborator

Closing as a duplicate of #476

I think I may have misunderstood, so if I have, feel free to reopen and clarify :)

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

3 participants