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

Base on smaller elm codegen library? #41

Open
mitchellwrosen opened this issue Nov 29, 2018 · 2 comments
Open

Base on smaller elm codegen library? #41

mitchellwrosen opened this issue Nov 29, 2018 · 2 comments

Comments

@mitchellwrosen
Copy link

I've thrown together a library that just generates Elm types from Haskell ones:

https://github.com/mitchellwrosen/elm-codegen

Would you be interested in basing this library atop that one? If so, I can throw it up on Hackage and am willing to maintain it.

The main benefit here is separation of concerns (and maintenance) - after just extracting an Elm type from a Haskell one, there's more to do of course... how the Elm type should look (e.g. optionally turning records into type aliases or messing with record field names), pretty-printing, JSON encoder/decoder generation, etc.

Also, fwiw, my template haskell code does handle the "phantom type variable" case just fine, which I noticed is still an open ticket here.

@mitchellwrosen
Copy link
Author

I also have my eye on language-elm as a way of standardizing on the Elm AST (annoying that the elm compiler itself is not on Hackage). But for now, I've just implemented one-off data types for Elm declarations.

@bartavelle
Copy link
Collaborator

The separation of concerns is not obvious at all. The point of elm-bridge is that it will sync your Elm code with your aeson options, so unless you support this it will not work! OTOH, I would be very interested in some sort of pretty printer for types and functions in Elm. It is really annoying the compiler is not on hackage!

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